Add shortcut in download for certain errors

This commit is contained in:
Serene-Arc
2021-03-15 14:00:21 +10:00
committed by Ali Parlakci
parent 6aab009204
commit 3a093d0844
3 changed files with 12 additions and 2 deletions

View File

@@ -335,7 +335,12 @@ class RedditDownloader:
if destination.exists():
logger.warning(f'File already exists: {destination}')
else:
res.download()
try:
res.download()
except errors.BulkDownloaderException:
logger.error(
f'Failed to download resource from {res.url} with downloader {downloader_class.__name__}')
return
if res.hash.hexdigest() in self.master_hash_list and self.args.no_dupes:
logger.warning(f'Resource from "{res.url}" and hash "{res.hash.hexdigest()}" downloaded elsewhere')
else: