Skip to content

A tool that creates videos out of reddit-hosted video posts, given a url to the post.

Notifications You must be signed in to change notification settings

NSEvent/video_generator_for_reddit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

video_generator_for_reddit

A tool that creates videos out of reddit-hosted video posts, given a url to the post.

Examples of generated videos

  1. ORIGINAL POST | VIDEO
  2. ORIGINAL POST | VIDEO
  3. ORIGINAL POST | VIDEO

About

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

To try yourself

  1. Create a new reddit app. Choose "script" as the type of app. Use http://localhost:8080 for the "redirect uri".
  2. Enter your reddit app information in test.py.
  3. Add a call to scrape_video(your_url_goes_here) in main.py.
  4. Install the required dependencies listed below.

Install required dependencies

sudo apt install ffmpeg

pip install praw
pip install nltk

python3
import nltk

nltk.download('punkt')
nltk.download('stopwords')
nltk.download('averaged_perceptron_tagger')

Run

python3 main.py

Finished videos are stored in <subreddit_name>/gif/

Author

Kevin Tang

About

A tool that creates videos out of reddit-hosted video posts, given a url to the post.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages