arshadrr / subreddit-archiver

Python utility to archive and keep up-to-date archives of reddit subreddits. Archives to SQLite databases.
GNU General Public License v3.0
29 stars 1 forks source link

Some posts are not downloaded #4

Open ngirard opened 2 years ago

ngirard commented 2 years ago

Right after completing an update for /r/rust, here's how the https://www.reddit.com/r/rust/new/ page looked in my browser:

Screenshot_20211217_110938

The post Announce Engula 0.2! (id=riba4x) is indeed part of the archive:

sqlite3 rust.sqlite "SELECT id, title FROM posts ORDER BY created_utc DESC LIMIT 1;"
riba4x|Announce Engula 0.2!

but the previous one ([MEDIA] Basic rasterizer using compute shaders and wgpu, id=ri8vvn) is not:

sqlite3 rust.sqlite "SELECT id, title FROM posts WHERE id='ri8vvn'"

That's... not good at all :-( I expect Subreddit-archiver to archive all posts. That's what I need. At the very least, whenever some posts couldn't be downloaded for any reason, it should be reported.

arshadrr commented 2 years ago

Hi,

That is not a flaw with the utility. This utility uses the API provided by pushshift.io to get the ids of posts to archive. (This is done because Reddit imposes a limit that only 1000 posts into the past can be queried from its API unless you have the post IDs.)

For some reason, pushshift has not saved the post you notice is missing, it is not the utility that skipped it. From past experience I would wager the missing post was hidden by the spam filter which stopped pushshift from getting hold of it, but was later approved by a moderator, showing up on the subreddit but not on pushshift.

You can find documentation for the pushshift API, used by the tool and which I queried to try see what was wrong, here: https://github.com/pushshift/api

arshadrr commented 2 years ago

I am working on making the utility use the Reddit API for the most recent 1000 posts and only then relying on Pushshift.io, mainly for performance reasons, but the fix should help with this issue as well. Again it is a lack of time that has stopped me from working on this shortcoming. Sorry about this!