From 9ccc9e68633420c005518c3225bda27811d7d9ab Mon Sep 17 00:00:00 2001 From: dbanon87 <56310477+dbanon87@users.noreply.github.com> Date: Mon, 29 Nov 2021 09:22:21 -0500 Subject: [PATCH 1/2] Update archiver.py --- bdfr/archiver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bdfr/archiver.py b/bdfr/archiver.py index a2e54e5..559dcc1 100644 --- a/bdfr/archiver.py +++ b/bdfr/archiver.py @@ -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) From 1530456cf7b6351b00a1c742d36d78475b6a3c7e Mon Sep 17 00:00:00 2001 From: dbanon87 <56310477+dbanon87@users.noreply.github.com> Date: Mon, 29 Nov 2021 09:23:04 -0500 Subject: [PATCH 2/2] Update downloader.py --- bdfr/downloader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bdfr/downloader.py b/bdfr/downloader.py index 028430f..02f5c68 100644 --- a/bdfr/downloader.py +++ b/bdfr/downloader.py @@ -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')