Skip to content

A simple program to export some of your Reddit data (Codeberg mirror)

License

Notifications You must be signed in to change notification settings

gkaklas/reddit_export_data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Since in a few days I probably won't be able to freely or easily download my data from Reddit, I wrote this simple client to download them and save them in YAML.

You can also make a data request here, but I'm not sure about the provided data format, and they say it may take up to 30 days to generate the archive (??). (It's been a couple of days since I made the request and there is no feedback; for comparison, Facebook responds with a link to an archive with all messages, media and metadata in JSON after a few minutes)

Usage

Create a Reddit app

First you need to create an app at https://old.reddit.com/prefs/apps/, then enter your client id, client secret, username and password in the .env file. (I don't like using the username and password, but unfortunately I couldn't make OAuth work)

You can read about setting the recommended user agent here and here. TL;DR: <platform>:<app ID>:<version string> (by u/<Reddit username>).

Running

If you have just, you can just run -h to run this utility. Otherwise, prepare an environment with:

python -m venv ./venv
source ./venv/bin/activate
python -m pip install -r requirements.txt

Then run with python ./main.py -h to see available options.

Options

  • --subreddits: Writes a list of your subscribed subreddits in subreddits.txt, one subreddit name per line.
  • --multireddits: Saves your multireddits and their subreddits in multireddits.yaml
  • --redditor: Saves your posts and comments with some metadata in redditor.yaml
  • --saved: Saves your saved posts and comments with some metadata in saved.yaml. I have also added some super advanced logic to tag posts linking to external domains, for e.g. blog posts, articles etc

About

A simple program to export some of your Reddit data (Codeberg mirror)

Topics

Resources

License

Stars

Watchers

Forks