DDownloader 0.2.4__tar.gz → 0.2.5__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.
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader/main.py +6 -1
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader/modules/banners.py +1 -1
- ddownloader-0.2.5/DDownloader/modules/helper.py +94 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader.egg-info/PKG-INFO +4 -1
- {ddownloader-0.2.4 → ddownloader-0.2.5}/PKG-INFO +4 -1
- {ddownloader-0.2.4 → ddownloader-0.2.5}/README.md +3 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/pyproject.toml +1 -1
- ddownloader-0.2.4/DDownloader/modules/helper.py +0 -69
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader/__init__.py +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader/modules/__init__.py +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader/modules/args_parser.py +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader/modules/dash_downloader.py +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader/modules/hls_downloader.py +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader/modules/streamlink.py +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader.egg-info/SOURCES.txt +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader.egg-info/dependency_links.txt +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader.egg-info/entry_points.txt +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader.egg-info/requires.txt +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/DDownloader.egg-info/top_level.txt +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/LICENSE +0 -0
- {ddownloader-0.2.4 → ddownloader-0.2.5}/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("+
|
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.
|
22
|
+
print(f"{Fore.YELLOW}[DDownloader] - {Fore.GREEN}Download DASH or HLS streams with decryption keys. - {Fore.RED}[V0.2.5] \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.
|
3
|
+
Version: 0.2.5
|
4
4
|
Summary: A downloader for DRM-protected content.
|
5
5
|
Author-email: ThatNotEasy <apidotmy@proton.me>
|
6
6
|
License: MIT License
|
@@ -44,6 +44,9 @@ Requires-Dist: loguru>=0.6.0
|
|
44
44
|
- Download DASH manifests and segments.
|
45
45
|
- Decrypt media files using mp4decrypt.
|
46
46
|
|
47
|
+
# Footprints Notes:
|
48
|
+
- It is better if you have set your own environment variables.
|
49
|
+
|
47
50
|
# Installation
|
48
51
|
Use the package manager pip to install DDownloader.
|
49
52
|
```pip install DDownloader```
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: DDownloader
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.5
|
4
4
|
Summary: A downloader for DRM-protected content.
|
5
5
|
Author-email: ThatNotEasy <apidotmy@proton.me>
|
6
6
|
License: MIT License
|
@@ -44,6 +44,9 @@ Requires-Dist: loguru>=0.6.0
|
|
44
44
|
- Download DASH manifests and segments.
|
45
45
|
- Decrypt media files using mp4decrypt.
|
46
46
|
|
47
|
+
# Footprints Notes:
|
48
|
+
- It is better if you have set your own environment variables.
|
49
|
+
|
47
50
|
# Installation
|
48
51
|
Use the package manager pip to install DDownloader.
|
49
52
|
```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```
|
@@ -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
|
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
|
File without changes
|
File without changes
|