DDownloader 0.2.9__tar.gz → 0.3.1__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.9 → ddownloader-0.3.1}/DDownloader/main.py +18 -17
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader/modules/args_parser.py +2 -1
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader/modules/banners.py +1 -1
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader/modules/dash_downloader.py +12 -6
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader/modules/hls_downloader.py +12 -6
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader.egg-info/PKG-INFO +1 -1
- {ddownloader-0.2.9 → ddownloader-0.3.1}/PKG-INFO +1 -1
- {ddownloader-0.2.9 → ddownloader-0.3.1}/pyproject.toml +1 -1
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader/__init__.py +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader/modules/__init__.py +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader/modules/helper.py +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader/modules/streamlink.py +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader.egg-info/SOURCES.txt +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader.egg-info/dependency_links.txt +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader.egg-info/entry_points.txt +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader.egg-info/requires.txt +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/DDownloader.egg-info/top_level.txt +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/LICENSE +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/README.md +0 -0
- {ddownloader-0.2.9 → ddownloader-0.3.1}/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("+ MAIN + ")
|
16
16
|
coloredlogs.install(level='DEBUG', logger=logger)
|
17
17
|
|
18
18
|
def validate_directories():
|
@@ -24,33 +24,26 @@ def validate_directories():
|
|
24
24
|
def display_help():
|
25
25
|
"""Display custom help message with emoji."""
|
26
26
|
print(
|
27
|
-
f"{Fore.WHITE}+" + "=" *
|
27
|
+
f"{Fore.WHITE}+" + "=" * 100 + f"+{Style.RESET_ALL}\n"
|
28
28
|
f"{Fore.CYAN}{'Option':<40}{'Description':<90}{Style.RESET_ALL}\n"
|
29
|
-
f"{Fore.WHITE}+" + "=" *
|
29
|
+
f"{Fore.WHITE}+" + "=" * 100 + f"+{Style.RESET_ALL}\n"
|
30
30
|
f" {Fore.GREEN}-u, --url{' ' * 22}{Style.RESET_ALL}URL of the manifest (mpd/m3u8) 🌐\n"
|
31
31
|
f" {Fore.GREEN}-p, --proxy{' ' * 20}{Style.RESET_ALL}A proxy with protocol (http://ip:port) 🌍\n"
|
32
32
|
f" {Fore.GREEN}-o, --output{' ' * 19}{Style.RESET_ALL}Name of the output file 💾\n"
|
33
33
|
f" {Fore.GREEN}-k, --key{' ' * 22}{Style.RESET_ALL}Decryption key in KID:KEY format 🔑\n"
|
34
|
+
f" {Fore.GREEN}-H, --header{' ' * 19}{Style.RESET_ALL}Custom HTTP headers (e.g., User-Agent: value) 📋\n"
|
34
35
|
f" {Fore.GREEN}-h, --help{' ' * 21}{Style.RESET_ALL}Show this help message and exit ❓\n"
|
35
|
-
f"{Fore.WHITE}+" + "=" *
|
36
|
+
f"{Fore.WHITE}+" + "=" * 100 + f"+{Style.RESET_ALL}\n"
|
36
37
|
)
|
37
38
|
|
38
39
|
def main():
|
39
40
|
clear_and_print()
|
40
41
|
platform_name = detect_platform()
|
41
|
-
|
42
|
-
|
43
|
-
exit(1)
|
44
|
-
|
45
|
-
logger.info(f"Running on platform: {platform_name}")
|
42
|
+
logger.info(f"Downloading binaries... Please wait!")
|
43
|
+
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
46
44
|
time.sleep(1)
|
47
|
-
|
48
|
-
logger.info(f"Downloading binaries... Please wait!\n")
|
49
45
|
bin_dir = Path(__file__).resolve().parent / "bin"
|
50
46
|
download_binaries(bin_dir, platform_name)
|
51
|
-
|
52
|
-
time.sleep(1)
|
53
|
-
logger.info(f"{Fore.GREEN}Downloading completed! Bye!{Fore.RESET}")
|
54
47
|
clear_and_print()
|
55
48
|
|
56
49
|
validate_directories()
|
@@ -60,7 +53,6 @@ def main():
|
|
60
53
|
display_help()
|
61
54
|
exit(1)
|
62
55
|
|
63
|
-
# Detect and initialize appropriate downloader
|
64
56
|
downloader = None
|
65
57
|
if re.search(r"\.mpd\b", args.url, re.IGNORECASE):
|
66
58
|
logger.info("DASH stream detected. Initializing DASH downloader...")
|
@@ -76,14 +68,23 @@ def main():
|
|
76
68
|
downloader.manifest_url = args.url
|
77
69
|
downloader.output_name = args.output
|
78
70
|
downloader.decryption_keys = args.key or []
|
71
|
+
downloader.headers = args.header or []
|
79
72
|
downloader.proxy = args.proxy # Add proxy if provided
|
73
|
+
|
74
|
+
# Log provided headers
|
75
|
+
if downloader.headers:
|
76
|
+
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
77
|
+
logger.info("Headers provided:")
|
78
|
+
for header in downloader.headers:
|
79
|
+
logger.info(f" -H {header}")
|
80
|
+
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
80
81
|
|
81
82
|
# Log provided decryption keys
|
82
83
|
if downloader.decryption_keys:
|
83
84
|
logger.info("Decryption keys provided:")
|
84
85
|
for key in downloader.decryption_keys:
|
85
86
|
logger.info(f" --key {key}")
|
86
|
-
print(Fore.MAGENTA + "=" *
|
87
|
+
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
87
88
|
|
88
89
|
# Execute downloader
|
89
90
|
try:
|
@@ -96,4 +97,4 @@ def main():
|
|
96
97
|
exit(1)
|
97
98
|
|
98
99
|
if __name__ == "__main__":
|
99
|
-
main()
|
100
|
+
main()
|
@@ -14,6 +14,7 @@ def parse_arguments():
|
|
14
14
|
parser.add_argument("-p", "--proxy", help=argparse.SUPPRESS)
|
15
15
|
parser.add_argument("-o", "--output", required=True, help=argparse.SUPPRESS)
|
16
16
|
parser.add_argument("-k", "--key", action="append", help=argparse.SUPPRESS)
|
17
|
+
parser.add_argument("-H", "--header", action="append", help=argparse.SUPPRESS)
|
17
18
|
parser.add_argument(
|
18
19
|
"-h", "--help",
|
19
20
|
action="help",
|
@@ -21,4 +22,4 @@ def parse_arguments():
|
|
21
22
|
help=argparse.SUPPRESS
|
22
23
|
)
|
23
24
|
|
24
|
-
return parser.parse_args()
|
25
|
+
return parser.parse_args()
|
@@ -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.
|
22
|
+
print(f"{Fore.YELLOW}[DDownloader] - {Fore.GREEN}Download DASH or HLS streams with decryption keys. - {Fore.RED}[V0.3.1] \n{Fore.RESET}")
|
23
23
|
|
24
24
|
def clear_and_print():
|
25
25
|
time.sleep(1)
|
@@ -14,6 +14,7 @@ class DASH:
|
|
14
14
|
self.output_name = None
|
15
15
|
self.proxy = None
|
16
16
|
self.decryption_keys = []
|
17
|
+
self.headers = []
|
17
18
|
self.binary_path = self._get_binary_path()
|
18
19
|
|
19
20
|
def _get_binary_path(self):
|
@@ -55,25 +56,30 @@ class DASH:
|
|
55
56
|
|
56
57
|
def _build_command(self):
|
57
58
|
command = [
|
58
|
-
|
59
|
+
self.binary_path,
|
59
60
|
f'"{self.manifest_url}"',
|
60
61
|
'--select-video', 'BEST',
|
61
62
|
'--select-audio', 'BEST',
|
62
63
|
'-mt',
|
63
64
|
'-M', 'format=mp4',
|
64
|
-
'--save-dir', 'downloads',
|
65
|
-
'--tmp-dir', 'downloads',
|
65
|
+
'--save-dir', '"downloads"',
|
66
|
+
'--tmp-dir', '"downloads"',
|
66
67
|
'--del-after-done',
|
67
|
-
'--save-name', self.output_name
|
68
|
+
'--save-name', f'"{self.output_name}"'
|
68
69
|
]
|
69
70
|
|
70
71
|
for key in self.decryption_keys:
|
71
|
-
command.extend(['--key', key])
|
72
|
+
command.extend(['--key', f'"{key}"'])
|
72
73
|
|
73
74
|
if self.proxy:
|
74
75
|
if not self.proxy.startswith("http://"):
|
75
76
|
self.proxy = f"http://{self.proxy}"
|
76
|
-
command.extend(['--custom-proxy', self.proxy])
|
77
|
+
command.extend(['--custom-proxy', f'"{self.proxy}"'])
|
78
|
+
|
79
|
+
# Add headers if any are provided
|
80
|
+
for header in self.headers:
|
81
|
+
command.extend(['-H', f'"{header}"'])
|
82
|
+
|
77
83
|
# logger.debug(f"Built command: {' '.join(command)}")
|
78
84
|
return command
|
79
85
|
|
@@ -14,6 +14,7 @@ class HLS:
|
|
14
14
|
self.output_name = None
|
15
15
|
self.proxy = None
|
16
16
|
self.decryption_keys = []
|
17
|
+
self.headers = []
|
17
18
|
self.binary_path = self._get_binary_path()
|
18
19
|
|
19
20
|
def _get_binary_path(self):
|
@@ -55,25 +56,30 @@ class HLS:
|
|
55
56
|
|
56
57
|
def _build_command(self):
|
57
58
|
command = [
|
58
|
-
|
59
|
+
self.binary_path,
|
59
60
|
f'"{self.manifest_url}"',
|
60
61
|
'--select-video', 'BEST',
|
61
62
|
'--select-audio', 'BEST',
|
62
63
|
'-mt',
|
63
64
|
'-M', 'format=mp4',
|
64
|
-
'--save-dir', 'downloads',
|
65
|
-
'--tmp-dir', 'downloads',
|
65
|
+
'--save-dir', '"downloads"',
|
66
|
+
'--tmp-dir', '"downloads"',
|
66
67
|
'--del-after-done',
|
67
|
-
'--save-name', self.output_name
|
68
|
+
'--save-name', f'"{self.output_name}"'
|
68
69
|
]
|
69
70
|
|
70
71
|
for key in self.decryption_keys:
|
71
|
-
command.extend(['--key', key])
|
72
|
+
command.extend(['--key', f'"{key}"'])
|
72
73
|
|
73
74
|
if self.proxy:
|
74
75
|
if not self.proxy.startswith("http://"):
|
75
76
|
self.proxy = f"http://{self.proxy}"
|
76
|
-
command.extend(['--custom-proxy', self.proxy])
|
77
|
+
command.extend(['--custom-proxy', f'"{self.proxy}"'])
|
78
|
+
|
79
|
+
# Add headers if any are provided
|
80
|
+
for header in self.headers:
|
81
|
+
command.extend(['-H', f'"{header}"'])
|
82
|
+
|
77
83
|
# logger.debug(f"Built command: {' '.join(command)}")
|
78
84
|
return command
|
79
85
|
|
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
|