DDownloader 0.3.5__py3-none-any.whl → 0.3.6__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 CHANGED
@@ -80,6 +80,11 @@ def main():
80
80
  logger.info("HLS stream detected. Initializing HLS downloader...")
81
81
  elif re.search(r"\.ism\b", args.url, re.IGNORECASE):
82
82
  logger.info("ISM (Smooth Streaming) detected. Initializing ISM downloader...")
83
+ elif re.search(r"\.mp4\b", args.url, re.IGNORECASE):
84
+ logger.info("MP4 file detected. Processing media information...")
85
+ print(Fore.RED + "═" * 100 + Fore.RESET)
86
+ downloader.normal_downloader(args.url, os.path.join(downloads_dir, args.output))
87
+ exit(1)
83
88
  else:
84
89
  logger.error("Unsupported URL format. Please provide a valid DASH (.mpd), HLS (.m3u8), or ISM (.ism) URL.")
85
90
  exit(1)
@@ -1 +1 @@
1
- __version__ = "0.3.5"
1
+ __version__ = "0.3.6"
@@ -23,7 +23,7 @@ def banners():
23
23
  stdout.write(""+Fore.YELLOW +"╔════════════════════════════════════════════════════════════════════════════╝\n")
24
24
  stdout.write(""+Fore.YELLOW +"║ \x1b[38;2;255;20;147m• "+Fore.GREEN+"GITHUB "+Fore.RED+" |"+Fore.LIGHTWHITE_EX+" GITHUB.COM/THATNOTEASY "+Fore.YELLOW+"║\n")
25
25
  stdout.write(""+Fore.YELLOW +"╚════════════════════════════════════════════════════════════════════════════╝\n")
26
- print(f"{Fore.YELLOW}[DDownloader] - {Fore.GREEN}A DRM-Protected Content Downloader - {Fore.RED}[V0.3.5] \n{Fore.RESET}")
26
+ print(f"{Fore.YELLOW}[DDownloader] - {Fore.GREEN}A DRM-Protected & Non-Protected Content Downloader - {Fore.RED}[V0.3.6] \n{Fore.RESET}")
27
27
 
28
28
  # =========================================================================================================== #
29
29
 
@@ -1,8 +1,9 @@
1
- import os
1
+ import os, requests
2
2
  import subprocess
3
3
  import logging
4
4
  import platform
5
5
  import coloredlogs
6
+ from tqdm import tqdm
6
7
  from colorama import Fore
7
8
 
8
9
  logger = logging.getLogger(Fore.RED + "+ DDOWNLOADER + ")
@@ -156,4 +157,47 @@ class DOWNLOADER:
156
157
  return output_file
157
158
  else:
158
159
  logger.error(f"Re-encoding failed. Output file not created: {output_file}")
