Skip to content

Commit

Permalink
Merge pull request #566 from aliparlakci/development
Browse files Browse the repository at this point in the history
  • Loading branch information
Serene-Arc authored Nov 30, 2021
2 parents 8718295 + 92dca3b commit 9f354e9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions bdfr/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ def __init__(self, args: Configuration):
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)
Expand Down
5 changes: 3 additions & 2 deletions bdfr/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ def _download_submission(self, submission: praw.models.Submission):
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')
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description_file = README.md
description_content_type = text/markdown
home_page = https://github.com/aliparlakci/bulk-downloader-for-reddit
keywords = reddit, download, archive
version = 2.5.0
version = 2.5.1
author = Ali Parlakci
author_email = [email protected]
maintainer = Serene Arc
Expand Down

0 comments on commit 9f354e9

Please sign in to comment.