0
votes

I would like to download an entire playlist from Youtube but I would also like it NOT to download specific videos from the playlist. I know the link and the name of those videos in advance and can therefore give that information to youtube-dl

So far the best solution I have is downloading the playlist and then running a shell script that removes the unwanted videos. This is obviously very limited ( the video is downloaded each time I try to download the new videos added to the playlist )

Is it possible to ask youtube-dl to ignore specific videos directly by command line or by file ( that would contain the names or urls of the unwanted videos ) ?

1
According to github.com/ytdl-org/youtube-dl/blob/master/README.md#options you can add filters. with ! clauses. I'm not sure if you can add multiple title filters though. - Raman Sailopal

1 Answers

1
votes

Yes.

  1. Put list of unwanted clips into file; unwanted.txt (one url per line)
  2. Get all urls from the playlist and save in a file
    youtube-dl -ij --flat-playlist "your_playlist" | jq -r '"https://youtu.be/\(.id)"' > listurl.txt
  1. Challenge thhose files to remove common occurrences
    grep -vf unwanted.txt listurl.txt > download.txt
  1. Download desirable vids witch a batch file
    youtube-dl -ia download.txt