Add 5xx soft fail for clone/archive
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
# coding=utf-8
|
||||
|
||||
import logging
|
||||
from time import sleep
|
||||
|
||||
import prawcore
|
||||
|
||||
@@ -18,9 +19,14 @@ class RedditCloner(RedditDownloader, Archiver):
|
||||
|
||||
def download(self):
|
||||
for generator in self.reddit_lists:
|
||||
for submission in generator:
|
||||
try:
|
||||
self._download_submission(submission)
|
||||
self.write_entry(submission)
|
||||
except prawcore.PrawcoreException as e:
|
||||
logger.error(f"Submission {submission.id} failed to be cloned due to a PRAW exception: {e}")
|
||||
try:
|
||||
for submission in generator:
|
||||
try:
|
||||
self._download_submission(submission)
|
||||
self.write_entry(submission)
|
||||
except prawcore.PrawcoreException as e:
|
||||
logger.error(f"Submission {submission.id} failed to be cloned due to a PRAW exception: {e}")
|
||||
except prawcore.PrawcoreException as e:
|
||||
logger.error(f"The submission after {submission.id} failed to download due to a PRAW exception: {e}")
|
||||
logger.debug("Waiting 60 seconds to continue")
|
||||
sleep(60)
|
||||
|
||||
Reference in New Issue
Block a user