woefe / ytcc

Command line tool to keep track of your favorite playlists on YouTube and many other places.
GNU General Public License v3.0
178 stars 20 forks source link

Filter a channels videos to download, include/exclude X #79

Closed pghpete closed 3 years ago

pghpete commented 3 years ago

There are many channels I subscribe to that include subtopics or video series that I am not interested in.

It would be very useful to be able to add a filter to a subscribed channel in order to "include only" or "exclude all" videos matching a particular filter.

A real world example: https://www.youtube.com/c/digikey/videos

Digikeys channel has a great series called Maker Update. I would love to be able to add this to ytcc but WITH a filter "Maker Update". Or lets say, exclude a batch of videos with "New Product" or "live" in their title.

Something that would be a partial step in that direction may be to filter/download videos by playlist. In the example above this wouldn't work because the Maker Update videos are not in a separate playlist. Additionally it would required the videos you are interested in be put into a playlist by the content creator regularly and/or consistently. (and this doesn't always happen) The ability to add a channel to ytcc but, limit it to a particular playlist would be extremely useful.

Thank you for such a handy program. I greatly appreciate it! If there is anything I can add to this (in terms of details etc) please let me know.

woefe commented 3 years ago

Which version of ytcc are you using? (ytcc --version)

Since version 2 you can subscribe to playlists. I think in the case you describe above there is a playlist maintained by the uploader. You can just do ytcc subscribe "Maker Update" https://longplaylisturl

In the other case that you describe you can probably build a small shell script. Since version 2 of ytcc is more unixy, you can use it in pipelines or use grep etc. Some subcommands of ytcc read IDs from stdin. For example, to play all videos by "Unknown Brain" from NoCopyrightSounds (the example from the README) you can do:

ytcc -o xsv list -w -u -p "NoCopyrightSounds" -a id,title | grep "Unknown Brain" | cut -d, -f1 | ytcc play
pghpete commented 3 years ago

Thank you for the great info! It looks like I'm on an older version 1.8.4. Currently my home media setup (on openmediavault) just launches this via cron and then stores the downloaded videos in a minidlna directoryon my network.

/usr/local/bin/ytcc -u && /usr/local/bin/ytcc -d -s $(date -d "-3 day" +%Y-%m-%d) -p $output_dir -g

Perhaps I can add individual lines for specific (non-playlist) subtopics I'm interested in. It's certainly do-able. Since this one-liner cron job is pretty simplistic it would be awesome if we could add an include only / exclude type filter to ytcc when we add a channel via ytcc -a

Thanks again for the awesome work on the existing ytcc. I really appreciate it. Do you have a way for folks to donate to you in order to thank you for your efforts?

I've been toying with the idea of writing a flask front end for this so some of my non-technical family members could use it without needing to use the command line. If I can get the time to work on it i will gladly share it.

woefe commented 3 years ago

I'm going to close this, because: