Merge pull request #565 from dbanon87/dbanon87-patch-1
This commit is contained in:
commit
5333705440
@ -28,10 +28,11 @@ class Archiver(RedditConnector):
|
||||
def download(self):
|
||||
for generator in self.reddit_lists:
|
||||
for submission in generator:
|
||||
if submission.author.name in self.args.ignore_user:
|
||||
if (submission.author and submission.author.name in self.args.ignore_user) or \
|
||||
(submission.author is None and 'DELETED' in self.args.ignore_user):
|
||||
logger.debug(
|
||||
f'Submission {submission.id} in {submission.subreddit.display_name} skipped'
|
||||
f' due to {submission.author.name} being an ignored user')
|
||||
f' due to {submission.author.name if submission.author else "DELETED"} being an ignored user')
|
||||
continue
|
||||
logger.debug(f'Attempting to archive submission {submission.id}')
|
||||
self.write_entry(submission)
|
||||
|
@ -51,10 +51,11 @@ class RedditDownloader(RedditConnector):
|
||||
elif submission.subreddit.display_name.lower() in self.args.skip_subreddit:
|
||||
logger.debug(f'Submission {submission.id} in {submission.subreddit.display_name} in skip list')
|
||||
return
|
||||
elif submission.author.name in self.args.ignore_user:
|
||||
elif (submission.author and submission.author.name in self.args.ignore_user) or \
|
||||
(submission.author is None and 'DELETED' in self.args.ignore_user):
|
||||
logger.debug(
|
||||
f'Submission {submission.id} in {submission.subreddit.display_name} skipped'
|
||||
f' due to {submission.author.name} being an ignored user')
|
||||
f' due to {submission.author.name if submission.author else "DELETED"} being an ignored user')
|
||||
return
|
||||
elif not isinstance(submission, praw.models.Submission):
|
||||
logger.warning(f'{submission.id} is not a submission')
|
||||
|
Loading…
Reference in New Issue
Block a user