This is a tool to download submissions or submission data from Reddit. It can be used to archive data or even crawl Reddit to gather research data. The BDFR is flexible and can be used in scripts if needed through an extensive command-line interface. List of currently supported sources
If you wish to open an issue, please read the guide on opening issues to ensure that your issue is clear and contains everything it needs to for the developers to investigate.
Included in this README are a few example Bash tricks to get certain behaviour. For that, see Common Command Tricks.
Bulk Downloader for Reddit needs Python version 3.9 or above. Please update Python before installation to meet the requirement.
Then, you can install it via pip with:
python3 -m pip install bdfr --upgrade
or via pipx with:
python3 -m pipx install bdfr
To update BDFR, run the above command again for pip or pipx upgrade bdfr for pipx installations.
To check your version of BDFR, run bdfr --version
To install shell completions, run bdfr completions
If on Arch Linux or derivative operating systems such as Manjaro, the BDFR can be installed through the AUR.
If you want to use the source code or make contributions, refer to CONTRIBUTING
The BDFR works by taking submissions from a variety of "sources" from Reddit and then parsing them to download. These sources might be a subreddit, multireddit, a user list, or individual links. These sources are combined and downloaded to disk, according to a naming and organisational scheme defined by the user.
There are three modes to the BDFR: download, archive, and clone. Each one has a command that performs similar but distinct functions. The download command will download the resource linked in the Reddit submission, such as the images, video, etc. The archive command will download the submission data itself and store it, such as the submission details, upvotes, text, statistics, as and all the comments on that submission. These can then be saved in a data markup language form, such as JSON, XML, or YAML. Lastly, the clone command will perform both functions of the previous commands at once and is more efficient than running those commands sequentially.
Note that the clone command is not a true, failthful clone of Reddit. It simply retrieves much of the raw data that Reddit provides. To get a true clone of Reddit, another tool such as HTTrack should be used.
After installation, run the program from any directory as shown below:
bdfr download
bdfr archive
bdfr clone
However, these commands are not enough. You should chain parameters in Options according to your use case. Don't forget that some parameters can be provided multiple times. Some quick reference commands are:
bdfr download ./path/to/output --subreddit Python -L 10
bdfr download ./path/to/output --user reddituser --submitted -L 100
bdfr download ./path/to/output --user me --saved --authenticate -L 25 --file-scheme '{POSTID}'
bdfr download ./path/to/output --subreddit 'Python, all, mindustry' -L 10 --make-hard-links
bdfr archive ./path/to/output --user reddituser --submitted --all-comments --comment-context
bdfr archive ./path/to/output --subreddit all --format yaml -L 500 --folder-scheme ''
Alternatively, you can pass options through a YAML file.
bdfr download ./path/to/output --opts my_opts.yaml
For example, running it with the following file
skip: [mp4, avi]
file_scheme: "{UPVOTES}_{REDDITOR}_{POSTID}_{DATE}"
limit: 10
sort: top
subreddit:
- EarthPorn
- CityPorn
would be equilavent to (take note that in YAML there is file_scheme instead of file-scheme):
bdfr download ./path/to/output --skip mp4 --skip avi --file-scheme "{UPVOTES}_{REDDITOR}_{POSTID}_{DATE}" -L 10 -S top --subreddit EarthPorn --subreddit CityPorn
Any option that can be specified multiple times should be formatted like subreddit is above.
In case when the same option is specified both in the YAML file and in as a command line argument, the command line argument takes priority
The following options are common between both the archive and download commands of the BDFR.
directory--authenticate--config--opts--disable-module--filename-restriction-schemewindows, linux--ignore-user--include-id-file--log--saved--authenticate flag, as well as --user set to me--search--subreddit and --multireddit flags--submitted--user--upvoted--authenticate flag, as well as --user set to me-L, --limit--limit of 10 and three subreddits are provided, then 30 total submissions will be scraped-S, --sortcontroversialhot (default)newrelevance (only available when using --search)risingtop-l, --link-m, --multireddit-m multiple times-m 'chess, favourites'--user option-s, --subreddit-s multiple times-m 'all, python, mindustry'-t, --timeall (default)hourdayweekmonthyear--time-format{DATE} in file and folder naming schemes-u, --user--authenticate, --user me can be used to refer to the authenticated user-v, --verboseThe following options apply only to the download command. This command downloads the files and resources linked to in the submission, or a text submission itself, to the disk in the specified directory.
--make-hard-links--max-wait-time--no-dupes--search-existingdirectory--no-dupes is supplied or make hard links if --make-hard-links is supplied--file-scheme{REDDITOR}_{TITLE}_{POSTID}--folder-scheme{SUBREDDIT}--exclude-id--exclude-id-file--skip-domainexample.com or img.example.com--skip--skip-subreddit--min-score--max-score--min-score-ratio--max-score-ratioThe following options are for the archive command specifically.
--all-comments--user option, this will download all the user's comments-f, --formatjson (default)xmlyaml--comment-contextThe clone command can take all the options listed above for bot
$ claude mcp add bulk-downloader-for-reddit \
-- python -m otcore.mcp_server <graph>