Skip to content

Bulk asynchronous downloader for multiple file hosts

nudostar remove removal of trailing / on links, as nudo redirects without them.

Jules-WinnfieldX318d4e6a8a52
diff --git a/cyberdrop_dl/scraper/crawlers/nudostar_crawler.py b/cyberdrop_dl/scraper/crawlers/nudostar_crawler.py
index e1adb6074..10c957b69 100644
--- a/cyberdrop_dl/scraper/crawlers/nudostar_crawler.py
+++ b/cyberdrop_dl/scraper/crawlers/nudostar_crawler.py
@@ -150,9 +150,6 @@ class NudoStarCrawler(Crawler):
link = link.replace(".th.", ".").replace(".md.", ".")
- if link.endswith("/"):
- link = link[:-1]
-
if link.startswith("//"):
link = "https:" + link
elif link.startswith("/"):
@@ -185,8 +182,6 @@ class NudoStarCrawler(Crawler):
continue
link = link.replace(".th.", ".").replace(".md.", ".")
- if link.endswith("/"):
- link = link[:-1]
if link.startswith("//"):
link = "https:" + link
@@ -214,9 +209,6 @@ class NudoStarCrawler(Crawler):
if not link:
continue
- if link.endswith("/"):
- link = link[:-1]
-
if link.startswith("//"):
link = "https:" + link
@@ -261,9 +253,6 @@ class NudoStarCrawler(Crawler):
if not link:
continue
- if link.endswith("/"):
- link = link[:-1]
-
if link.startswith("//"):
link = "https:" + link
elif link.startswith("/"):
@@ -284,7 +273,8 @@ class NudoStarCrawler(Crawler):
@error_handling_wrapper
async def handle_internal_links(self, link: URL, scrape_item: ScrapeItem) -> None:
"""Handles internal links"""
- filename, ext = await get_filename_and_ext(link.name, True)
+ temp_link = URL(str(link)[:-1]) if str(link).endswith("/") else link
+ filename, ext = await get_filename_and_ext(temp_link.name, True)
new_scrape_item = ScrapeItem(link, scrape_item.parent_title, True)
await new_scrape_item.add_to_parent_title("Attachments")
await self.handle_file(link, new_scrape_item, filename, ext)