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.
- {clinton-0.0.2 → clinton-0.0.4}/Clinton/__init__.py +5 -2
- {clinton-0.0.2 → clinton-0.0.4}/Clinton/functions/__init__.py +1 -0
- clinton-0.0.4/Clinton/functions/collections.py +6 -0
- clinton-0.0.4/Clinton/functions/function02.py +78 -0
- {clinton-0.0.2 → clinton-0.0.4}/Clinton/scripts/script01.py +1 -0
- {clinton-0.0.2 → clinton-0.0.4}/PKG-INFO +16 -1
- clinton-0.0.4/README.md +17 -0
- {clinton-0.0.2 → clinton-0.0.4}/clinton.egg-info/PKG-INFO +16 -1
- {clinton-0.0.2 → clinton-0.0.4}/clinton.egg-info/SOURCES.txt +1 -0
- {clinton-0.0.2 → clinton-0.0.4}/clinton.egg-info/requires.txt +1 -0
- clinton-0.0.2/Clinton/functions/function02.py +0 -1
- clinton-0.0.2/README.md +0 -3
- {clinton-0.0.2 → clinton-0.0.4}/Clinton/functions/function01.py +0 -0
- {clinton-0.0.2 → clinton-0.0.4}/Clinton/scripts/__init__.py +0 -0
- {clinton-0.0.2 → clinton-0.0.4}/Clinton/scripts/script02.py +0 -0
- {clinton-0.0.2 → clinton-0.0.4}/Clinton/scripts/script05.py +0 -0
- {clinton-0.0.2 → clinton-0.0.4}/LICENSE +0 -0
- {clinton-0.0.2 → clinton-0.0.4}/clinton.egg-info/dependency_links.txt +0 -0
- {clinton-0.0.2 → clinton-0.0.4}/clinton.egg-info/top_level.txt +0 -0
- {clinton-0.0.2 → clinton-0.0.4}/setup.cfg +0 -0
- {clinton-0.0.2 → clinton-0.0.4}/setup.py +0 -0
|
@@ -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
|
+
#====================================================================================================
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: clinton
|
|
3
|
-
Version: 0.0.
|
|
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
|
+
```
|
clinton-0.0.4/README.md
ADDED
|
@@ -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.
|
|
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
|
+
```
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
clinton-0.0.2/README.md
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|