Giter Club home page Giter Club logo

youtube-subscription-dl's Introduction

Youtube-subscription-dl

Use the youtube API to fetch your subscriptions automatically. Get an API key and then set the script as a cron job, no need to update lists of channels, just subscribe on youtube. Shows OS notifications when it finishes.


Requirements:

youtube-dl installed.

If on linux libnotify-bin for OS notifications.

Turn on the YouTube Data API (free, 10,000 queries/day)

  • Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.

  • On the Add credentials to your project page, click the Cancel button.

  • At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name if not already set, and click the Save button.

  • Select the Credentials tab, click the Create credentials button and select OAuth client ID.

  • Select the application type Other, enter the name "YouTube Data API Quickstart", and click the Create button.

  • Click OK to dismiss the resulting dialog.

  • Click the file_download (Download JSON) button to the right of the client ID.

  • Move the downloaded file to the root path of where you cloned this repo, and rename it client_secret.json.

Set up youtube-dl.conf

This will be your config file to set up where files are saved and what extras you download, you can set it up however you want with many options to pick from at the docs.

If you want to use the config provided in this repo

it will:

  • Automatically output to the /Downloads folder on your PC
  • put them into their own folders per channel
  • Remember previous downloads and skip them if they are reuploaded
  • Create .mkv files instead of the default (usually .webm)

mv ./youtube-dl.conf ~/.config/youtube-dl.conf will move it to the correct folder on macos/linux, on windows you will have to create a file %APPDATA%/youtube-dl/config.txt and put the options in there.


Running it for the first time

Run npm install --production to install dependencies

If on mac/linux, make the script executable sudo chmod +x ./yt-subs.sh

Then run the script with ./yt-subs.sh on mac/linux. On windows use git bash (or another bash emulator) to ./yt-subs.sh

When you run the command it will ask you to log in, you'll be authorizing yourself with the project you just made,when you're done just paste the code into the console. This only happens the first time.

The first time you run it, it will download your subscriptions from the past 24 hours.

Any times after that it will only download videos that have been uploaded since the last time it ran.

You can set it up as a cron job to be ran whenever you feel like it, and it will automatically keep track of the history and not repeat downloads.


Other info

  • If your internet connection disconnects or your change IP during a download, youtube-dl will crash after 30 seconds and retry the next 5 times the script runs.

  • If the channel has a livestream or premiere it will skip them, the video that is uploaded after will be downloaded as expected.

  • The config by default will download the best quality, but you can limit to your liking it with options like these

  • If a file is partially downloaded it will continue where it left off.

  • If the video was not found,or had some youtube error, the script will retry the download 5 times (once when you first run it, then again before the script ends, each time the script runs after that it will try again, until a total of 5)

  • If you delete a video it won't re-download it, even if you delete the history.json file (which will re-download the last 24 hours as you won't have a history of the last download time)

  • If you delete both the history.json file and the archive.txt file it will download videos from the past 24hours, but not override files still.

  • Everything runs on your machine, nothing is shared with anyone but google, you spin up the server using your API keys and authorize your own account to yourself.

youtube-subscription-dl's People

Contributors

spduk avatar dependabot[bot] avatar

Stargazers

 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.