Skip to content

Bulk asynchronous downloader for multiple file hosts

fix: subdomain check was causing download failure (tranny.one) (#167)

Barbarella6666666ae0991a51d4d
diff --git a/cyberdrop_dl/crawlers/tranny_one.py b/cyberdrop_dl/crawlers/tranny_one.py
index b39502c9e..8ed1bcb5d 100644
--- a/cyberdrop_dl/crawlers/tranny_one.py
+++ b/cyberdrop_dl/crawlers/tranny_one.py
@@ -37,9 +37,6 @@ class TrannyOneCrawler(Crawler):
_RATE_LIMIT = 3, 10
async def fetch(self, scrape_item: ScrapeItem) -> None:
- if self.is_subdomain(scrape_item.url):
- return await self.direct_file(scrape_item)
-
match scrape_item.url.parts[1:]:
case ["view", video_id]:
return await self.video(scrape_item, video_id)
@@ -49,6 +46,9 @@ class TrannyOneCrawler(Crawler):
return await self.model(scrape_item, model_id)
case ["pics", "album", album_id]:
return await self.album(scrape_item, album_id)
+ case ["work", "orig", _, _, _]:
+ return await self.direct_file(scrape_item)
+
case _:
raise ValueError
diff --git a/tests/crawlers/test_cases/tranny_one.py b/tests/crawlers/test_cases/tranny_one.py
index 777694cb9..0c35a920f 100644
--- a/tests/crawlers/test_cases/tranny_one.py
+++ b/tests/crawlers/test_cases/tranny_one.py
@@ -2,12 +2,12 @@ DOMAIN = "tranny.one"
TEST_CASES = [
# Video
(
- "https://www.tranny.one/view/1156655/",
+ "https://es.tranny.one/view/1195231",
[
{
- "url": r"re:https://stream.tranny.one/.+/3137805.mp4",
- "filename": "Femboy and the Hunk [1156655].mp4",
- "referer": "https://www.tranny.one/view/1156655",
+ "url": r"re:https://stream.tranny.one/.+/3176393.mp4",
+ "filename": "Travesti pelirroja voluptuosa muy intensa y sudorosa. [1195231].mp4",
+ "referer": "https://es.tranny.one/view/1195231",
"datetime": None,
}
],
@@ -31,4 +31,16 @@ TEST_CASES = [
],
17,
),
+ # Direct image download
+ (
+ "https://pics.tranny.one/work/orig/2915/385865/1.jpg",
+ [
+ {
+ "url": "https://pics.tranny.one/work/orig/2915/385865/1.jpg",
+ "filename": "1.jpg",
+ "download_folder": r"re:Tranny\.One",
+ "referer": "https://pics.tranny.one/work/orig/2915/385865/1.jpg",
+ }
+ ],
+ ),
]