clinton 0.0.4__tar.gz → 0.0.6__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.
@@ -0,0 +1,4 @@
1
+ builded = "20.08.2024"
2
+ updated = "09.11.2026"
3
+ appname = "clinton"
4
+ version = "0.0.6"
@@ -0,0 +1 @@
1
+ from .function01 import Media
@@ -0,0 +1,106 @@
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
+ from hachoir.parser import createParser
9
+ from hachoir.metadata import extractMetadata
10
+ #=====================================================================================================
11
+
12
+ class Media:
13
+
14
+ @staticmethod
15
+ async def interval(numpic, durations, minimum):
16
+ moonus = random.sample(range(minimum, durations), numpic)
17
+ moonus.sort()
18
+ return moonus
19
+
20
+ #=====================================================================================================
21
+
22
+ @staticmethod
23
+ async def filename(location, filename=None, extension=Scripted.DATA06):
24
+ moones = filename if filename else round(time.time())
25
+ moonus = str(location) + str(moones) + extension
26
+ return moonus
27
+
28
+ #=====================================================================================================
29
+
30
+ @staticmethod
31
+ async def duration(flocation, default=0):
32
+ metadato = createParser(flocation)
33
+ metadata = extractMetadata(metadato)
34
+ if not metadata or metadata == None:
35
+ return default
36
+ duration = metadata.get("duration", default)
37
+ durations = duration if duration == 0 else duration.seconds
38
+ return durations
39
+
40
+ #=====================================================================================================
41
+
42
+ @staticmethod
43
+ async def metadata(flocation, outgoing, maps="0", command=None):
44
+ if not command or flocation == None:
45
+ return flocation
46
+ try:
47
+ mainse = ffmpeg.input(flocation)
48
+ nemose = mainse.output(outgoing, map=maps, **command, c="copy")
49
+ moonus = nemose.run(quiet=True)
50
+ except ffmpeg.Error as errors:
51
+ moonus = str(errors.stderr.decode('utf-8'))
52
+ return SMessage(result=None, errors=moonus)
53
+ except Exception as errors:
54
+ return SMessage(result=None, errors=errors)
55
+ else:
56
+ os.remove(flocation)
57
+ return SMessage(result=outgoing)
58
+
59
+ #=====================================================================================================
60
+
61
+ @staticmethod
62
+ async def videoshort(stime, etime, vidfile, extension, dlocation):
63
+ try:
64
+ output = await Media.filename(dlocation, extension=extension)
65
+ ffmpeg.input(vidfile, ss=stime, t=etime).output(output).run(quiet=True)
66
+ moonos = output if os.path.lexists(output) else None
67
+ return moonos
68
+ except Exception:
69
+ return None
70
+
71
+ #=====================================================================================================
72
+
73
+ @staticmethod
74
+ async def screenshot(file, dlocation, duration):
75
+ try:
76
+ output = await Media.filename(dlocation, extension=".jpg")
77
+ ffmpeg.input(file, ss=duration).output(output.filename, vframes=1).run(quiet=True)
78
+ moonos = output.filename if os.path.lexists(output.filename) else None
79
+ return SMessage(result=moonos)
80
+ except ffmpeg.Error as errors:
81
+ moonus = errors.stderr.decode('utf-8')
82
+ return SMessage(errors=str(moonus))
83
+ except Exception as errors:
84
+ return SMessage(errors=moonus)
85
+
86
+ #=====================================================================================================
87
+
88
+ @staticmethod
89
+ async def screenshots(imog, file, location, numpic, dminimum=5, imageses=[], counters=0):
90
+ durations = await Media.duration(file)
91
+ if durations < dminimum:
92
+ return imageses
93
+ interval = await Media.interval(numpic, durations, dminimum)
94
+ for looper in range(numpic):
95
+ valuesom = interval[0]
96
+ imagesos = await Media.screenshot(file, location, valuesom)
97
+ if imagesos.result == None:
98
+ continue
99
+ counters += 1
100
+ imageses.append(imagesos.result)
101
+ interval.remove(valuesom)
102
+ await asyncio.sleep(2)
103
+ else:
104
+ return imageses
105
+
106
+ #=====================================================================================================
@@ -0,0 +1,11 @@
1
+
2
+ class Script01(object):
3
+
4
+ DATA01 = ""
5
+ DATA02 = " "
6
+ DATA06 = "/"
7
+ DATA11 = ".jpg"
8
+ DATA12 = ".mp4"
9
+ DATA13 = "Unknown"
10
+ DATA14 = "Unknown.tmp"
11
+ DATA15 = "Unknown.mp4"
@@ -1,11 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: clinton
3
- Version: 0.0.4
4
- Summary: ㅤ
5
- Home-page: https://github.com/Clinton-Abraham
6
- Author: Clinton-Abraham
7
- Author-email: clintonabrahamc@gmail.com
8
- License: MIT
3
+ Version: 0.0.6
4
+ Summary: Clinton
5
+ Author-email: Clinton Abraham <clintonabrahamc@gmail.com>
6
+ Project-URL: Homepage, https://telegram.me/Clinton_Abraham
9
7
  Keywords: apps,python,extensions
