DDownloader 0.2.4__tar.gz → 0.2.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.
Files changed (21) hide show
  1. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader/main.py +6 -1
  2. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader/modules/banners.py +1 -1
  3. ddownloader-0.2.6/DDownloader/modules/helper.py +94 -0
  4. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader.egg-info/PKG-INFO +6 -1
  5. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader.egg-info/requires.txt +2 -0
  6. {ddownloader-0.2.4 → ddownloader-0.2.6}/PKG-INFO +6 -1
  7. {ddownloader-0.2.4 → ddownloader-0.2.6}/README.md +3 -0
  8. {ddownloader-0.2.4 → ddownloader-0.2.6}/pyproject.toml +4 -2
  9. ddownloader-0.2.4/DDownloader/modules/helper.py +0 -69
  10. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader/__init__.py +0 -0
  11. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader/modules/__init__.py +0 -0
  12. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader/modules/args_parser.py +0 -0
  13. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader/modules/dash_downloader.py +0 -0
  14. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader/modules/hls_downloader.py +0 -0
  15. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader/modules/streamlink.py +0 -0
  16. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader.egg-info/SOURCES.txt +0 -0
  17. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader.egg-info/dependency_links.txt +0 -0
  18. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader.egg-info/entry_points.txt +0 -0
  19. {ddownloader-0.2.4 → ddownloader-0.2.6}/DDownloader.egg-info/top_level.txt +0 -0
  20. {ddownloader-0.2.4 → ddownloader-0.2.6}/LICENSE +0 -0
  21. {ddownloader-0.2.4 → ddownloader-0.2.6}/setup.cfg +0 -0
@@ -12,7 +12,7 @@ from DDownloader.modules.dash_downloader import DASH
12
12
  from DDownloader.modules.hls_downloader import HLS
13
13
 
14
14
  # Setup logger
15
- logger = logging.getLogger("+ MAIN + ")
15
+ logger = logging.getLogger("+ DDOWNLOADER + ")
16
16
  coloredlogs.install(level='DEBUG', logger=logger)
17
17
 
18
18
  def validate_directories():
@@ -38,12 +38,17 @@ def display_help():
38
38
  def main():
39
39
  clear_and_print()
40
40
  platform_name = detect_platform()
41
+ if platform_name == 'Unknown':
42
+ logger.error(f"Unsupported platform: {platform_name}")
43
+ exit(1)
44
+
41
45
  logger.info(f"Running on platform: {platform_name}")
42
46
  time.sleep(1)
43
47
 
44
48
  logger.info(f"Downloading binaries... Please wait!\n")
45
49
  bin_dir = Path(__file__).resolve().parent / "bin"
46
50
  download_binaries(bin_dir)
51
+
47
52
  time.sleep(1)
48
53
  logger.info(f"{Fore.GREEN}Downloading completed! Bye!{Fore.RESET}")
49
54
  clear_and_print()
@@ -19,7 +19,7 @@ def banners():
19
19
  stdout.write(""+Fore.YELLOW +"╔════════════════════════════════════════════════════════════════════════════╝\n")
20
20
  stdout.write(""+Fore.YELLOW +"║ \x1b[38;2;255;20;147m• "+Fore.GREEN+"GITHUB "+Fore.RED+" |"+Fore.LIGHTWHITE_EX+" GITHUB.COM/THATNOTEASY "+Fore.YELLOW+"║\n")
21
21
  stdout.write(""+Fore.YELLOW +"╚════════════════════════════════════════════════════════════════════════════╝\n")
22
- print(f"{Fore.YELLOW}[DDownloader] - {Fore.GREEN}Download DASH or HLS streams with decryption keys. - {Fore.RED}[V0.2.4] \n{Fore.RESET}")
22
+ print(f"{Fore.YELLOW}[DDownloader] - {Fore.GREEN}Download DASH or HLS streams with decryption keys. - {Fore.RED}[V0.2.6] \n{Fore.RESET}")
23
23
 
24
24
  def clear_and_print():
25
25
  time.sleep(1)
