Archive a reddit user's post history. Formatted overview of a profile, JSON containing every post, and picture downloads.
Project description
redditsfinder
pip3 install redditsfinder
A command line program to easily download reddit users' post histories.
Get any reddit user's entire post history with one command while avoiding the reddit API's 1000 post limit.
The main meat of this program is making the requests to pushshift and manipulating pushshift's JSON for a more readable all_posts.json file.
There is also a handly image downloader I made that avoids a lot of the problems of trying to grab multiple images from different sites at once. Things like file types being not what the file is encoded as, and changed URLs. Or a URL that ends with .png that returns ASCII text. It gets imgur albums along with images, because at least for a while imgur was essentially reddit's non-official image hosting service.
The colored terminal features and markup are from https://github.com/willmcgugan/rich
pip3 install rich
which is one the coolest python packages I've seen. It's very easy to pick up, but as is shown with the animated example in its README, still has a lot of depth.
https://github.com/LoLei/redditcleaner pip3 install redditcleaner
was also a massive help for dealing with reddit's strange markup.
Comments and self-posts can be unreadable when put in another format like JSON if they have a fair amount of formatting.
To deal with it, I gave up and looked online for an alternative. Luckily there was a good one readily available.
Installation and a sample run
With pypi (easiest)
pip3 install redditsfinder
With git
pip3 install redditcleaner rich
git clone https://github.com/Fitzy1293/redditsfinder.git
cd redditsfinder
Now test if it works.
python3 redditsfinder.py 'yourUsername'
That's all there is to setup.
Running redditsfinder
Arguments
python3 -m redditsfinder 'username'
returns every user post.
python3 -m redditsfinder -pics 'username'
returns URLs of user's image uploads.
python3 -m redditsfinder -pics -d 'username'
downloads them.
If you installed with pip
python3 -m redditsfinder [options] 'username'
If you installed with git
In the directory where you installed redditsfinder.py
python3 redditsfinder.py [options] 'username'
If you made it executable
./redditsfinder.py [options] 'username'
Example JSON object
Example use of -pics -d
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Redditsfinder-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2ed74e0e49709d99a073a4c6aa41aee8503636d198bf6bdf386ac5a10baece4 |
|
MD5 | dcfb5c64a514b6cb32c5faf1bcfd255d |
|
BLAKE2b-256 | 80513c785ce60615ea0429d87c0ad3f72dcf4c4561c0e85475b1694e0e3f1044 |