10
8
  Classifier: Natural Language :: English
11
9
  Classifier: Intended Audience :: Developers
@@ -13,14 +11,13 @@ Classifier: Operating System :: OS Independent
13
11
  Classifier: Programming Language :: Python :: 3.10
14
12
  Classifier: Programming Language :: Python :: 3.11
15
13
  Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Topic :: Software Development :: Libraries
17
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
- Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
19
- Requires-Python: ~=3.10
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: 3.15
17
+ Requires-Python: >=3.10
20
18
  Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Requires-Dist: aiohttp
23
- Requires-Dist: requests
19
+ Requires-Dist: pillow
20
+ Requires-Dist: hachoir
24
21
  Requires-Dist: ffmpeg-python
25
22
 
26
23
  <p align="center">
@@ -1,11 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: clinton
3
- Version: 0.0.4
4
- Summary: ㅤ
5
- Home-page: https://github.com/Clinton-Abraham
6
- Author: Clinton-Abraham
7
- Author-email: clintonabrahamc@gmail.com
8
- License: MIT
3
+ Version: 0.0.6
4
+ Summary: Clinton
5
+ Author-email: Clinton Abraham <clintonabrahamc@gmail.com>
6
+ Project-URL: Homepage, https://telegram.me/Clinton_Abraham
9
7
  Keywords: apps,python,extensions
10
8
  Classifier: Natural Language :: English
11
9
  Classifier: Intended Audience :: Developers
@@ -13,14 +11,13 @@ Classifier: Operating System :: OS Independent
13
11
  Classifier: Programming Language :: Python :: 3.10
14
12
  Classifier: Programming Language :: Python :: 3.11
15
13
  Classifier: Programming Language :: Python :: 3.12
16
- Classifier: Topic :: Software Development :: Libraries
17
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
- Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
19
- Requires-Python: ~=3.10
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: 3.15
17
+ Requires-Python: >=3.10
20
18
  Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Requires-Dist: aiohttp
23
- Requires-Dist: requests
19
+ Requires-Dist: pillow
20
+ Requires-Dist: hachoir
24
21
  Requires-Dist: ffmpeg-python
25
22
 
26
23
  <p align="center">
@@ -1,11 +1,9 @@
1
- LICENSE
2
1
  README.md
3
- setup.py
2
+ pyproject.toml
4
3
  Clinton/__init__.py
5
4
  Clinton/functions/__init__.py
6
5
  Clinton/functions/collections.py
7
6
  Clinton/functions/function01.py
8
- Clinton/functions/function02.py
9
7
  Clinton/scripts/__init__.py
