GithubHelp home page GithubHelp logo

ksteensig / confettispaghetti Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 3.83 MB

Automatic generation of YouTube compilation videos from subreddits

License: GNU Affero General Public License v3.0

Python 100.00%
spam scraping python3

confettispaghetti's Introduction

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.

confettispaghetti's People

Contributors

luraman avatar ksteensig avatar

Stargazers

 avatar  avatar Théo Morales avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.