DDownloader 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl
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/main.py +17 -32
- DDownloader/modules/args_parser.py +10 -43
- DDownloader/modules/banners.py +1 -1
- {DDownloader-0.3.0.dist-info → DDownloader-0.3.1.dist-info}/METADATA +1 -1
- {DDownloader-0.3.0.dist-info → DDownloader-0.3.1.dist-info}/RECORD +9 -9
- {DDownloader-0.3.0.dist-info → DDownloader-0.3.1.dist-info}/LICENSE +0 -0
- {DDownloader-0.3.0.dist-info → DDownloader-0.3.1.dist-info}/WHEEL +0 -0
- {DDownloader-0.3.0.dist-info → DDownloader-0.3.1.dist-info}/entry_points.txt +0 -0
- {DDownloader-0.3.0.dist-info → DDownloader-0.3.1.dist-info}/top_level.txt +0 -0
DDownloader/main.py
CHANGED
@@ -12,18 +12,14 @@ 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():
|
19
|
-
"""Ensure necessary directories exist."""
|
20
19
|
downloads_dir = 'downloads'
|
21
|
-
|
22
|
-
os.makedirs(downloads_dir
|
23
|
-
# logger.debug(f"
|
24
|
-
except Exception as e:
|
25
|
-
logger.error(f"Failed to create or validate downloads directory: {e}")
|
26
|
-
exit(1)
|
20
|
+
if not os.path.exists(downloads_dir):
|
21
|
+
os.makedirs(downloads_dir)
|
22
|
+
# logger.debug(f"Created '{downloads_dir}' directory.")
|
27
23
|
|
28
24
|
def display_help():
|
29
25
|
"""Display custom help message with emoji."""
|
@@ -35,40 +31,28 @@ def display_help():
|
|
35
31
|
f" {Fore.GREEN}-p, --proxy{' ' * 20}{Style.RESET_ALL}A proxy with protocol (http://ip:port) 🌍\n"
|
36
32
|
f" {Fore.GREEN}-o, --output{' ' * 19}{Style.RESET_ALL}Name of the output file 💾\n"
|
37
33
|
f" {Fore.GREEN}-k, --key{' ' * 22}{Style.RESET_ALL}Decryption key in KID:KEY format 🔑\n"
|
38
|
-
f" {Fore.GREEN}-
|
39
|
-
f" {Fore.GREEN}
|
34
|
+
f" {Fore.GREEN}-H, --header{' ' * 19}{Style.RESET_ALL}Custom HTTP headers (e.g., User-Agent: value) 📋\n"
|
35
|
+
f" {Fore.GREEN}-h, --help{' ' * 21}{Style.RESET_ALL}Show this help message and exit ❓\n"
|
40
36
|
f"{Fore.WHITE}+" + "=" * 100 + f"+{Style.RESET_ALL}\n"
|
41
37
|
)
|
42
38
|
|
43
39
|
def main():
|
44
|
-
"""Main entry point for the downloader."""
|
45
40
|
clear_and_print()
|
46
41
|
platform_name = detect_platform()
|
47
|
-
|
48
|
-
|
49
|
-
exit(1)
|
50
|
-
|
51
|
-
logger.info(f"Running on platform: {platform_name}")
|
42
|
+
logger.info(f"Downloading binaries... Please wait!")
|
43
|
+
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
52
44
|
time.sleep(1)
|
53
|
-
|
54
|
-
logger.info(f"Downloading binaries... Please wait!\n")
|
55
45
|
bin_dir = Path(__file__).resolve().parent / "bin"
|
56
46
|
download_binaries(bin_dir, platform_name)
|
57
|
-
|
58
|
-
time.sleep(1)
|
59
|
-
logger.info(f"{Fore.GREEN}Downloading completed! Bye!{Fore.RESET}")
|
60
47
|
clear_and_print()
|
61
48
|
|
62
49
|
validate_directories()
|
63
|
-
|
64
|
-
# Parse arguments
|
65
50
|
try:
|
66
51
|
args = parse_arguments()
|
67
52
|
except SystemExit:
|
68
53
|
display_help()
|
69
54
|
exit(1)
|
70
55
|
|
71
|
-
# Detect and initialize appropriate downloader
|
72
56
|
downloader = None
|
73
57
|
if re.search(r"\.mpd\b", args.url, re.IGNORECASE):
|
74
58
|
logger.info("DASH stream detected. Initializing DASH downloader...")
|
@@ -84,14 +68,15 @@ def main():
|
|
84
68
|
downloader.manifest_url = args.url
|
85
69
|
downloader.output_name = args.output
|
86
70
|
downloader.decryption_keys = args.key or []
|
71
|
+
downloader.headers = args.header or []
|
87
72
|
downloader.proxy = args.proxy # Add proxy if provided
|
88
|
-
|
89
|
-
#
|
90
|
-
if
|
91
|
-
|
92
|
-
logger.info("
|
93
|
-
for header in
|
94
|
-
logger.info(f"
|
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}")
|
95
80
|
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
96
81
|
|
97
82
|
# Log provided decryption keys
|
@@ -112,4 +97,4 @@ def main():
|
|
112
97
|
exit(1)
|
113
98
|
|
114
99
|
if __name__ == "__main__":
|
115
|
-
main()
|
100
|
+
main()
|
@@ -3,56 +3,23 @@ from colorama import Fore, Style
|
|
3
3
|
|
4
4
|
def parse_arguments():
|
5
5
|
"""Parse and return command-line arguments."""
|
6
|
-
# Create the ArgumentParser with
|
6
|
+
# Create the ArgumentParser with no default help and no description
|
7
7
|
parser = argparse.ArgumentParser(
|
8
8
|
add_help=False, # Disable default help
|
9
|
-
usage=
|
10
|
-
script.py {Fore.YELLOW}-u{Style.RESET_ALL} <manifest_url> {Fore.YELLOW}-o{Style.RESET_ALL} <output_name> [{Fore.YELLOW}-p{Style.RESET_ALL} <proxy>] [{Fore.YELLOW}-k{Style.RESET_ALL} <key>] [{Fore.YELLOW}-h{Style.RESET_ALL} <header>]"""
|
9
|
+
usage="", # Suppress the default usage message
|
11
10
|
)
|
12
11
|
|
13
|
-
# Add arguments (
|
12
|
+
# Add arguments (these will not include the default descriptions)
|
13
|
+
parser.add_argument("-u", "--url", required=True, help=argparse.SUPPRESS)
|
14
|
+
parser.add_argument("-p", "--proxy", help=argparse.SUPPRESS)
|
15
|
+
parser.add_argument("-o", "--output", required=True, help=argparse.SUPPRESS)
|
16
|
+
parser.add_argument("-k", "--key", action="append", help=argparse.SUPPRESS)
|
17
|
+
parser.add_argument("-H", "--header", action="append", help=argparse.SUPPRESS)
|
14
18
|
parser.add_argument(
|
15
|
-
"-
|
16
|
-
required=True,
|
17
|
-
help=argparse.SUPPRESS
|
18
|
-
)
|
19
|
-
parser.add_argument(
|
20
|
-
"-p", "--proxy",
|
21
|
-
help=argparse.SUPPRESS
|
22
|
-
)
|
23
|
-
parser.add_argument(
|
24
|
-
"-o", "--output",
|
25
|
-
required=True,
|
26
|
-
help=argparse.SUPPRESS
|
27
|
-
)
|
28
|
-
parser.add_argument(
|
29
|
-
"-k", "--key",
|
30
|
-
action="append", # Allow multiple keys
|
31
|
-
help=argparse.SUPPRESS
|
32
|
-
)
|
33
|
-
parser.add_argument(
|
34
|
-
"-h", "--header",
|
35
|
-
action="append", # Allow multiple headers
|
36
|
-
help=argparse.SUPPRESS
|
37
|
-
)
|
38
|
-
parser.add_argument(
|
39
|
-
"-?", "--help",
|
19
|
+
"-h", "--help",
|
40
20
|
action="help",
|
41
21
|
default=argparse.SUPPRESS,
|
42
22
|
help=argparse.SUPPRESS
|
43
23
|
)
|
44
24
|
|
45
|
-
|
46
|
-
args = parser.parse_args()
|
47
|
-
|
48
|
-
# Validate mandatory arguments
|
49
|
-
if not args.url:
|
50
|
-
print(f"{Fore.RED}Error: The URL (-u) is required.{Style.RESET_ALL}")
|
51
|
-
parser.print_usage()
|
52
|
-
exit(1)
|
53
|
-
if not args.output:
|
54
|
-
print(f"{Fore.RED}Error: The output (-o) is required.{Style.RESET_ALL}")
|
55
|
-
parser.print_usage()
|
56
|
-
exit(1)
|
57
|
-
|
58
|
-
return args
|
25
|
+
return parser.parse_args()
|
DDownloader/modules/banners.py
CHANGED
@@ -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.3.
|
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)
|
@@ -1,15 +1,15 @@
|
|
1
1
|
DDownloader/__init__.py,sha256=lVZwmZNId0Dai7XBQpxglmJtIxAtZplRHDsvobL2UNo,33
|
2
|
-
DDownloader/main.py,sha256=
|
2
|
+
DDownloader/main.py,sha256=dHsxQHnwb4-vRCerlf7aklYXoAz4S9kJQpeNeecykPI,3887
|
3
3
|
DDownloader/modules/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
4
|
-
DDownloader/modules/args_parser.py,sha256=
|
5
|
-
DDownloader/modules/banners.py,sha256=
|
4
|
+
DDownloader/modules/args_parser.py,sha256=DK_oNrR2c8hZO8Bn4IscHbzfwzM8x4RbZ54fPeF9X5M,1001
|
5
|
+
DDownloader/modules/banners.py,sha256=tZqgXr-Ap3HDKgFvHtFyskC886lbVmf3UVxU8XbDCkQ,4059
|
6
6
|
DDownloader/modules/dash_downloader.py,sha256=wrLm9euQcjr7fpSVbjl57-F_ZA431_W6zH9ITCWHUIs,3953
|
7
7
|
DDownloader/modules/helper.py,sha256=zmJxs0dX72vWaYDKTWUy1KxiTcGQ4zJa6ZUz5RVz3NA,3811
|
8
8
|
DDownloader/modules/hls_downloader.py,sha256=cHDQD_SPorkE3aYF9470pR6zYyKHcIiIsOH2znzWW-E,3948
|
9
9
|
DDownloader/modules/streamlink.py,sha256=F8vneSkxgGgqxRBhCHxvID-KwltpDG2QerH6QsAHuxE,506
|
10
|
-
DDownloader-0.3.
|
11
|
-
DDownloader-0.3.
|
12
|
-
DDownloader-0.3.
|
13
|
-
DDownloader-0.3.
|
14
|
-
DDownloader-0.3.
|
15
|
-
DDownloader-0.3.
|
10
|
+
DDownloader-0.3.1.dist-info/LICENSE,sha256=cnjTim3BMjb9cVC_b3oS41FESKLuvuDsufVHa_ymZRw,1090
|
11
|
+
DDownloader-0.3.1.dist-info/METADATA,sha256=rPnuDVxxTWuS5lORbGkxl9Py2IuYvZh9kAXHaRgG1Sk,3754
|
12
|
+
DDownloader-0.3.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
13
|
+
DDownloader-0.3.1.dist-info/entry_points.txt,sha256=tCZVr_SRONlWlMFsVKgcPj3lxe9gBtWD4GuWukMv75g,54
|
14
|
+
DDownloader-0.3.1.dist-info/top_level.txt,sha256=INZYgY1vEHV1MIWTPXKJL8j8-ZXjWb8u4XLuU3S8umY,12
|
15
|
+
DDownloader-0.3.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|