A highly customisable command line script for generating a tiktok-style video offering granular controls over output settings.
View the docs here for information on how to use reddit-2-video.
The easiest way to get started is to download one of the releases. Release bundles are built for Windows, macOS, and Linux, and ship as a reddit-2-video/ folder containing bin/reddit-2-video(.exe), defaults/, and .temp/.
Something going wrong? You may need to compile yourself.
Add the folder to path
This is different across each operating system. This gist shows the different methods to add a folder to path - follow the steps but use the folder reddit-2-video/bin that you cloned. You need to add the full path to reddit-2-video/bin to your system path in environmental variables.
Install dependencies
If you do not have the required runtime tools installed, you can run the following command in an elevated shell.
$ reddit-2-video installThis will help you check the core runtime dependencies required to run reddit-2-video. If this does not work, you can install these prerequisites manually.
For developer builds
Run the following command in your terminal in order to rebuild the executable each time something is changed whilst developing an update. You do not need to add the reddit-2-video/bin folder to path like normal.
Clone the repository
$ git clone https://github.com/Thomasssb1/reddit-2-video.gitActivate the repo so it can be used throughout your system
$ dart pub global activate --source path reddit-2-videoYou can now run reddit-2-video throughout your file system and rebuild whenever you change the source code.
Contributing?Add the following filter to ignore checked in file changes touched by the program unless necessary:
$ git config filter.cleanJsonState.clean "jq '(if has(\"_last_updated\") then ._last_updated=null else . end) | (if has(\"visited\") then .visited=[] else . end)'" $ git config filter.cleanJsonState.smudge cat $ git config filter.cleanJsonState.required true $ git add --renormalize .temp/visited_log.json defaults/lexicons/lexemes.config.json
Call the method in the command line like so
$ reddit-2-video --subreddit AmItheAssholeYou can add more args to customise the output to your liking as talked about below.
To use this, you need to use the command reddit-2-video along with arguments to generate a video.
The only required argument is subreddit.
There are many other options which can be used in your command. You can get started by using this command (note that letter case does not matter):
reddit-2-video --subreddit AmItheAssholeThe above command will fetch videos from the AmItheAsshole subreddit and compile them into a video using all default options set by reddit-2-video. I would recommend looking at the wiki in order to customise to your needs.
You can also use the -help flag to view all visible options.
Click to expand each of the examples.
Generate a video from an r/AskReddit post
The below command uses the
--type commentsoption in order to compile the video using comments and post title.$ reddit-2-video --subreddit AskReddit --type comments --count 10 --alternate=on,on --title-color H0000FF --output example-1The
--countoption is used to tell reddit-2-video to only use posts that have a minimum of 10 comments.
Using the--alternateoption is ideal when creating videos which involve multiple users interacting, for more info on how it works check the docs.
Generate a horror story from r/nosleep
The below command uses the
--horrorflag in order to change the pitch of the voice to better work for creepy stories.$ reddit-2-video --subreddit nosleep --horror --post-confirmation --music <path-to-music> --youtube-short --output example-2.mp4The command also uses the
--post-confirmationflag so that you get to check each post before the video is generated. The--musicoption is used to add an eerie background ambience,--youtube-shortto split each video into 1 minute segments for youtube short upload.
Generate 5 videos from r/pettyrevenge posts
The below command uses the
--repeatoption in order to generate 5 videos from the subreddit specified.$ reddit-2-video --subreddit pettyrevenge --repeat 3 --no-nsfw --censor --sort top --output example-3This command also sets the following flags
--no-nsfwto allow nsfw content and--censorto change what is spoken based on the lexemes provided indefaults/lexicons/lexeme.xml. The--sortflag will pull posts from r/pettyrevenge in top-sorted order.
Generate a video containing 3 jokes from r/dadjokes
The below command sets
--type multiin order to generate a video using multiple posts in one - ignoring comments.$ reddit-2-video --subreddit dadjokes --type multi --count 3 --sort rising --framerate 75 --output example-4.mp4This command also sets the
sortoption to rising and theframerateto 75.
Generate a video from a reddit post url
The below command passes a link instead of a subreddit in order to generate a video for a specific post.
$ reddit-2-video --subreddit https://www.reddit.com/r/TrueOffMyChest/comments/t26b1s/i_found_out_that_my_boyfriend_of_2_years_is/ --end-card <path-to-gif> -v --output example-5This command also adds an end card to the end of the video by using the gif passed to it (in this case it is the placeholder <path-to-gif>). It also sets verbosity to true in order to see extra debugging information whilst generating the video.
Required for usage: ffmpeg, yt-dlp, AWS CLI
If you are using a system which supports apt-get, you can run the following command to install ffmpeg and dart.
You only need to install dart if you are compiling yourself - as explained below.
$ apt-get install ffmpeg dartTo build the packaged release folder, you will need dart >= 3.0.5. Run the following command whilst in the reddit-2-video folder.
$ dart run tool/build_release.dart --output-root build/reddit-2-videoHowever, if you are using windows you need to add the .exe file extension for it to work
Run the below command if you are on windows
$ dart run tool/build_release.dart --output-root build/reddit-2-video --executable-name reddit-2-video.exe
The build script refuses unsafe output roots such as . or the repository root. Use a dedicated directory such as build/reddit-2-video.
This creates the same structure used by release builds: reddit-2-video/bin/reddit-2-video(.exe), reddit-2-video/defaults/, and reddit-2-video/.temp/visited_log.json.
You will also need AWS CLI setup if you plan on using AWS-Polly to generate TTS, which currently is the only option for TTS generation.
Use the option --help or -h for more help and information.