ffmpeg-for-python 0.3.8__tar.gz → 0.3.9__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.
Files changed (19) hide show
  1. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/PKG-INFO +4 -4
  2. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/README.md +2 -2
  3. ffmpeg_for_python-0.3.9/assets/ffmpeg-for-python-logo.png +0 -0
  4. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python/__config__.py +13 -19
  5. ffmpeg_for_python-0.3.9/ffmpeg_for_python/__utils.py +78 -0
  6. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python/__version__.py +1 -1
  7. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python.egg-info/PKG-INFO +4 -4
  8. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python.egg-info/SOURCES.txt +1 -0
  9. ffmpeg_for_python-0.3.8/ffmpeg_for_python/__utils.py +0 -91
  10. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/MANIFEST.in +0 -0
  11. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python/__init__.py +0 -0
  12. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python/exeptions.py +0 -0
  13. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python/ffmpeg-bin/readme.md +0 -0
  14. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python/ffmpeg.py +0 -0
  15. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python.egg-info/dependency_links.txt +0 -0
  16. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python.egg-info/not-zip-safe +0 -0
  17. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/ffmpeg_for_python.egg-info/top_level.txt +0 -0
  18. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/setup.cfg +0 -0
  19. {ffmpeg_for_python-0.3.8 → ffmpeg_for_python-0.3.9}/setup.py +0 -0
@@ -1,12 +1,12 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: ffmpeg-for-python
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: Wrapper para o binário FFmpeg
5
5
  Author: PauloCesar-dev404
6
6
  Author-email: paulocesar0073dev404@gmail.com
7
7
  License: MIT
8
- Project-URL: Código Fonte, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.8.tar.gz
9
- Project-URL: lib, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.8-py3-none-any.whl
8
+ Project-URL: Código Fonte, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.9.tar.gz
9
+ Project-URL: lib, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.9-py3-none-any.whl
10
10
  Project-URL: GitHub, https://github.com/PauloCesar-dev404/ffmpeg-for-python
11
11
  Project-URL: Bugs/Melhorias, https://github.com/PauloCesar-dev404/ffmpeg-for-python/issues
12
12
  Project-URL: Documentação, https://github.com/PauloCesar-dev404/ffmpeg-for-python/wiki
@@ -4,9 +4,9 @@
4
4
 
5
5
 
6
6
 
