Git Product home page Git Product logo

geddit's Introduction

geddit


This program backs up a Reddit user's saved posts locally. It currently emphasizes saving media content, but the ability to download more saved content types will be implemented in the near future.

Features

  • Back up your entire saved history (>1000 items) from a .csv file provided by Reddit
  • Download saved text posts and media content (gifs, videos, albums) from a variety of sources
  • Extract deleted media using pushshift, cached reddit previews, and the wayback machine
  • Store a record of all saved and unsaved posts locally, skipping already-saved posts in subsequent program executions

Preparing the config files

  1. Create an app on Reddit to obtain an API client ID and secret.
    • Set the name to whatever you want, e.g. geddit
    • Set script as the API type
    • Set the redirect URI to http://localhost:8080
  2. Obtain an Imgur API key to facilitate downloading Imgur albums.
    • Set the name to geddit
    • Set Anonymous usage without user authorization as the authorization type
    • Set the email and description fields accordingly
    • Repeat these steps to obtain several more API keys to circumvent Imgur's rate limit (12500 requests per API)
  3. Rename the user_template.json file to user.json, and fill in its fields with their corresponding API information.

Downloading all saved posts

  1. Request your Reddit data as a zip file.
  2. Move the saved_posts.csv within the zip file into the home directory of the repository.
  3. When starting the Docker environment or running the Python program, append --csv to the command.

Usage (Docker)

  1. Clone the repository.

  2. Navigate into the cloned repository and build an image from the Dockerfile.

    docker build --tag geddit .
    
  3. Start a container from the built image. Replace $(pwd) with %cd% on Windows.

    docker container run --network host -it -v $(pwd)/data:/geddit/data geddit [--csv]
    
    docker container run --network host -it -v %cd%/data:/geddit/data geddit [--csv]
    

Usage (Python)

  1. Clone the repository into a virtual environment.

  2. Install the required Python packages.

    pip install -r requirements.txt
    
  3. Download ffmpeg for the video downloader.

  4. Run the program.

    python3 -m geddit [--csv]
    

Troubleshooting

  • If you're experiencing problems with building the Docker image on Windows, try going into the Docker Engine settings and setting the buildkit option to false.
  • Another problem may arise when trying to run the Docker container, where the praw library throws an OAuthException. This is likely due to the Reddit account having 2FA enabled and it needs to be disabled for the program to work.

To Do

  • Implement post and comment downloading
  • Incoporate wayback machine API calls for deleted media
  • Add scraping to deal with rare instances where reddit API JSON does not adhere to regular, predictable formatting
  • Add multithreading
  • Add progress bar with tqdm
  • Add bloom filter to determine whether post is already saved, improve seek time

geddit's People

Contributors

aeluro1 avatar suicidaly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

geddit's Issues

reddit client id? and change port?

What should be entered in the client_id under the reddit heading in the user.json file?

Also, is there a way to change the port it runs on? i already have stuff running on 8080

Program Hangs on deleted YouTube videos

It seems to have got stuck on downloading youtube videos and is instead downloading random videos, not sure where it is sourcing them from though. would be preferable to had just a skip function or something, I don't really know.

Slow after Python 3.11.5 update

Updated to Python 3.11.5 from 3.11.4. That was the only change made.

It now takes about 5 minutes just to start up, and then about 2 minutes to process each post.

Filling out user.json

Two issues on filling out user.json:

  1. For the Reddit section, one field is "client_id", but Reddit doesn't specify which field this is. I've taken a guess but do you have some feedback?
  2. For the imgur fields, under "client_id" it lists room for 3 keys, but I only got 2 from imgur, the client ID and client secret. Is this enough?

received 401 HTTP response

Might be a dumb question because I'm a noob. but using docker to execute the geddit gets me nothing and only have received 401 HTTP response instead.
PS: the imgur API requires me enter an Authorization callback URL. Should I use http://localhost:8080?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.