@@ -0,0 +1,94 @@
1
+ import os
2
+ import requests
3
+ from tqdm import tqdm
4
+ from colorama import Fore, Style, init
5
+ import logging
6
+ import coloredlogs
7
+ import platform
8
+
9
+ # Initialize Colorama for Windows compatibility
10
+ init(autoreset=True)
11
+
12
+ # Logger setup
13
+ logger = logging.getLogger(Fore.GREEN + "+ HELPER + ")
14
+ coloredlogs.install(level='DEBUG', logger=logger)
15
+
16
+ # Binaries with platform-specific handling
17
+ binaries = {
18
+ "Windows": [
19
+ "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/N_m3u8DL-RE.exe",
20
+ "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/ffmpeg.exe",
21
+ "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/aria2c.exe",
22
+ "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/mp4decrypt.exe",
23
+ "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/shaka-packager.exe",
24
+ "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/yt-dlp.exe",
25
+ "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/mkvmerge.exe"
26
+ ],
27
+ "Linux": [
28
+ "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/N_m3u8DL-RE"
29
+ ]
30
+ }
31
+
32
+ def download_binaries(bin_dir, platform_name):
33
+ """
34
+ Downloads platform-specific binaries to the specified directory.
35
+ """
36
+ os.makedirs(bin_dir, exist_ok=True)
37
+ logger.info(f"Platform detected: {platform_name}")
38
+ logger.info(f"Using binary directory: {bin_dir}")
39
+
40
+ platform_binaries = binaries.get(platform_name, [])
41
+
42
+ if not platform_binaries:
43
+ logger.error(f"No binaries available for platform: {platform_name}")
44
+ return
45
+
46
+ for binary_url in platform_binaries:
47
+ try:
48
+ filename = binary_url.split("/")[-1]
49
+ filepath = os.path.join(bin_dir, filename)
50
+
51
+ if os.path.exists(filepath):
52
+ logger.info(f"{Style.BRIGHT}{Fore.YELLOW}Skipping {filename} (already exists).")
53
+ continue
54
+
55
+ logger.info(f"{Fore.GREEN}Downloading {Fore.WHITE}{filename}...{Fore.RESET}")
56
+ response = requests.get(binary_url, stream=True, timeout=30)
57
+ response.raise_for_status()
58
+
59
+ # Total size for progress bar
60
+ total_size = int(response.headers.get('content-length', 0))
61
+ with open(filepath, "wb") as file, tqdm(
62
+ total=total_size,
63
+ unit='B',
64
+ unit_scale=True,
65
+ desc=f"{Fore.CYAN}{filename}{Fore.RESET}",
66
+ dynamic_ncols=True,
67
+ bar_format="{l_bar}{bar} | {n_fmt}/{total_fmt} [{rate_fmt}]"
68
+ ) as progress_bar:
69
+ for chunk in response.iter_content(chunk_size=8192):
70
+ file.write(chunk)
71
+ progress_bar.update(len(chunk))
72
+
73
+ # logger.info(f"{Fore.GREEN}Downloaded and saved: {filepath}{Fore.RESET}")
74
+ # Make binary executable on Linux
75
+ if platform_name == "Linux":
76
+ os.chmod(filepath, 0o755)
77
+ except requests.exceptions.RequestException as e:
78
+ logger.error(f"{Fore.RED}Failed to download {binary_url}: {e}{Fore.RESET}")
79
+ except Exception as e:
80
+ logger.error(f"{Fore.RED}Unexpected error for {binary_url}: {e}{Fore.RESET}")
81
+
82
+ def detect_platform():
83
+ """
84
+ Detects the current operating system platform.
85
+ """
86
+ system_platform = platform.system().lower()
87
+ if system_platform == 'windows':
88
+ return 'Windows'
89
+ elif system_platform == 'linux':
90
+ return 'Linux'
91
+ elif system_platform == 'darwin':
92
+ return 'MacOS'
93
+ else:
94
+ return 'Unknown'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DDownloader
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: A downloader for DRM-protected content.
5
5
  Author-email: ThatNotEasy <apidotmy@proton.me>
6
6
  License: MIT License
@@ -34,6 +34,8 @@ Description-Content-Type: text/markdown
34
34
  License-File: LICENSE
35
35
  Requires-Dist: requests>=2.26.0
36
36
  Requires-Dist: coloredlogs>=15.0
37
+ Requires-Dist: tqdm>=4.64.0
38
+ Requires-Dist: colorama>=0.4.5
37
39
  Requires-Dist: loguru>=0.6.0
38
40
 
39
41
  # DDownloader
@@ -44,6 +46,9 @@ Requires-Dist: loguru>=0.6.0
44
46
  - Download DASH manifests and segments.
45
47
  - Decrypt media files using mp4decrypt.
46
48
 
49
+ # Footprints Notes:
50
+ - It is better if you have set your own environment variables.
51
+
47
52
  # Installation
48
53
  Use the package manager pip to install DDownloader.
49
54
  ```pip install DDownloader```
@@ -1,3 +1,5 @@
1
1
  requests>=2.26.0
2
2
  coloredlogs>=15.0
3
+ tqdm>=4.64.0
4
+ colorama>=0.4.5
3
5
  loguru>=0.6.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DDownloader
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: A downloader for DRM-protected content.
5
5
  Author-email: ThatNotEasy <apidotmy@proton.me>
6
6
  License: MIT License
@@ -34,6 +34,8 @@ Description-Content-Type: text/markdown
34
34
  License-File: LICENSE
35
35
  Requires-Dist: requests>=2.26.0
36
36
  Requires-Dist: coloredlogs>=15.0
