{"id":25927856,"url":"https://github.com/samirelanduk/reddit-save","last_synced_at":"2025-03-03T21:10:55.128Z","repository":{"id":44403931,"uuid":"326074595","full_name":"samirelanduk/reddit-save","owner":"samirelanduk","description":"A Python tool for backing up your saved and upvoted posts on reddit to your computer.","archived":false,"fork":false,"pushed_at":"2023-12-26T17:39:12.000Z","size":57,"stargazers_count":146,"open_issues_count":7,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T23:46:33.493Z","etag":null,"topics":["data-hoarder","reddit","reddit-archiving"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samirelanduk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["samirelanduk"]}},"created_at":"2021-01-01T23:37:40.000Z","updated_at":"2025-02-17T07:01:17.000Z","dependencies_parsed_at":"2022-07-15T06:16:10.185Z","dependency_job_id":null,"html_url":"https://github.com/samirelanduk/reddit-save","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samirelanduk%2Freddit-save","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samirelanduk%2Freddit-save/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samirelanduk%2Freddit-save/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samirelanduk%2Freddit-save/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samirelanduk","download_url":"https://codeload.github.com/samirelanduk/reddit-save/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241739430,"owners_count":20012103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-hoarder","reddit","reddit-archiving"],"created_at":"2025-03-03T21:10:54.538Z","updated_at":"2025-03-03T21:10:55.111Z","avatar_url":"https://github.com/samirelanduk.png","language":"Python","funding_links":["https://github.com/sponsors/samirelanduk"],"categories":[],"sub_categories":[],"readme":"# reddit-save\n\nA Python utility for backing up your reddit upvoted/saved stuff.\n\nBrowsing through the stuff you've liked or saved on reddit is really enjoyable and, depending on the reason you saved something, can be a great way to recap stuff you once thought important. It is a personalised feed of posts and comments by the one person guaranteed to know what you like - past you.\n\nHowever over time more and more of the older posts will be deleted or missing, and the historical record atrophies. Use this tool to back up those posts and comments to your computer where you can browse them offline, and where they are safe forever.\n\nreddit-save will backup saved posts, saved comments, and upvoted posts. It can't do upvoted comments because the reddit API doesn't expose them. Crucially, when it is run again on the same location it will ignore any posts/comments previously archived - once something is saved, it's saved permanently.\n\n## Installation\n\n```bash\n$ git clone https://github.com/samirelanduk/reddit-save .\n$ cd reddit-save\n$ pip install -r requirements.txt\n```\n\nIf you get permission errors, try using `sudo` or using a virtual environment.\n\nYou will need [ffmpeg](https://ffmpeg.org/) installed somewhere too.\n\nRename the file `logindata.py.example` to `logindata.py`. You will need to add four things to this file, your reddit username and password, and a reddit client ID and secret. The latter two are obtained using [the instructions here](https://github.com/reddit-archive/reddit/wiki/OAuth2-Quick-Start-Example#first-steps). The file should look something like this:\n\n```python\nREDDIT_USERNAME = \"spez\"\nREDDIT_PASSWORD = \"myredditpassword123\"\nREDDIT_CLIENT_ID = \"sadsU7-zfX\"\nREDDIT_SECRET = \"687DDJSS\u0026999d-hdkjK8h\"\n```\n\n(If you have 2FA enabled, you will need to append that to the password, separated by a colon.)\n\n## Use\n\nCreate a folder that will contain your archive. Then run:\n\n```bash\n$ ./save.py saved folder_name\n$ ./save.py upvoted folder_name\n```\n\nThe first command will backup your saved posts/comments to a file called folder_name/saved.html. The second will backup your upvoted posts to a file called folder_name/upvoted.html.\n\nEach post will have its top-level comments saved, as well as each of their immediate child comments (but no further).\n\nLinked media files (images, videos etc.) will be saved locally where possible, though imgur is currently not well supported in all cases.\n\nIf you want to also break the resultant HTML file into multiple files (as browsers struggle to display enormous HTML files) you can add the `--page-size 100` argument (replacing 100 with whatever the posts-per page you want is).\n\n## Use with Docker\n\nRather than installing dependencies locally, you can use docker to create a local image and use that instead. First build the image:\n\n```bash\n$ docker build -t redditsave .\n```\n\nThen run reddit-save within a container created from this image:\n\n```bash\n$ docker run \\\n-e REDDIT_USERNAME=spez \\\n-e REDDIT_PASSWORD=\"myredditpassword123\" \\\n-e REDDIT_CLIENT_ID=\"sadsU7-zfX\" \\\n-e REDDIT_SECRET=\"687DDJSS\u0026999d-hdkjK8h\" \\\n-v /Local/location/to/save/in:/opt/app/archive \\\nredditsave saved\n```\n\n## Backing up a specific username\n\nRather than backing up your own saved/upvoted posts and comments, you can back up the submitted posts and comments of another user:\n\n```bash\n./save.py user:samirelanduk folder_name\n```\n\n## Backing up a specific username\n\nRather than backing up your own saved/upvoted posts and comments, you can back up the submitted posts and comments of another user:\n\n```bash\n./save.py user:samirelanduk folder_name\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamirelanduk%2Freddit-save","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamirelanduk%2Freddit-save","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamirelanduk%2Freddit-save/lists"}