FloPinguin / Reddit-DL

Simple PHP script to download an entire Reddit subreddit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚠️ 2021 notice: It's completely idiotic to use PHP for this task, but as you can see it works lol


Reddit-DL

This is a simple PHP script to download an entire Reddit subreddit for archiving / data hoarding purposes. The script makes heavy use of Pushift.io (API). youtube-dl does the video downloads.

It's intended to be used on a windows machine and for rather small subreddits.

What is getting downloaded

  • Posts as JSON
  • Reddit media attached to posts (Images (i.redd.it), Videos (v.redd.it))
  • Comments as JSON

Usage / Installation

  1. Put the dl.php on your PHP-enabled webserver
  2. Edit the config variables in dl.php
  3. Open dl.php in a browser

Generated directory structure (Examples)

F:\reddit-dl\2019-09-30 db8evj
│   image.jpg
│   post.json

└──comments
        f1z4o5p.json
        f1z5830.json
        f1z9zdu.json
        f1zbonk.json
        f1zsw8u.json
        f218hsx.json
        f21xct1.json
        f286m6f.json

F:\reddit-dl\2019-09-30 dbbfoc
    post.json

F:\reddit-dl\2019-09-30 dbhw4z
│   post.json

└──comments
        f221fxt.json
        f236hxd.json
        f23dzkv.json
        f23hcz9.json
        f23om96.json
        f243auk.json
        f245zju.json

About

Simple PHP script to download an entire Reddit subreddit


Languages

Language:PHP 100.0%