Skip to content

Bulk asynchronous downloader for multiple file hosts

add wrapper for submission read.

Jules-WinnfieldX8f786c292347
diff --git a/cyberdrop_dl/scraper/crawlers/reddit_crawler.py b/cyberdrop_dl/scraper/crawlers/reddit_crawler.py
index 6a426af06..94ae9bbea 100644
--- a/cyberdrop_dl/scraper/crawlers/reddit_crawler.py
+++ b/cyberdrop_dl/scraper/crawlers/reddit_crawler.py
@@ -137,7 +137,14 @@ class RedditCrawler(Crawler):
except NoExtensionFailure:
head = await self.client.get_head(self.domain, scrape_item.url)
head = await self.client.get_head(self.domain, head['location'])
- post = await reddit.submission(url=head['location'])
+
+ try:
+ post = await reddit.submission(url=head['location'])
+ except asyncprawcore.exceptions.Forbidden:
+ raise ScrapeFailure(403, "Forbidden")
+ except asyncprawcore.exceptions.NotFound:
+ raise ScrapeFailure(404, "Not Found")
+
await self.post(scrape_item, post, reddit)
return