Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix download delay not being used, bunkrr rate limiter not being used.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Dec 6, 2023
1 parent 7aa78c8 commit 071855d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.0.48"
__version__ = "5.0.49"
2 changes: 2 additions & 0 deletions cyberdrop_dl/clients/download_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ async def _download(self, domain: str, manager: Manager, media_item: MediaItem,
headers['Referer'] = str(media_item.referer)
headers.update(headers_inc)

await asyncio.sleep(self.client_manager.download_delay)

async with client_session.get(media_item.url, headers=headers, ssl=self.client_manager.ssl_context,
proxy=self.client_manager.proxy) as resp:
await self.client_manager.check_http_status(resp.status, resp.headers, resp.url, download=True)
Expand Down
2 changes: 1 addition & 1 deletion cyberdrop_dl/managers/client_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, manager: Manager):
self.proxy = manager.config_manager.global_settings_data['General']['proxy']

self.domain_rate_limits = {
"bunkr": AsyncLimiter(5, 1),
"bunkrr": AsyncLimiter(5, 1),
"cyberdrop": AsyncLimiter(10, 1),
"pixeldrain": AsyncLimiter(10, 1),
"other": AsyncLimiter(25, 1)
Expand Down
6 changes: 3 additions & 3 deletions cyberdrop_dl/ui/prompts/settings_global_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def edit_rate_limiting_settings_prompt(manager: Manager) -> None:
).execute()
throttle = inquirer.number(
message="Delay between requests during the download stage:",
default=int(manager.config_manager.global_settings_data['Rate_Limiting_Options']['download_delay']),
float_allowed=False,
default=float(manager.config_manager.global_settings_data['Rate_Limiting_Options']['download_delay']),
float_allowed=True,
).execute()

max_simultaneous_downloads = inquirer.number(
Expand All @@ -137,6 +137,6 @@ def edit_rate_limiting_settings_prompt(manager: Manager) -> None:
manager.config_manager.global_settings_data['Rate_Limiting_Options']['read_timeout'] = int(read_timeout)
manager.config_manager.global_settings_data['Rate_Limiting_Options']['download_attempts'] = int(download_attempts)
manager.config_manager.global_settings_data['Rate_Limiting_Options']['rate_limit'] = int(rate_limit)
manager.config_manager.global_settings_data['Rate_Limiting_Options']['download_delay'] = int(throttle)
manager.config_manager.global_settings_data['Rate_Limiting_Options']['download_delay'] = float(throttle)
manager.config_manager.global_settings_data['Rate_Limiting_Options']['max_simultaneous_downloads'] = int(max_simultaneous_downloads)
manager.config_manager.global_settings_data['Rate_Limiting_Options']['max_simultaneous_downloads_per_domain'] = int(max_simultaneous_downloads_per_domain)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
version = "5.0.48"
version = "5.0.49"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 071855d

Please sign in to comment.