ksteensig / ConfettiSpaghetti

Automatic generation of YouTube compilation videos from subreddits

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confetti Spaghetti

Thanks to www.bensound.com for the great generic music. Couldn't have done this without you Benjamin.

Usage (Debian-based systems)

  1. Clone this repository
git clone https://github.com/ksteensig/confettispaghetti
  1. Install pip3, ImageMagick and FFmpeg
sudo apt-get install python3-pip imagemagick ffmpeg
  1. Install following Python3 packages
sudo pip3 install praw imgurpython gTTS moviepy
  1. Make a change to the file /etc/ImageMagick-6/policy.xml from this
<policymap>
  <policy domain="cache" name="shared-secret" value="passphrase"/>
  <policy domain="coder" rights="none" pattern="EPHEMERAL" />
  <policy domain="coder" rights="none" pattern="URL" />
  <policy domain="coder" rights="none" pattern="HTTPS" />
  <policy domain="coder" rights="none" pattern="MVG" />
  <policy domain="coder" rights="none" pattern="MSL" />
  <policy domain="coder" rights="none" pattern="TEXT" />
  <policy domain="coder" rights="none" pattern="SHOW" />
  <policy domain="coder" rights="none" pattern="WIN" />
  <policy domain="coder" rights="none" pattern="PLT" />
  <policy domain="path" rights="none" pattern="@*" />
</policymap>

To this

<policymap>
  <policy domain="cache" name="shared-secret" value="passphrase"/>
  <policy domain="coder" rights="none" pattern="EPHEMERAL" />
  <policy domain="coder" rights="none" pattern="URL" />
  <policy domain="coder" rights="none" pattern="HTTPS" />
  <policy domain="coder" rights="none" pattern="MVG" />
  <policy domain="coder" rights="none" pattern="MSL" />
  <policy domain="coder" rights="none" pattern="TEXT" />
  <policy domain="coder" rights="none" pattern="SHOW" />
  <policy domain="coder" rights="none" pattern="WIN" />
  <policy domain="coder" rights="none" pattern="PLT" />
  <!--policy domain="path" rights="none" pattern="@*" /-->
</policymap>
  1. Now copy keys.py.template to keys.py
cp keys.py.template keys.py
  1. Insert your reddit and imgur developer API credentials in the keys.py

  2. Run the program and enter the name of a subreddit which contains videos hosted by reddit or imgur

python3 main.py
  1. Be patient and wait for the video to finish, the video will be named output.mp4 and put into a folder named $(subreddit)/$(timestamp)

Configuring

In convert.py there is a function called convert. This function has two parameters for adjusting time limits, tduration is the maximum overall video length and mduration is the minimum length of the individual clips.

You shouldn't change the defaults in convert itself, but you can set the parameters from where it's called in main.py. This should ideally be set in a config file which might be added at some point.

About

Automatic generation of YouTube compilation videos from subreddits

License:GNU Affero General Public License v3.0


Languages

Language:Python 100.0%