37
+ Requires-Dist: tqdm>=4.64.0
38
+ Requires-Dist: colorama>=0.4.5
37
39
  Requires-Dist: loguru>=0.6.0
38
40
 
39
41
  # DDownloader
@@ -44,6 +46,9 @@ Requires-Dist: loguru>=0.6.0
44
46
  - Download DASH manifests and segments.
45
47
  - Decrypt media files using mp4decrypt.
46
48
 
49
+ # Footprints Notes:
50
+ - It is better if you have set your own environment variables.
51
+
47
52
  # Installation
48
53
  Use the package manager pip to install DDownloader.
49
54
  ```pip install DDownloader```
@@ -6,6 +6,9 @@
6
6
  - Download DASH manifests and segments.
7
7
  - Decrypt media files using mp4decrypt.
8
8
 
9
+ # Footprints Notes:
10
+ - It is better if you have set your own environment variables.
11
+
9
12
  # Installation
10
13
  Use the package manager pip to install DDownloader.
11
14
  ```pip install DDownloader```
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "DDownloader"
7
- version = "0.2.4"
7
+ version = "0.2.6"
8
8
  description = "A downloader for DRM-protected content."
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  authors = [
@@ -21,6 +21,8 @@ classifiers = [
21
21
  dependencies = [
22
22
  "requests>=2.26.0",
23
23
  "coloredlogs>=15.0",
24
+ "tqdm>=4.64.0",
25
+ "colorama>=0.4.5",
24
26
  "loguru>=0.6.0"
25
27
  ]
26
28
 
@@ -31,4 +33,4 @@ homepage = "https://github.com/ThatNotEasy/DDownloader"
31
33
  include = ["DDownloader", "DDownloader.*"]
32
34
 
33
35
  [project.scripts]
34
- DDownloader = "DDownloader.main:main"
36
+ DDownloader = "DDownloader.main:main"
@@ -1,69 +0,0 @@
1
- import os
2
- import requests
3
- from tqdm import tqdm
4
- from colorama import Fore
5
- import logging
6
- import coloredlogs
7
- import platform
8
-
9
- logger = logging.getLogger(Fore.GREEN + "+ HELPER + ")
10
- coloredlogs.install(level='DEBUG', logger=logger)
11
-
12
- binaries = [
13
- "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/N_m3u8DL-RE",
14
- "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/N_m3u8DL-RE.exe",
15
- "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/ffmpeg.exe",
16
- "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/aria2c.exe",
17
- "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/mp4decrypt.exe",
18
- "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/shaka-packager.exe",
19
- "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/yt-dlp.exe",
20
- "https://github.com/ThatNotEasy/DDownloader/raw/refs/heads/main/DDownloader/bin/mkvmerge.exe"
21
- ]
22
-
23
- def download_binaries(bin_dir):
24
- os.makedirs(bin_dir, exist_ok=True)
25
- # logger.info(f"Created or confirmed directory: {bin_dir}")
26
-
27
- for binary_url in binaries:
28
- try:
29
- filename = binary_url.split("/")[-1]
30
- filepath = os.path.join(bin_dir, filename)
31
-
32
- if os.path.exists(filepath):
33
- logger.info(f"Skipping {filename} (already exists).")
34
- continue
35
-
36
- logger.info(f"{Fore.GREEN}Downloading {Fore.WHITE}{filename}...{Fore.RESET}")
37
- response = requests.get(binary_url, stream=True, timeout=30)
38
- response.raise_for_status()
39
-
40
- # Total size for progress bar
41
- total_size = int(response.headers.get('content-length', 0))
42
- with open(filepath, "wb") as file, tqdm(
43
- total=total_size,
44
- unit='B',
45
- unit_scale=True,
46
- desc=f"{Fore.CYAN}{filename}{Fore.RESET}",
47
- dynamic_ncols=True,
48
- bar_format="{l_bar}{bar} | {n_fmt}/{total_fmt} [{rate_fmt}]"
49
- ) as progress_bar:
50
- for chunk in response.iter_content(chunk_size=8192):
51
- file.write(chunk)
52
- progress_bar.update(len(chunk))
53
-
54
- # logger.info(f"{Fore.GREEN}Downloaded and saved: {filepath}{Fore.RESET}")
55
- except requests.exceptions.RequestException as e:
56
- logger.error(f"{Fore.RED}Failed to download {binary_url}: {e}{Fore.RESET}")
57
- except Exception as e:
58
- logger.error(f"{Fore.RED}Unexpected error for {binary_url}: {e}{Fore.RESET}")
59
-
60
- def detect_platform():
61
- system_platform = platform.system().lower()
62
- if system_platform == 'windows':
63
- return 'Windows'
64
- elif system_platform == 'linux':
65
- return 'Linux'
66
- elif system_platform == 'darwin':
67
- return 'MacOS'
68
- else:
69
- return 'Unknown'
File without changes
File without changes