7
- ![Versão](https://img.shields.io/badge/version-0.3.8-orange)
7
+ ![Versão](https://img.shields.io/badge/version-0.3.5-orange)
8
8
  ![Licença](https://img.shields.io/badge/license-MIT-orange)
9
- [![Sponsor](https://img.shields.io/badge/💲Donate-yellow)](https://paulocesar-dev404.github.io/me-apoiando-online/)
9
+ [![Sponsor](https://img.shields.io/badge/💲Donate-yellow)](https://apoia.se/paulocesar-dev404)
10
10
 
11
11
  </div>
12
12
 
@@ -1,3 +1,4 @@
1
+ import site
1
2
  import struct
2
3
  import sys
3
4
  import os
@@ -9,9 +10,7 @@ from .exeptions import *
9
10
  from .__utils import URL_PLATAFOMR,system
10
11
 
11
12
  lib_name = 'ffmpeg_for_python'
12
- URL_BASE_REPO = "https://raw.githubusercontent.com/PauloCesar-dev404/binarios/main/"
13
-
14
-
13
+ URL_BASE_REPO = 'https://github.com/PauloCesar-dev404/binarios/raw/refs/heads/main/'
15
14
 
16
15
 
17
16
  class Configurate:
@@ -30,21 +29,17 @@ class Configurate:
30
29
 
31
30
  @property
32
31
  def is_venv(self):
33
- """Verifica se o script está sendo executado em um ambiente virtual e retorna o diretório de bibliotecas globais.
34
- Se estiver em um ambiente virtual, retorna o diretório de bibliotecas do ambiente virtual. Caso contrário, retorna
35
- o diretório de bibliotecas globais do Python global."""
36
- if hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix):
37
- # Retorna o diretório de bibliotecas do ambiente virtual
38
- return os.path.join(os.path.dirname(os.path.abspath(sys.executable)), 'Lib',
39
- 'site-packages') if os.name == 'nt' else os.path.join \
40
- (os.path.dirname(os.path.abspath(sys.executable)), 'lib',
41
- 'python{0.major}.{0.minor}'.format(sys.version_info), 'site-packages')
42
- else:
43
- # Retorna o diretório de bibliotecas globais do Python global
44
- return os.path.join(os.path.dirname(os.path.abspath(sys.executable)), 'Lib',
45
- 'site-packages') if os.name == 'nt' else os.path.join \
46
- (os.path.dirname(os.path.abspath(sys.executable)), 'lib',
47
- 'python{0.major}.{0.minor}'.format(sys.version_info), 'site-packages')
32
+ """
33
+ Retorna o diretório 'site-packages' ativo (seja venv ou global).
34
+ """
35
+ try:
36
+ # getsitepackages retorna uma lista, pegamos o primeiro ou o apropriado
37
+ packages = site.getsitepackages()
38
+ return packages[0] # Geralmente o primeiro é o que queremos
39
+ except AttributeError:
40
+ # Fallback para ambientes virtuais muito antigos ou distros específicas
41
+ import distutils.sysconfig
42
+ return sys.modules[distutils.sysconfig.get_python_lib()]
48
43
 
49
44
  def configure(self):
50
45
  """Configura as variáveis de ambiente com base no sistema operacional."""
@@ -100,7 +95,6 @@ class Configurate:
100
95
  f"\rBaixando Binários do ffmpeg: {percent_done:.2f}% | Velocidade: {speed_kbps:.2f} KB/s | "
101
96
  f"Tempo decorrido: {int(elapsed_time)}s")
102
97
  sys.stdout.flush()
103
- sys.stdout.write("\nDownload completo.\n")
104
98
  sys.stdout.flush()
105
99
 
106
100
  except requests.RequestException as e:
@@ -0,0 +1,78 @@
1
+ import platform
2
+ import os
3
+
4
+ URL_PLATAFOMR = ''
5
+
6
+
7
+ def get_processor_info():
8
+ system = platform.system()
9
+ architecture = platform.architecture()[0]
10
+ processor = ''
11
+ if system == "Windows":
12
+ processor = platform.processor()
13
+ elif system in ["Linux", "Darwin"]: # Darwin é o nome do sistema para macOS
14
+ try:
15
+ if system == "Linux":
16
+ # Obtém informações detalhadas do processador no Linux
17
+ with open("/proc/cpuinfo") as f:
18
+ cpuinfo = f.read()
19
+ if "model name" in cpuinfo:
20
+ processor = cpuinfo.split("model name")[1].split(":")[1].split("\n")[0].strip()
21
+ else:
22
+ processor = "Unknown"
23
+ elif system == "Darwin":
24
+ # Obtém informações detalhadas do processador no macOS
25
+ processor = os.popen("sysctl -n machdep.cpu.brand_string").read().strip()
26
+ except FileNotFoundError:
27
+ processor = "Unknown"
28
+ d = (f"System: {system} "
29
+ f"Architecture: {architecture} "
30
+ f"Processor: {processor} ")
31
+ return d
32
+
33
+
34
+ # Processa a informação do processador e limpa a string
35
+ data = (get_processor_info().replace('Architecture:', '').replace('System:', '').
36
+ replace('Processor:', '').strip().split())
37
+
38
+ # Remove entradas vazias e limpa espaços em branco
39
+ cleaned_data = [item.strip() for item in data if item.strip()]
40
+
41
+ # Garantindo que há pelo menos três elementos
42
+ if len(cleaned_data) >= 2:
43
+ system = cleaned_data[0]
44
+ architecture = cleaned_data[1]
45
+ processor = ' '.join(cleaned_data[2:]) # Junta o restante como o processador
46
+
47
+ URL_BASE_REPO = "https://raw.githubusercontent.com/PauloCesar-dev404/binarios/main/"
48
+ # Mapeamento para Linux
49
+ linux_mapping = {
50
+ "x86_64": "amd64",
51
+ "i686": "i686",
52
+ "arm64": "arm64",
53
+ "armhf": "armhf",
54
+ "armel": "armel"
55
+ }
56
+ # Formata a URL com base no sistema e arquitetura
57
+ if system == "Linux" and ('intel' in processor.lower() or 'amd' in processor.lower()):
58
+ url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('x86_64')}.zip"
59
+ elif system == "Linux" and 'i686' in architecture.lower():
60
+ url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('i686')}.zip"
61
+ elif system == "Linux" and 'arm64' in architecture.lower():
62
+ url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('arm64')}.zip"
63
+ elif system == "Linux" and 'armhf' in architecture.lower():
64
+ url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('armhf')}.zip"
65
+ elif system == "Linux" and 'armel' in architecture.lower():
66
+ url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('armel')}.zip"
67
+ elif system == "Windows" and architecture == '64bit':
68
+ url = f"{URL_BASE_REPO}windows/win-ffmpeg-7.0.2-full-amd64-intel64.zip"
69
+ else:
70
+ url = f"Unsupported system or architecture"
71
+
72
+ URL_PLATAFOMR = url
73
+
74
+ else:
75
+ raise DeprecationWarning("Não foi possível obter seu sistema ....consulte o desenvolvedor!")
76
+
77
+ if __name__ == '__main__':
78
+ raise RuntimeError("este é uma função interna!")
@@ -1,4 +1,4 @@
1
- __version__ = '0.3.8'
1
+ __version__ = '0.3.9'
2
2
  __lib_name__ = 'ffmpeg_for_python'
3
3
  __autor__ = 'PauloCesar-dev404'
4
4
  __repo__ = 'https://github.com/PauloCesar-dev404/ffmpeg-for-python'
@@ -1,12 +1,12 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: ffmpeg-for-python
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Summary: Wrapper para o binário FFmpeg
5
5
  Author: PauloCesar-dev404
