Skip to content

Bulk asynchronous downloader for multiple file hosts

Fix pixeldrain filename gathering.

Jules-WinnfieldXd15d9407d82d
diff --git a/README.md b/README.md
index 030dd3294..485517c61 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# `cyberdrop-dl`
**Bulk downloader for multiple file hosts**
-The latest version of the program is 3.6.19
+The latest version of the program is 3.6.21
<a href="https://www.buymeacoffee.com/juleswinnft" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
diff --git a/changelog.txt b/changelog.txt
index 6a3d848e5..0b3036f66 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -86,4 +86,7 @@
- Removes file lock when file is already downloaded, avoids infinite loops in a fringe circumstance.
3.6.13
-- Changes where the DB check is made, can incredibly boost the speed of skipping completed files in some circumstances.
\ No newline at end of file
+- Changes where the DB check is made, can incredibly boost the speed of skipping completed files in some circumstances.
+
+3.6.21
+- added pixeldrain api key support, kemono/coomer allow include_id, fixed cyberfile, fixed pixeldrain, fixed bunkr,
\ No newline at end of file
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 5d188f71f..df986d87a 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "3.6.19"
+__version__ = "3.6.21"
diff --git a/cyberdrop_dl/client/client.py b/cyberdrop_dl/client/client.py
index 2a5de26f6..207b2bf19 100644
--- a/cyberdrop_dl/client/client.py
+++ b/cyberdrop_dl/client/client.py
@@ -110,6 +110,13 @@ class DownloadSession:
cookie_jar=self.client.cookies, timeout=self.timeouts)
self.throttle_times = {}
+ async def get_json_filename(self, url: URL, current_throttle: int, element: str):
+ headers = {'user-agent': self.client.user_agent}
+ await throttle(self, current_throttle, url.host)
+ async with self.client_session.get(url, headers=headers, ssl=self.client.ssl_context) as resp:
+ json_obj = json.loads(await resp.content.read())
+ return json_obj[element]
+
async def get_filename(self, url: URL, referer: str, current_throttle: int):
headers = {'Referer': referer, 'user-agent': self.client.user_agent}
await throttle(self, current_throttle, url.host)
diff --git a/cyberdrop_dl/client/downloaders.py b/cyberdrop_dl/client/downloaders.py
index 01103d0a4..bfa6d8afe 100644
--- a/cyberdrop_dl/client/downloaders.py
+++ b/cyberdrop_dl/client/downloaders.py
@@ -281,7 +281,10 @@ class Downloader:
if value > current_throttle:
current_throttle = value
try:
- filename = await session.get_filename(url, referer, current_throttle)
+ if "pixeldrain" in url.host:
+ filename = await session.get_json_filename(url.with_query(None) / "info", current_throttle, 'name')
+ else:
+ filename = await session.get_filename(url, referer, current_throttle)
filename = await sanitize(filename)
ext = '.' + filename.split('.')[-1].lower()
if not (ext in FILE_FORMATS['Images'] or ext in FILE_FORMATS['Videos']
@@ -362,6 +365,11 @@ class Downloader:
await log(f"\nError attempting {url}")
if hasattr(e, "message"):
logging.debug(f"\n{url} ({e.message})")
+ try:
+ logger.debug("Error status code: " + str(e.code))
+ logger.debug("Error message: " + str(e.message))
+ except:
+ pass
async def download_all(self, album_obj: AlbumItem, session: DownloadSession, show_progress: bool = True) -> None:
"""Download the data from all given links and store them into corresponding files."""