Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download images and videos from any public subreddit without using Reddit's API #377

Open
coding-to-music opened this issue Mar 4, 2022 · 0 comments

Comments

@coding-to-music
Copy link
Owner

coding-to-music commented Mar 4, 2022

Subreddit Media Downloader

Download images and videos from any public subreddit without using Reddit's API

Made with ❤ by Nico

https://github.com/Psycoguana/SubredditMediaDownloader

https://github.com/coding-to-music/SubredditMediaDownloader

💬 About:

This script allows you to download directly linked images, videos and gifs from any public subreddit WITHOUT USING REDDIT'S API.

How is this achieved? By using the very powerful PushShift API. This is important for a number of reasons:

  • With Reddit's api, you have a limit of 1000 posts, pushshift is unlimited.
  • In my experience, pushshift is just faster.
  • You don't need a client id and secret, which is tedious to create and can be hard if it's your first time.
    • Actually...you don't need any authentication at all!

There is one caveat tho, some of PushShift shards (think of them as servers) are sometimes down,
so you might not get the whole data in those cases. However, you're probably getting more than with Reddit's api, so it's worth it 😁

✨ Features:

  • 🖼️ Download directly linked images and gifs from any public subreddit.
  • 🎞️ Download directly linked videos from any public subreddit.
  • 📅 Download files before and/or after a certain date.

🔧 Setup:

Install the dependencies:

python -m pip install -r requirements.txt

Fill in the config.ini file as needed. There you can set:

  • Subreddit you'll download your media from.
  • Destination folder.
  • Posts time frame (optional).

🖥️ Usage:

Simply run the file main.py and it will start downloading.

python ./main.py

00.jpg

📚 Dependencies:

  • PSAW: Pushshift.io API Wrapper.
  • tqdm: Progressbar.
  • aiohttp: Async http client/server framework.
  • aiofiles: File support for asyncio.

📃 License:

GNU General Public License v3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant