4 ms·
I don't even visit the YouTube site that often anymore. I've set up a script to use youtube-dl to download new videos from channels I like on a daily basis.
by MrMember 7y ago
I don't even visit the YouTube site that often anymore. I've set up a script to use youtube-dl to download new videos from channels I like on a daily basis.
- daveidol 7y agoCan you share any more information or the source of your script? Sounds like a pretty cool idea.
- MrMember 7y agoIt's actually really simple! Here's an example: youtube-dl --dateafter now-7days --playlist-end 10 --download-archive '/path/to/folder/downloaded.txt' -o '/path/to/folder/%(title)s.%(ext)s' -- 'https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw' https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw' You can play around with the parameters to get the behavior you want (there are tons more than I don't use), I kept it pretty simple. In my case it checks the channel page for videos that are newer than 7 days (it runs daily but this gives me a buffer). If there are more than 10 videos newer than 7 days it only checks the first 10. It stores previously downloaded video information in downloaded.txt so it doesn't download duplicate videos, and outputs the video in the format videoName.ext. Then throw that into a shell script along with any other channels you want and set up a cron job to run it as often as you'd like. You'll also probably want to put 'youtube-dl -U' into a cron job to keep it up to date, YouTube frequently changes things that breaks functionality of youtube-dl.
- kiddico 7y agoI never thought to set up something like this, but it's a fantastic idea! Now... this may seem like a silly question: What does the '--' do before the channel url? I know '--' is normally used for parameters longer than one character, but that one is kinda just floating about haha.
- MrMember 7y agoLooks like a mistake on my part, I was probably playing around with another parameter and forgot to remove it completely. It runs fine with it there so I never noticed it but it isn't needed.
- deleted 7y ago[deleted]
- cyphar 7y agoPutting "--" as an argument means that future arguments starting with "-" will not be parsed as arguments (imagine trying to rm a file called "-rf" or grep for "-"). But it just so happens that it's not necessary in this case.
- kiddico 7y agoOhhhhh okay, that makes sense. Thanks!
- kiddico 7y agoYour comment inspired a quick and dirty implementation of this. It's on my github[1] if anyone wants to take a look. I don't use bash often, so if anyone sees better ways to do things I'm all ears. [1] https://github.com/kiddico/Fight_the_Man https://github.com/kiddico/Fight_the_Man
- appleflaxen 7y agothat's an excellent option, but make sure you aren't logged into your gmail on that same computer. Your script shouldn't access the cookies of the browser, but if somehow they are able to, they will disable your gmail account when they realize you are watching from the same IP with a headless script that can't watch ads.
- neighbour 7y agoCurious, why not just use invidio.us?
- mrmuagi 7y agoYoutube-dl saved my youtube experience, as I have many playlists that have actually gotten entries deleted somehow, and I had then no recourse into recovering my playlist (often the uploader or another youtube denizen just re-uploads it, but I lost all information about the video).