Giter Site home page Giter Site logo

vids_downloader's Introduction

videosdownloader

Simple wrapper script around youtube-dl. All the new videos will be downloaded to the folder of your choice.

Installation

Clone this repo (ideally in a virtualenv), then install the dependencies :

pip install youtube-dl toml

If you're on a systemd-based system, and you would like to log to journald, also install systemd (kind of a pain to install, I installed it through my os package manager and then symlinked the virtualenv systemd to my system one)

Configuration

Edit the vids_directory in the toml config file, and add all the channels/playlists/whatever you want to subscribe to in the channels section. You might need to adjust the code a little bit depending on the websites you plan to use.

By default, it will create one cache file per channel, keeping the id of all the previously downloaded videos. Then it will download videos from the very first one of the channel. Unless that's what you want, you should create that cache file yourself and put the id of the first video :

  • go to the vids directory you configured
  • create .nameofchannel file, nameofchannel being the name you configured for one channel
  • put the id of the last video you watched (for a youtube video for instance, that would be the id right after the watch?v= Then it will start downloading from that video

Scheduling the script to run

Those instructions are for systemd-based systems.

Add a .service and a .timer file in ~/.config/systemd/user, examples :

vids.service file

[Unit]
Description=Download videos from the internet

[Service]
ExecStart=/path/to/virtualenv/python /path/to/vids.py
Type=oneshot

vids.timer file

[Unit]
Description=Schedule the videos downloader

[Timer]
# start 20 seconds after boot
OnStartupSec=20

[Install]
WantedBy=timers.target

Then run systemctl --user daemon-reload and you're done. To trigger it manually, run : systemctl --user start vids.service, otherwise it will run once after each boot.

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.