6
6
  Author-email: paulocesar0073dev404@gmail.com
7
7
  License: MIT
8
- Project-URL: Código Fonte, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.8.tar.gz
9
- Project-URL: lib, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.8-py3-none-any.whl
8
+ Project-URL: Código Fonte, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.9.tar.gz
9
+ Project-URL: lib, https://raw.githubusercontent.com/PauloCesar-dev404/ffmpeg-for-python/main/ffmpeg_for_python-0.3.9-py3-none-any.whl
10
10
  Project-URL: GitHub, https://github.com/PauloCesar-dev404/ffmpeg-for-python
11
11
  Project-URL: Bugs/Melhorias, https://github.com/PauloCesar-dev404/ffmpeg-for-python/issues
12
12
  Project-URL: Documentação, https://github.com/PauloCesar-dev404/ffmpeg-for-python/wiki
@@ -1,6 +1,7 @@
1
1
  MANIFEST.in
2
2
  README.md
3
3
  setup.py
4
+ assets/ffmpeg-for-python-logo.png
4
5
  ffmpeg_for_python/__config__.py
5
6
  ffmpeg_for_python/__init__.py
6
7
  ffmpeg_for_python/__utils.py
@@ -1,91 +0,0 @@
1
- import platform
2
- import os
3
-
4
- URL_PLATAFOMR = ''
5
-
6
-
7
- def get_processor_info():
8
- system = platform.system()
9
- architecture = platform.architecture()[0]
10
- processor = ''
11
- if system == "Windows":
12
- processor = platform.processor()
13
- elif system in ["Linux", "Darwin"]: # Darwin é o nome do sistema para macOS
14
- try:
15
- if system == "Linux":
16
- # Verifica se estamos no Termux
17
- if os.path.exists("/data/data/com.termux/files/usr/bin"):
18
- processor = "Termux"
19
- else:
20
- # Obtém informações detalhadas do processador no Linux
21
- with open("/proc/cpuinfo") as f:
22
- cpuinfo = f.read()
23
- if "model name" in cpuinfo:
24
- processor = cpuinfo.split("model name")[1].split(":")[1].split("\n")[0].strip()
25
- else:
26
- processor = "Unknown"
27
- elif system == "Darwin":
28
- # Obtém informações detalhadas do processador no macOS
29
- processor = os.popen("sysctl -n machdep.cpu.brand_string").read().strip()
30
- except FileNotFoundError:
31
- processor = "Unknown"
32
- d = (f"System: {system} "
33
- f"Architecture: {architecture} "
34
- f"Processor: {processor} ")
35
- return d
36
-
37
-
38
- # Processa a informação do processador e limpa a string
39
- data = (
40
- get_processor_info().replace('Architecture:', '').replace('System:', '').replace('Processor:', '').strip().split())
41
-
42
- # Remove entradas vazias e limpa espaços em branco
43
- cleaned_data = [item.strip() for item in data if item.strip()]
44
-
45
- # Garantindo que há pelo menos três elementos
46
- if len(cleaned_data) >= 2:
47
- system = cleaned_data[0]
48
- architecture = cleaned_data[1]
49
- processor = ' '.join(cleaned_data[2:]) # Junta o restante como o processador
50
-
51
- URL_BASE_REPO = "https://raw.githubusercontent.com/PauloCesar-dev404/binarios/main/"
52
-
53
- # Mapeamento para Linux
54
- linux_mapping = {
55
- "x86_64": "amd64",
56
- "i686": "i686",
57
- "arm64": "arm64",
58
- "armhf": "armhf",
59
- "armel": "armel",
60
- "aarch64": "arm64" # Termux aarch64
61
- }
62
-
63
- # Formata a URL com base no sistema e arquitetura
64
- if system == "Linux":
65
- if 'termux' in processor.lower():
66
- # Suporte para TermuX
67
- url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-termux-arm64.zip"
68
- elif 'intel' in processor.lower() or 'amd' in processor.lower():
69
- url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('x86_64')}.zip"
70
- elif 'i686' in architecture.lower():
71
- url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('i686')}.zip"
72
- elif 'arm64' in architecture.lower():
73
- url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('arm64')}.zip"
74
- elif 'armhf' in architecture.lower():
75
- url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('armhf')}.zip"
76
- elif 'armel' in architecture.lower():
77
- url = f"{URL_BASE_REPO}linux/ffmpeg-7.0.2-{linux_mapping.get('armel')}.zip"
78
- else:
79
- url = f"Unsupported Linux architecture"
80
- elif system == "Windows" and architecture == '64bit':
81
- url = f"{URL_BASE_REPO}windows/win-ffmpeg-7.0.2-full-amd64-intel64.zip"
82
- else:
83
- url = f"Unsupported system or architecture"
84
-
85
- URL_PLATAFOMR = url
86
-
87
- else:
88
- raise DeprecationWarning("Não foi possível obter seu sistema ....consulte o desenvolvedor!")
89
-
90
- if __name__ == '__main__':
91
- raise RuntimeError("Este é uma função interna!")