10
8
  Clinton/scripts/script01.py
11
9
  Clinton/scripts/script02.py
@@ -0,0 +1,3 @@
1
+ pillow
2
+ hachoir
3
+ ffmpeg-python
@@ -0,0 +1,32 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "clinton"
7
+ version = "0.0.6"
8
+ description = "Clinton"
9
+ requires-python = ">=3.10"
10
+ keywords = ["apps", "python", "extensions"]
11
+ dependencies = ["pillow", "hachoir", "ffmpeg-python"]
12
+ readme = { file = "README.md", content-type = "text/markdown" }
13
+ authors = [ { name = "Clinton Abraham", email = "clintonabrahamc@gmail.com" } ]
14
+
15
+ classifiers = [
16
+ "Natural Language :: English",
17
+ "Intended Audience :: Developers",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Programming Language :: Python :: 3.15"
25
+ ]
26
+
27
+ [project.urls]
28
+ Homepage = "https://telegram.me/Clinton_Abraham"
29
+
30
+ [tool.setuptools.packages.find]
31
+ include = ["Clinton*"]
32
+ where = ["."]
@@ -1,19 +0,0 @@
1
- builded = "20.08.2024"
2
- appname = "clinton"
3
- version = "0.0.4"
4
-
5
-
6
- install = ["aiohttp",
7
- "requests",
8
- "ffmpeg-python"]
9
-
10
- DATA01 = "clintonabrahamc@gmail.com"
11
- DATA02 = ['Natural Language :: English',
12
- 'Intended Audience :: Developers',
13
- 'Operating System :: OS Independent',
14
- 'Programming Language :: Python :: 3.10',
15
- 'Programming Language :: Python :: 3.11',
16
- 'Programming Language :: Python :: 3.12',
17
- 'Topic :: Software Development :: Libraries',
18
- 'Topic :: Software Development :: Libraries :: Python Modules',
19
- 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)']
@@ -1,2 +0,0 @@
1
- from .function01 import InterNet
2
- from .function02 import Media
@@ -1,24 +0,0 @@
1
- import json
2
- import socket
3
- import requests
4
- from ..scripts import Apis
5
- #================================================================
6
-
7
- class InterNet:
8
-
9
- def GetIP():
10
- moones = requests.get(Apis.DATA02)
11
- moonus = moones.json()
12
- return moonus['ip']
13
-
14
- def GetLIP():
15
- moones = socket.gethostname()
16
- moonus = socket.gethostbyname(moones)
17
- return moonus
18
-
19
- def tracker(IP):
20
- mainse = requests.get(Apis.DATA01.format(IP))
21
- moonus = json.loads(mainse.text)
22
- return moonus
23
-
24
- #================================================================
@@ -1,78 +0,0 @@
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,5 +0,0 @@
1
-
2
- class Script01(object):
3
-
4
- DATA01 = ""
5
- DATA11 = ".jpg"
clinton-0.0.4/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright © 2024 Clinton Abraham
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,3 +0,0 @@
1
- aiohttp
2
- requests
3
- ffmpeg-python
clinton-0.0.4/setup.py DELETED
@@ -1,21 +0,0 @@
1
- from setuptools import setup, find_packages
2
- from Clinton import appname, version, install, DATA01, DATA02
3
-
4
- with open("README.md", "r") as o:
5
- description = o.read()
6
-
7
- setup(
8
- name=appname,
9
- license='MIT',
10
- version=version,
11
- description='ㅤ',
12
- classifiers=DATA02,
13
- author_email=DATA01,
14
- author='Clinton-Abraham',
15
- python_requires='~=3.10',
16
- packages=find_packages(),
17
- install_requires=install,
18
- long_description=description,
19
- url='https://github.com/Clinton-Abraham',
20
- keywords=['apps', 'python', 'extensions'],
21
- long_description_content_type="text/markdown")
File without changes
File without changes