Skip to content

An advanced command line script for generating a tiktok-style video with a large variety of different options to change the output.

License

Notifications You must be signed in to change notification settings

Thomasssb1/reddit-2-video

Repository files navigation

reddit-2-video

This is currently being rewritten, certain functionality may change

An advanced, but intuitive, command line script for generating a tiktok-style video with a large variety of different options to change the output.
View the wiki here for information on how to use reddit-2-video.

Setup

The easiest way to get started is to download one of the releases but is only compiled for Windows & MacOS (Sorry Linux users, for now you will have to compile yourself using dart compile exe reddit-2-video/bin).
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 ffmpeg or whisper_timestamped, you can run the following command in an elevated shell.

$ reddit-2-video install

This will install ffmpeg and whisper_timestamped that are 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.git

Activate the repo so it can be used throughout your system

$ dart pub global activate --source path reddit-2-video

Ensure that whenever you run the command, you add the --dev, -d flag to change the path to pwd.
You can now run reddit-2-video throughout your file system and rebuild whenever you change the source code.

Usage

Call the method in the command line like so

$ reddit-2-video --subreddit AmItheAsshole

You can add more args to customise the output to your liking as talked about below.

Commands

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 AmItheAsshole

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

Examples

Click to expand each of the examples.

Generate a video from an r/AskReddit post

The below command uses the --type comments option in order to compile the video using comments and post title.

$ reddit-2-video --subreddit AskReddit --type comments --count 10 --alternate=on,on,H0000FF

The --count option is used to tell reddit-2-video to only use posts that have a minimum of 10 comments.
Using the --alternate option is ideal when creating commands which involve multiple users interacting, for more info on how it works, check here

Generate a horror story from r/nosleep

The below command uses the --horror flag in order to change the pitch of the voice to better work for creepy stories.

$ reddit-2-video --subreddit nosleep --horror --post-confirmation

The command also uses the --post-confirmation flag so that you get to check each post before the video is generated.

Generate 5 videos from r/pettyrevenge posts

The below command uses the --repeat option in order to generate 5 videos from the subreddit specified.

$ reddit-2-video --subreddit pettyrevenge --repeat 5 --no-nsfw --youtube-short --censor

This command also sets the following flags --no-nsfw to allow nsfw content, --youtube-short to split each video into 1 minute segments for youtube short upload and --censor to change what is spoken based on the lexemes provided in defaults/lexicons/lexeme.xml.

Generate a video containing 3 jokes from r/dadjokes

The below command sets --type multi in order to generate a video using multiple posts in one - ignoring comments.

$ reddit-2-video --subreddit dadjokes --type multi --sort rising --framerate 75

This command also sets the sort option to rising and the framerate to 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/1850nn6/my_husband_is_cheating_on_me_with_our_best_friend/ --end-card <path-to-gif> -v

This 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 ). It also sets verbosity to true in order to see extra debugging information whilst generating the video.

Dependencies

Required for usage: ffmpeg, whisper_timestamped 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 dart

To install whisper_timestamped, you need to have ffmpeg and python installed. Check how to install here.
To build the exe, you will need to compile which requires dart 3.0.5. Run the following command whilst in the reddit-2-video folder.

$ dart compile exe bin/reddit-2-video.dart --output=bin/reddit-2-video
However, 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 compile exe bin/reddit-2-video.dart --output=bin/reddit-2-video.exe

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.

Help

Use the option --help or -h for more help and information.

About

An advanced command line script for generating a tiktok-style video with a large variety of different options to change the output.

Topics

Resources

License

Stars

Watchers

Forks

Languages