clinton 0.0.2__tar.gz → 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,11 @@
1
+ builded = "20.08.2024"
1
2
  appname = "clinton"
2
- version = "0.0.2"
3
+ version = "0.0.4"
4
+
3
5
 
4
6
  install = ["aiohttp",
5
- "requests"]
7
+ "requests",
8
+ "ffmpeg-python"]
6
9
 
7
10
  DATA01 = "clintonabrahamc@gmail.com"
8
11
  DATA02 = ['Natural Language :: English',
@@ -1 +1,2 @@
1
1
  from .function01 import InterNet
2
+ from .function02 import Media
@@ -0,0 +1,6 @@
1
+
2
+ class SMessage:
3
+
4
+ def __init__(self, **kwargs):
5
+ self.errors = kwargs.get("errors", None)
6
+ self.result = kwargs.get("result", None)
@@ -0,0 +1,78 @@
1
+ import os
2
+ import time
3
+ import ffmpeg
4
+ import random
5
+ import asyncio
6
+ from ..scripts import Scripted
7
+ from .collections import SMessage
8
+ #====================================================================================================
9
+
10
+ class Media:
11
+
12
+ async def interval(duramini, duration, numbers):
13
+ moonus = random.sample(range(duramini, duration), numbers)
14
+ moonus.sort()
15
+ return moonus
16
+
17
+ #====================================================================================================
18
+
19
+ async def metadata(incoming, outgoing, maps="0", command=None):
20
+ if not command or incoming == None:
21
+ return incoming
22
+ try:
23
+ mainse = ffmpeg.input(incoming)
24
+ nemose = mainse.output(outgoing, map=maps, **command, c="copy")
25
+ moonus = nemose.run(quiet=True)
26
+ os.remove(incoming)
27
+ return SMessage(result=outgoing)
28
+ except ffmpeg.Error as errors:
29
+ moonus = str(errors.stderr.decode('utf-8'))
30
+ return SMessage(result=None, errors=moonus)
31
+ except Exception as errors:
32
+ return SMessage(result=None, errors=errors)
33
+
34
+ #====================================================================================================
35
+
36
+ async def short(stime, etime, file, flocation, extension):
37
+ try:
38
+ output = flocation + str(round(time.time())) + extension
39
+ ffmpeg.input(file, ss=stime, t=etime).output(output).run(quiet=True)
40
+ ouoing = output if os.path.lexists(output) else None
41
+ return ouoing
42
+ except Exception:
43
+ return None
44
+
45
+ #====================================================================================================
46
+
47
+ async def screenshot(file, location, duration, extension=Scripted.DATA11):
48
+ try:
49
+ output = location + str(round(time.time())) + extension
50
+ ffmpeg.input(file, ss=duration).output(output, vframes=1).run(quiet=True)
51
+ ouoing = output if os.path.lexists(output) else None
52
+ return ouoing
53
+ except ffmpeg.Error as errors:
54
+ print(errors)
55
+ return None
56
+ except Exception as errors:
57
+ print(errors)
58
+ return None
59
+
60
+ #====================================================================================================
61
+
62
+ async def screenshots(file, location, numbers, duration, durations=5, images=None):
63
+ imageess = images if images else []
64
+ if duration < durations:
65
+ return imageess
66
+ interval = await Video.interval(durations, duration, numbers)
67
+ for looper in range(numbers):
68
+ valuesom = interval[0]
69
+ imagesve = await Video.screenshot(file, location, valuesom)
70
+ if imagesve == None:
71
+ continue
72
+ imageess.append(imagesve)
73
+ interval.remove(valuesom)
74
+ await asyncio.sleep(3)
75
+ else:
76
+ return imageess
77
+
78
+ #====================================================================================================
@@ -2,3 +2,4 @@
2
2
  class Script01(object):
3
3
 
4
4
  DATA01 = ""
5
+ DATA11 = ".jpg"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clinton
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: ㅤ
5
5
  Home-page: https://github.com/Clinton-Abraham
6
6
  Author: Clinton-Abraham
@@ -21,7 +21,22 @@ Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
22
  Requires-Dist: aiohttp
23
23
  Requires-Dist: requests
24
+ Requires-Dist: ffmpeg-python
24
25
 
25
26
  <p align="center">
26
27
  📦 <a href="https://pypi.org/project/clinton" style="text-decoration:none;">CLINTON</a>
27
28
  </p>
29
+
30
+ ```python
31
+ import asyncio
32
+ from Clinton.functions import Media
33
+
34
+ async def main():
35
+ duration = 7000 # IN SECONDS
36
+ save = "./Home/" # OUTPUT LOCATION
37
+ file = "./Home/Video.mp4" # FILE LOCATION
38
+ result = await Media.screenshot(file, save, duration)
39
+ print(result)
40
+
41
+ asyncio.run(main())
42
+ ```
@@ -0,0 +1,17 @@
1
+ <p align="center">
2
+ 📦 <a href="https://pypi.org/project/clinton" style="text-decoration:none;">CLINTON</a>
3
+ </p>
4
+
5
+ ```python
6
+ import asyncio
7
+ from Clinton.functions import Media
8
+
9
+ async def main():
10
+ duration = 7000 # IN SECONDS
11
+ save = "./Home/" # OUTPUT LOCATION
12
+ file = "./Home/Video.mp4" # FILE LOCATION
13
+ result = await Media.screenshot(file, save, duration)
14
+ print(result)
15
+
16
+ asyncio.run(main())
17
+ ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clinton
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: ㅤ
5
5
  Home-page: https://github.com/Clinton-Abraham
6
6
  Author: Clinton-Abraham
@@ -21,7 +21,22 @@ Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
22
  Requires-Dist: aiohttp
23
23
  Requires-Dist: requests
24
+ Requires-Dist: ffmpeg-python
24
25
 
25
26
  <p align="center">
26
27
  📦 <a href="https://pypi.org/project/clinton" style="text-decoration:none;">CLINTON</a>
27
28
  </p>
29
+
30
+ ```python
31
+ import asyncio
32
+ from Clinton.functions import Media
33
+
34
+ async def main():
35
+ duration = 7000 # IN SECONDS
36
+ save = "./Home/" # OUTPUT LOCATION
37
+ file = "./Home/Video.mp4" # FILE LOCATION
38
+ result = await Media.screenshot(file, save, duration)
39
+ print(result)
40
+
41
+ asyncio.run(main())
42
+ ```
@@ -3,6 +3,7 @@ README.md
3
3
  setup.py
4
4
  Clinton/__init__.py
5
5
  Clinton/functions/__init__.py
6
+ Clinton/functions/collections.py
6
7
  Clinton/functions/function01.py
7
8
  Clinton/functions/function02.py
8
9
  Clinton/scripts/__init__.py
@@ -1,2 +1,3 @@
1
1
  aiohttp
2
2
  requests
3
+ ffmpeg-python
@@ -1 +0,0 @@
1
-
clinton-0.0.2/README.md DELETED
@@ -1,3 +0,0 @@
1
- <p align="center">
2
- 📦 <a href="https://pypi.org/project/clinton" style="text-decoration:none;">CLINTON</a>
3
- </p>
File without changes
File without changes
File without changes