DDownloader 0.3.0__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.
Files changed (21) hide show
  1. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader/main.py +17 -32
  2. ddownloader-0.3.1/DDownloader/modules/args_parser.py +25 -0
  3. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader/modules/banners.py +1 -1
  4. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader.egg-info/PKG-INFO +1 -1
  5. {ddownloader-0.3.0 → ddownloader-0.3.1}/PKG-INFO +1 -1
  6. {ddownloader-0.3.0 → ddownloader-0.3.1}/pyproject.toml +1 -1
  7. ddownloader-0.3.0/DDownloader/modules/args_parser.py +0 -58
  8. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader/__init__.py +0 -0
  9. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader/modules/__init__.py +0 -0
  10. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader/modules/dash_downloader.py +0 -0
  11. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader/modules/helper.py +0 -0
  12. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader/modules/hls_downloader.py +0 -0
  13. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader/modules/streamlink.py +0 -0
  14. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader.egg-info/SOURCES.txt +0 -0
  15. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader.egg-info/dependency_links.txt +0 -0
  16. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader.egg-info/entry_points.txt +0 -0
  17. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader.egg-info/requires.txt +0 -0
  18. {ddownloader-0.3.0 → ddownloader-0.3.1}/DDownloader.egg-info/top_level.txt +0 -0
  19. {ddownloader-0.3.0 → ddownloader-0.3.1}/LICENSE +0 -0
  20. {ddownloader-0.3.0 → ddownloader-0.3.1}/README.md +0 -0
  21. {ddownloader-0.3.0 → ddownloader-0.3.1}/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("+ DDOWNLOADER + ")
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
- try:
22
- os.makedirs(downloads_dir, exist_ok=True)
23
- # logger.debug(f"Validated existence of directory: '{downloads_dir}'.")
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}-h, --header{' ' * 19}{Style.RESET_ALL}Custom HTTP headers (e.g., User-Agent: value) 📋\n"
39
- f" {Fore.GREEN}-?, --help{' ' * 21}{Style.RESET_ALL}Show this help message and exit ❓\n"
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
- if platform_name == 'Unknown':
48
- logger.error(f"Unsupported platform: {platform_name}")
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
- # Add headers if specified
90
- if hasattr(args, 'header') and args.header:
91
- downloader.headers = args.header # Pass headers to downloader
92
- logger.info("Custom HTTP headers provided:")
93
- for header in args.header:
94
- logger.info(f" --header {header}")
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()
@@ -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.0] \n{Fore.RESET}")
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,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: DDownloader
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: A downloader for DRM-protected content.
5
5
  Author-email: ThatNotEasy <apidotmy@proton.me>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: DDownloader
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: A downloader for DRM-protected content.
5
5
  Author-email: ThatNotEasy <apidotmy@proton.me>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "DDownloader"
7
- version = "0.3.0"
7
+ version = "0.3.1"
8
8
  description = "A downloader for DRM-protected content."
9
9
  readme = { file = "README.md", content-type = "text/markdown" }
10
10
  authors = [
@@ -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