159
- return None
160
+ return None
161
+
162
+ # =========================================================================================================== #
163
+
164
+ def normal_downloader(self, url, output_file):
165
+ """
166
+ Download a video file from a given URL with a progress bar.
167
+ Automatically adds .mp4 extension if missing.
168
+
169
+ Args:
170
+ url (str): The video URL to download.
171
+ output_file (str): The output file path to save the video.
172
+ """
173
+ try:
174
+ # Add .mp4 extension if not already present
175
+ if not output_file.lower().endswith(".mp4"):
176
+ output_file += ".mp4"
177
+
178
+ # Send a GET request to the URL with stream=True
179
+ response = requests.get(url, stream=True)
180
+ response.raise_for_status() # Raise an exception for HTTP errors
181
+
182
+ # Get the total file size from the headers
183
+ total_size = int(response.headers.get('content-length', 0))
184
+
185
+ # Open the output file in binary write mode
186
+ with open(output_file, 'wb') as file:
187
+ # Use tqdm to show a progress bar
188
+ with tqdm(
189
+ total=total_size,
190
+ unit='B',
191
+ unit_scale=True,
192
+ unit_divisor=1024,
193
+ desc=f"Downloading {os.path.basename(output_file)}",
194
+ ) as progress:
195
+ # Write the content in chunks
196
+ for chunk in response.iter_content(chunk_size=1024):
197
+ file.write(chunk)
198
+ progress.update(len(chunk))
199
+
200
+ print(f"Download complete: {output_file}")
201
+
202
+ except requests.exceptions.RequestException as e:
203
+ print(f"Error during download: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: DDownloader
3
- Version: 0.3.5
3
+ Version: 0.3.6
4
4
  Summary: A downloader for DRM-protected content.
5
5
  Author-email: ThatNotEasy <apidotmy@proton.me>
6
6
  License: MIT License
@@ -124,7 +124,4 @@ _DDownloader is a powerful Python-based tool and library designed to download an
124
124
  DDownloader -h
125
125
  ```
126
126
 
127
- - ![image](https://github.com/user-attachments/assets/5698d535-b818-4566-80f2-44f588646c0f)
128
-
129
- ## THIS PROJECT STILL IN DEVELOPMENT
130
- - Contributions are welcome! Feel free to open issues, create pull requests, or provide suggestions.
127
+ - ![image](https://github.com/user-attachments/assets/8c73a79e-fcac-4bde-a07c-5628db0d19df)
@@ -0,0 +1,14 @@
1
+ DDownloader/__init__.py,sha256=lVZwmZNId0Dai7XBQpxglmJtIxAtZplRHDsvobL2UNo,33
2
+ DDownloader/main.py,sha256=7XJrLtMaw_5taymEoPfDgfQCw9K3JJmW8gScR6gVOPw,5792
3
+ DDownloader/modules/__init__.py,sha256=eauHvAzEXc0aJ5xQZmFSxwn1EEN1n8i04B7G0Sk7rzI,21
4
+ DDownloader/modules/args_parser.py,sha256=Xc9ZzBu-QPFrBURIcq7rl8IJbrdPMy7EMWc-odVM2QU,1105
5
+ DDownloader/modules/banners.py,sha256=vJQF9XCbTkeoGa4kOn92PyNJw_8NRjXj6jhBBb6PDXY,5656
6
+ DDownloader/modules/downloader.py,sha256=3PJfD0sxK66IR2OPVPjsG_-iQREkBKYFlG5lNnzQ0eI,7861
7
+ DDownloader/modules/helper.py,sha256=b8h-h4_JqE02D26qBzSRW11LWhYUTnBkNIeYlWRO-ZY,5951
8
+ DDownloader/modules/streamlink.py,sha256=t7aaHCnINzSFybTmAd-dvfGFQkepFHJwrOBcNxyJviY,504
9
+ DDownloader-0.3.6.dist-info/LICENSE,sha256=cnjTim3BMjb9cVC_b3oS41FESKLuvuDsufVHa_ymZRw,1090
10
+ DDownloader-0.3.6.dist-info/METADATA,sha256=hZdSKKDaGMl7YBy1PbXAXGDynGf4neYlF4wF6qApUIQ,4730
11
+ DDownloader-0.3.6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
12
+ DDownloader-0.3.6.dist-info/entry_points.txt,sha256=tCZVr_SRONlWlMFsVKgcPj3lxe9gBtWD4GuWukMv75g,54
13
+ DDownloader-0.3.6.dist-info/top_level.txt,sha256=INZYgY1vEHV1MIWTPXKJL8j8-ZXjWb8u4XLuU3S8umY,12
14
+ DDownloader-0.3.6.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- DDownloader/__init__.py,sha256=lVZwmZNId0Dai7XBQpxglmJtIxAtZplRHDsvobL2UNo,33
2
- DDownloader/main.py,sha256=TQ58NNmigBGKGxMm-PAPL0RG5w8WOpBq0g4J6xQtoSg,5480
3
- DDownloader/modules/__init__.py,sha256=7Mpk_ZUorFUStSKEAk4F5dnB7uCLNFviloAVMVv5V-8,21
4
- DDownloader/modules/args_parser.py,sha256=Xc9ZzBu-QPFrBURIcq7rl8IJbrdPMy7EMWc-odVM2QU,1105
5
- DDownloader/modules/banners.py,sha256=9lgi1AGQubI8VYXtQVr2gBt0LfeqEI947sDzxsjpjqY,5640
6
- DDownloader/modules/downloader.py,sha256=PaM-khHiW5jIgfOR5_mMnjbJPWk5js3JKQTFBprQY8o,6031
7
- DDownloader/modules/helper.py,sha256=b8h-h4_JqE02D26qBzSRW11LWhYUTnBkNIeYlWRO-ZY,5951
8
- DDownloader/modules/streamlink.py,sha256=t7aaHCnINzSFybTmAd-dvfGFQkepFHJwrOBcNxyJviY,504
9
- DDownloader-0.3.5.dist-info/LICENSE,sha256=cnjTim3BMjb9cVC_b3oS41FESKLuvuDsufVHa_ymZRw,1090
10
- DDownloader-0.3.5.dist-info/METADATA,sha256=y6ZdCW6XLUGrT3YVf1gX9dfS1dKU7rER6WVyUXjOfLk,4872
11
- DDownloader-0.3.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
12
- DDownloader-0.3.5.dist-info/entry_points.txt,sha256=tCZVr_SRONlWlMFsVKgcPj3lxe9gBtWD4GuWukMv75g,54
13
- DDownloader-0.3.5.dist-info/top_level.txt,sha256=INZYgY1vEHV1MIWTPXKJL8j8-ZXjWb8u4XLuU3S8umY,12
14
- DDownloader-0.3.5.dist-info/RECORD,,