Skip to content

tiktok reddit story automation , this still works even after the reddit api update

License

Notifications You must be signed in to change notification settings

davidliaos/AutoRedditStories

Repository files navigation

Auto Reddit Stories

This Python script allows you to create videos from top posts on a subreddit, using text-to-speech and a collection of videos in a directory. The resulting video will contain the text from the post, spoken by a virtual assistant, with a background video.

Requirements

You need to have Python 3.9+ installed on your system to run this project.

pip install -r requirements.txt

Usage

  1. Clone this repository to your local machine.
  2. Create a Reddit app on the Reddit website. This will give you a client_id and a client_secret.
  3. Go to TikTok and get your session ID from the applications tab.
  4. Fill in your info in the .env file.
  5. Run the project

This will create a video for each of the top posts on the subreddit, using a random video from the videos directory as a background.

How it works

The script uses the PRAW (Python Reddit API Wrapper) library to access Reddit's API and retrieve the top posts from a subreddit. For each post, it performs the following steps:

Use text-to-speech to convert the post's text into an MP3 file. Choose a random video from the videos directory and concatenate it with the MP3 file using the moviepy library. Save the resulting video as an MP4 file. Use Whisper Speech to Text to generate subtitles, not sure if we can use the prior script to make this more accurate.

Limitations

This is obviously exclusively for text posts.

The quality of the TTS is quite inconsistant, and occasionally varies in speed(?)

To-Do

  1. Limit size/length of finalized file, and split it up for TikTok
  2. Threading since transcription takes a while

Acknowledgements

About

tiktok reddit story automation , this still works even after the reddit api update

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages