Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
ci: update ruff action
NTFSvolume008e53825ac6
diff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yamlindex 6451ebc47..34d4a54d8 100644--- a/.github/workflows/ruff.yaml+++ b/.github/workflows/ruff.yaml@@ -9,8 +9,11 @@ jobs:- name: ruff lintuses: astral-sh/ruff-action@v1+ with:+ version: v0.8.0- name: ruff format checkuses: astral-sh/ruff-action@v1with:args: "format --check"+ version: v0.8.0diff --git a/cyberdrop_dl/clients/hash_client.py b/cyberdrop_dl/clients/hash_client.pyindex 413e3c6bc..520470e9e 100644--- a/cyberdrop_dl/clients/hash_client.py+++ b/cyberdrop_dl/clients/hash_client.py@@ -110,7 +110,10 @@ class HashClient:async def hash_item_during_download(self, media_item: MediaItem) -> None:try:- if self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"] !=self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"].IN_PLACE:+ if (+ self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"]+ != self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"].IN_PLACE+ ):returnawait self.hash_item_helper(media_item.complete_file, media_item.original_filename, media_item.referer)except Exception as e:@@ -118,7 +121,10 @@ class HashClient:async def cleanup_dupes_after_download(self) -> None:with self.manager.live_manager.get_hash_live(stop=True):- if self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"] == self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"].OFF:+ if (+ self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"]+ == self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"].OFF+ ):returnif not self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["auto_dedupe"]:return@@ -151,7 +157,7 @@ class HashClient:async def get_file_hashes_dict(self) -> dict:hashes_dict = defaultdict(lambda: defaultdict(list))# first compare downloads to each other- #get representive for each hash+ # get representive for each hashfor media_item in list(self.manager.path_manager.completed_downloads):hash = await self.hash_item_helper(media_item.complete_file, media_item.original_filename, media_item.refererdiff --git a/cyberdrop_dl/main.py b/cyberdrop_dl/main.pyindex dba27ac77..17d9b0c4b 100644--- a/cyberdrop_dl/main.py+++ b/cyberdrop_dl/main.py@@ -91,11 +91,8 @@ async def post_runtime(manager: Manager) -> None:# checking and removing dupesif not manager.args_manager.sort_all_configs:await manager.hash_manager.hash_client.cleanup_dupes_after_download()- if (- isinstance(manager.args_manager.sort_downloads, bool)- and manager.args_manager.sort_downloads- or manager.config_manager.settings_data["Sorting"]["sort_downloads"]- and not manager.args_manager.retry_any+ if (isinstance(manager.args_manager.sort_downloads, bool) and manager.args_manager.sort_downloads) or (+ manager.config_manager.settings_data["Sorting"]["sort_downloads"] and not manager.args_manager.retry_any):sorter = Sorter(manager)await sorter.sort()diff --git a/cyberdrop_dl/scraper/filters.py b/cyberdrop_dl/scraper/filters.pyindex ed6a08e9f..7f9b34662 100644--- a/cyberdrop_dl/scraper/filters.py+++ b/cyberdrop_dl/scraper/filters.py@@ -35,7 +35,7 @@ def is_outside_date_range(scrape_item: ScrapeItem, before: arrow, after: arrow)item_date = scrape_item.completed_at or scrape_item.created_atif not item_date:return False- if after and arrow.get(item_date) < after or before and arrow.get(item_date) > before:+ if (after and arrow.get(item_date) < after) or (before and arrow.get(item_date) > before):skip = Truereturn skipdiff --git a/cyberdrop_dl/utils/data_enums_classes/hash.py b/cyberdrop_dl/utils/data_enums_classes/hash.pyindex efba6e05e..defa79869 100644--- a/cyberdrop_dl/utils/data_enums_classes/hash.py+++ b/cyberdrop_dl/utils/data_enums_classes/hash.py@@ -12,4 +12,3 @@ class Hashing(IntEnum):return cls[str(value.upper())]except KeyError as e:raise e-diff --git a/cyberdrop_dl/utils/database/tables/hash_table.py b/cyberdrop_dl/utils/database/tables/hash_table.pyindex 8689d8377..5ab3e736d 100644--- a/cyberdrop_dl/utils/database/tables/hash_table.py+++ b/cyberdrop_dl/utils/database/tables/hash_table.py@@ -2,7 +2,7 @@ from __future__ import annotationsfrom pathlib import Pathfrom sqlite3 import IntegrityError-from typing import TYPE_CHECKING, Union+from typing import TYPE_CHECKINGfrom rich.console import Console@@ -99,7 +99,7 @@ class HashTable:console.print(f"Error checking file: {e}")return None- async def get_files_with_hash_matches(self, hash_value: str, size: int, hash_type: Union(str, None) = None) -> list:+ async def get_files_with_hash_matches(self, hash_value: str, size: int, hash_type: str | None = None) -> list:"""Retrieves a list of (folder, filename) tuples based on a given hash.Args:diff --git a/poetry.lock b/poetry.lockindex ff52a997b..f64c8c93e 100644--- a/poetry.lock+++ b/poetry.lock@@ -1464,29 +1464,29 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"][[package]]name = "ruff"-version = "0.7.4"+version = "0.8.0"description = "An extremely fast Python linter and code formatter, written in Rust."optional = falsepython-versions = ">=3.7"files = [- {file = "ruff-0.7.4-py3-none-linux_armv6l.whl", hash = "sha256:a4919925e7684a3f18e18243cd6bea7cfb8e968a6eaa8437971f681b7ec51478"},- {file = "ruff-0.7.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cfb365c135b830778dda8c04fb7d4280ed0b984e1aec27f574445231e20d6c63"},- {file = "ruff-0.7.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:63a569b36bc66fbadec5beaa539dd81e0527cb258b94e29e0531ce41bacc1f20"},- {file = "ruff-0.7.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d06218747d361d06fd2fdac734e7fa92df36df93035db3dc2ad7aa9852cb109"},- {file = "ruff-0.7.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e0cea28d0944f74ebc33e9f934238f15c758841f9f5edd180b5315c203293452"},- {file = "ruff-0.7.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:80094ecd4793c68b2571b128f91754d60f692d64bc0d7272ec9197fdd09bf9ea"},- {file = "ruff-0.7.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:997512325c6620d1c4c2b15db49ef59543ef9cd0f4aa8065ec2ae5103cedc7e7"},- {file = "ruff-0.7.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00b4cf3a6b5fad6d1a66e7574d78956bbd09abfd6c8a997798f01f5da3d46a05"},- {file = "ruff-0.7.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7dbdc7d8274e1422722933d1edddfdc65b4336abf0b16dfcb9dedd6e6a517d06"},- {file = "ruff-0.7.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e92dfb5f00eaedb1501b2f906ccabfd67b2355bdf117fea9719fc99ac2145bc"},- {file = "ruff-0.7.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:3bd726099f277d735dc38900b6a8d6cf070f80828877941983a57bca1cd92172"},- {file = "ruff-0.7.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:2e32829c429dd081ee5ba39aef436603e5b22335c3d3fff013cd585806a6486a"},- {file = "ruff-0.7.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:662a63b4971807623f6f90c1fb664613f67cc182dc4d991471c23c541fee62dd"},- {file = "ruff-0.7.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:876f5e09eaae3eb76814c1d3b68879891d6fde4824c015d48e7a7da4cf066a3a"},- {file = "ruff-0.7.4-py3-none-win32.whl", hash = "sha256:75c53f54904be42dd52a548728a5b572344b50d9b2873d13a3f8c5e3b91f5cac"},- {file = "ruff-0.7.4-py3-none-win_amd64.whl", hash = "sha256:745775c7b39f914238ed1f1b0bebed0b9155a17cd8bc0b08d3c87e4703b990d6"},- {file = "ruff-0.7.4-py3-none-win_arm64.whl", hash = "sha256:11bff065102c3ae9d3ea4dc9ecdfe5a5171349cdd0787c1fc64761212fc9cf1f"},- {file = "ruff-0.7.4.tar.gz", hash = "sha256:cd12e35031f5af6b9b93715d8c4f40360070b2041f81273d0527683d5708fce2"},+ {file = "ruff-0.8.0-py3-none-linux_armv6l.whl", hash = "sha256:fcb1bf2cc6706adae9d79c8d86478677e3bbd4ced796ccad106fd4776d395fea"},+ {file = "ruff-0.8.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:295bb4c02d58ff2ef4378a1870c20af30723013f441c9d1637a008baaf928c8b"},+ {file = "ruff-0.8.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7b1f1c76b47c18fa92ee78b60d2d20d7e866c55ee603e7d19c1e991fad933a9a"},+ {file = "ruff-0.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb0d4f250a7711b67ad513fde67e8870109e5ce590a801c3722580fe98c33a99"},+ {file = "ruff-0.8.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0e55cce9aa93c5d0d4e3937e47b169035c7e91c8655b0974e61bb79cf398d49c"},+ {file = "ruff-0.8.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f4cd64916d8e732ce6b87f3f5296a8942d285bbbc161acee7fe561134af64f9"},+ {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:c5c1466be2a2ebdf7c5450dd5d980cc87c8ba6976fb82582fea18823da6fa362"},+ {file = "ruff-0.8.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2dabfd05b96b7b8f2da00d53c514eea842bff83e41e1cceb08ae1966254a51df"},+ {file = "ruff-0.8.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:facebdfe5a5af6b1588a1d26d170635ead6892d0e314477e80256ef4a8470cf3"},+ {file = "ruff-0.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87a8e86bae0dbd749c815211ca11e3a7bd559b9710746c559ed63106d382bd9c"},+ {file = "ruff-0.8.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:85e654f0ded7befe2d61eeaf3d3b1e4ef3894469cd664ffa85006c7720f1e4a2"},+ {file = "ruff-0.8.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:83a55679c4cb449fa527b8497cadf54f076603cc36779b2170b24f704171ce70"},+ {file = "ruff-0.8.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:812e2052121634cf13cd6fddf0c1871d0ead1aad40a1a258753c04c18bb71bbd"},+ {file = "ruff-0.8.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:780d5d8523c04202184405e60c98d7595bdb498c3c6abba3b6d4cdf2ca2af426"},+ {file = "ruff-0.8.0-py3-none-win32.whl", hash = "sha256:5fdb6efecc3eb60bba5819679466471fd7d13c53487df7248d6e27146e985468"},+ {file = "ruff-0.8.0-py3-none-win_amd64.whl", hash = "sha256:582891c57b96228d146725975fbb942e1f30a0c4ba19722e692ca3eb25cc9b4f"},+ {file = "ruff-0.8.0-py3-none-win_arm64.whl", hash = "sha256:ba93e6294e9a737cd726b74b09a6972e36bb511f9a102f1d9a7e1ce94dd206a6"},+ {file = "ruff-0.8.0.tar.gz", hash = "sha256:a7ccfe6331bf8c8dad715753e157457faf7351c2b69f62f32c165c2dbcbacd44"},][[package]]@@ -1847,4 +1847,4 @@ propcache = ">=0.2.0"[metadata]lock-version = "2.0"python-versions = ">=3.11,<3.13"-content-hash = "0eecea49b1424abad912bd6752e93a60020247985ab17ac0e7d7ce67d6447629"+content-hash = "29b7d6f3aa7f841efebc9c7b253a37018edccb332e2baf1303c60d4db88abdb7"diff --git a/pyproject.toml b/pyproject.tomlindex 0cded10a8..f42edd9f3 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -42,7 +42,7 @@ cyberdrop-dl = "cyberdrop_dl.main:main"[tool.poetry.group.dev.dependencies]pre-commit = "^4.0.1"-ruff = "^0.7.2"+ruff = "^0.8.0"[tool.ruff]line-length = 120