A tool that creates videos out of reddit-hosted video posts, given a url to the post.
This program scrapes post information using PRAW.
The program performs its video manipulation using ffmpy
- downloads a video from a reddit-hosted video post
- normalizes the video dimensions to 1920x1080
- overlays top reddit comments scrolling up the left sidebar
- overlays a gif on the bottom right corner
The video dimensions are normalized to 1920x1080 to be easily combined to create a compilation later.
Top tags for each video are drawn from top comments. nltk is used to select 1-word, 2-word-phrase, and 3-word-phrase tags to represent a post. This feature works best if the post has a large number of comments.
Tested with Python 3.7.0 in Linux environment
- Create a new reddit app. Choose "script" as the type of app. Use
http://localhost:8080
for the "redirect uri". - Enter your reddit app information in test.py.
- Add a call to
scrape_video(your_url_goes_here)
in main.py. - Install the required dependencies listed below.
sudo apt install ffmpeg
pip install praw
pip install nltk
python3
import nltk
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('averaged_perceptron_tagger')
python3 main.py
Finished videos are stored in <subreddit_name>/gif/
Kevin Tang