Simple Python script to download images and videos from public subreddits without using Reddit's API 😎

Overview

Subreddit Media Downloader

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

Made with by Nico

💬 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.

run_example

📚 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.

You might also like...
Download all games from a public Itch.io Game Jam

Itch Jam Downloader Downloads all games from a public Itch.io Game Jam. What you'll need: Python 3.8+ pip install -r requirements.txt For site mirrori

YoutubeDownloader - Download any public Playlist from Youtube

YoutubeDownloader Download any public Youtube Channel / Playlist Features Bulk d

FireDM is a python open source (Internet Download Manager) with multi-connections, high speed engine, it downloads general files and videos from youtube and tons of other streaming websites .
FireDM is a python open source (Internet Download Manager) with multi-connections, high speed engine, it downloads general files and videos from youtube and tons of other streaming websites .

python open source (Internet Download Manager) with multi-connections, high speed engine, based on python, LibCurl, and youtube_dl https://github.com/firedm/FireDM

Download videos and audio with a graphical interface in python

Youtube-Downloader Download videos and audio with a graphical interface in python Windows To run windows using Command Prompt python main.py linux To

Download Youtube videos in mp4 format in a fast, easy, convenient way made with Python!
Download Youtube videos in mp4 format in a fast, easy, convenient way made with Python!

yt_downloader Download Youtube videos in mp4 format in a fast, easy, convenient way made with Python! Required Modules pytube os time colorama Errors

A python program to download one or multiple videos from YouTube.

YouTube-Video-Downloader A python program to download one or multiple videos from YouTube. Quick Start guide First Clone The Project git clone https:/

Command-line program to download videos from YouTube.com and other video sites

youtube-dl - download videos from youtube.com or other video platforms

A CLI that searches and download Youtube videos in mp3 format.

A CLI that searches and download Youtube videos in mp3 format.

Download clips from youtube videos with a few clicks and a GUI!
Download clips from youtube videos with a few clicks and a GUI!

YouClip v2.0.0 Table Of Contents: What Is YouClip Installation Usage Stuff To Fix Changelog What Is YouClip? ! IMPORTANT: The source files are a total

Comments
  • 'utf-8' codec can't decode byte 0x89 in position 0 Error

    'utf-8' codec can't decode byte 0x89 in position 0 Error

    Hello, I am currently having an issue with the script. When I get to a set point, I get the following error:

    Traceback (most recent call last): File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 312, in asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete return future.result() File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 299, in main await downloader.run() File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 54, in run elements = await self.get_elements_info(submissions, total_submissions) File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 138, in get_elements_info link = await self.get_real_gif_link(sub.url) File "/home/mharris89/Programs/SubredditMediaDownloader/main.py", line 168, in get_real_gif_link data = data.decode('utf-8') UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

    The beginning of the byte file is b'\x89PNG\r\n\x1a (cutting out the rest). Using python 3.10

    opened by demib72 8
  • Download videos with audio

    Download videos with audio

    You have a great, fast script, but the videos have not sound. Video and Audio file in Reddit are 2 different files I want to download both and then will put them together with moviepy .

    Video file in Reddit looks like. DASH_720.mp4

    Audio for this file is DASH_audio.mp4

    with links:

    https://v.redd.it/txizu3xq030a1/DASH_720.mp4

    https://v.redd.it/txizu3xq030a1/DASH_audio.mp4

    I download with limits, if it possible to download not just from new posts, for example from hot posts. Thank you! You did a great job.

    opened by guram13 5
  • AttributeError: 'submission' object has no attribute 'url'

    AttributeError: 'submission' object has no attribute 'url'

    Exec time: 0.90 minutes. Traceback (most recent call last): File "/Users/coenraadvlietstra/Downloads/SubredditMediaDownloader-main/main.py", line 313, in asyncio.run(main()) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete return future.result() File "/Users/coenraadvlietstra/Downloads/SubredditMediaDownloader-main/main.py", line 300, in main await downloader.run() File "/Users/coenraadvlietstra/Downloads/SubredditMediaDownloader-main/main.py", line 54, in run elements = await self.get_elements_info(submissions, total_submissions) File "/Users/coenraadvlietstra/Downloads/SubredditMediaDownloader-main/main.py", line 135, in get_elements_info if re.search(r'.(jpg|gif|png)$', sub.url): AttributeError: 'submission' object has no attribute 'url'

    Solution:

    If statement at line 135: if hasattr(sub, 'url'):

    opened by coenvlietstra 1
Owner
Nico
Nico
Python software to download videos from Tiktok without rights

download-video-tiktok Python software to download videos from Tiktok without rights to install pip install requests Follow us telegram : https://t.me

muntazir halim 1 Oct 28, 2021
A Udemy downloader that can download DRM protected videos and non-DRM protected videos.

Udemy Downloader with DRM support NOTE This program is WIP, the code is provided as-is and i am not held resposible for any legal repercussions result

Puyodead1 468 Dec 29, 2022
A Telegram bot to download TikTok videos without any watermark.

TikTok Downloader Bot A Telegram bot to download TikTok videos without any watermark. Host on Heroku Youtube: Deployment Tutorial Demo: JayBee TikTok

Joy Biswas 184 Jan 4, 2023
A simple Python +3.x script to download videos from Facebook.

Facebook Video Downloader A simple Python +3.x script to download videos from Facebook posts

Kerolos Atef Saber 1 Dec 3, 2021
Download YouTube videos/music and images in MP4, JPG with this tool.

ABOUT THE TOOL Download YouTube videos, music and images in MP4, JPG with this tool, with an easy to understand interface. This tool works with both,

TrollSkull 5 Jan 2, 2023
Jocomol 16 Dec 12, 2022
Python script to download entire campaign images and navigation.

Squidle campaign downloader Python script to download entire campaign images and navigation. usage: squidle_campaign_downloader.py [-h] [--api-token A

Miquel Massot 2 Nov 17, 2021
DYA ( Ditch YouTube API ) is a package created to power the user with YouTube Data API functionality without any API Key

Ditch YouTubeAPI (BETA) DYA ( Ditch YouTube API ) is a package created to power the user with YouTube Data API functionality without any API Key Detai

Sougata Jana 23 Dec 22, 2022
Python script to download all images/webms of a 4chan thread

Python3 script to continuously download all images/webms of multiple 4chan thread simultaneously - without installation

Micha Fink 208 Jan 4, 2023
Download all games from a public Itch.io Game Jam

Itch Jam Downloader Downloads all games from a public Itch.io Game Jam. What you'll need: Python 3.8+ pip install -r requirements.txt For site mirrori

Dragoon Aethis 19 Dec 7, 2022