DDownloader 0.3.0__tar.gz → 0.3.2__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.3.0 → ddownloader-0.3.2}/DDownloader/main.py +24 -32
- ddownloader-0.3.2/DDownloader/modules/args_parser.py +25 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader/modules/banners.py +1 -1
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader.egg-info/PKG-INFO +1 -1
- {ddownloader-0.3.0 → ddownloader-0.3.2}/PKG-INFO +1 -1
- {ddownloader-0.3.0 → ddownloader-0.3.2}/pyproject.toml +1 -1
- ddownloader-0.3.0/DDownloader/modules/args_parser.py +0 -58
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader/__init__.py +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader/modules/__init__.py +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader/modules/dash_downloader.py +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader/modules/helper.py +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader/modules/hls_downloader.py +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader/modules/streamlink.py +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader.egg-info/SOURCES.txt +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader.egg-info/dependency_links.txt +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader.egg-info/entry_points.txt +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader.egg-info/requires.txt +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/DDownloader.egg-info/top_level.txt +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/LICENSE +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/README.md +0 -0
- {ddownloader-0.3.0 → ddownloader-0.3.2}/setup.cfg +0 -0
@@ -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,22 @@ 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
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
73
|
+
|
74
|
+
if downloader.proxy:
|
75
|
+
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
76
|
+
if not downloader.proxy.startswith("http://"):
|
77
|
+
downloader.proxy = f"http://{downloader.proxy}"
|
78
|
+
logger.info(f"Proxy: {downloader.proxy}")
|
79
|
+
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
80
|
+
|
81
|
+
# Log provided headers
|
82
|
+
if downloader.headers:
|
83
|
+
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
84
|
+
logger.info("Headers provided:")
|
85
|
+
for header in downloader.headers:
|
86
|
+
logger.info(f" -H {header}")
|
95
87
|
print(Fore.MAGENTA + "=" * 100 + Fore.RESET)
|
96
88
|
|
97
89
|
# Log provided decryption keys
|
@@ -112,4 +104,4 @@ def main():
|
|
112
104
|
exit(1)
|
113
105
|
|
114
106
|
if __name__ == "__main__":
|
115
|
-
main()
|
107
|
+
main()
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import argparse
|
2
|
+
from colorama import Fore, Style
|
3
|
+
|
4
|
+
def parse_arguments():
|
5
|
+
"""Parse and return command-line arguments."""
|
6
|
+
# Create the ArgumentParser with no default help and no description
|
7
|
+
parser = argparse.ArgumentParser(
|
8
|
+
add_help=False, # Disable default help
|
9
|
+
usage="", # Suppress the default usage message
|
10
|
+
)
|
11
|
+
|
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)
|
18
|
+
parser.add_argument(
|
19
|
+
"-h", "--help",
|
20
|
+
action="help",
|
21
|
+
default=argparse.SUPPRESS,
|
22
|
+
help=argparse.SUPPRESS
|
23
|
+
)
|
24
|
+
|
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.3.
|
22
|
+
print(f"{Fore.YELLOW}[DDownloader] - {Fore.GREEN}Download DASH or HLS streams with decryption keys. - {Fore.RED}[V0.3.2] \n{Fore.RESET}")
|
23
23
|
|
24
24
|
def clear_and_print():
|
25
25
|
time.sleep(1)
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import argparse
|
2
|
-
from colorama import Fore, Style
|
3
|
-
|
4
|
-
def parse_arguments():
|
5
|
-
"""Parse and return command-line arguments."""
|
6
|
-
# Create the ArgumentParser with a custom usage and help message
|
7
|
-
parser = argparse.ArgumentParser(
|
8
|
-
add_help=False, # Disable default help
|
9
|
-
usage=f"""{Fore.CYAN}Usage:{Style.RESET_ALL}
|
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>]"""
|
11
|
-
)
|
12
|
-
|
13
|
-
# Add arguments (no default descriptions, suppress help visibility)
|
14
|
-
parser.add_argument(
|
15
|
-
"-u", "--url",
|
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",
|
40
|
-
action="help",
|
41
|
-
default=argparse.SUPPRESS,
|
42
|
-
help=argparse.SUPPRESS
|
43
|
-
)
|
44
|
-
|
45
|
-
# Parse arguments
|
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
|
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
|
File without changes
|