0

Following these steps has gotten me almost all the way:

  • I can get a text file of YouTube URLs from a YouTube playlist by using this https://thetubelab.com/get-all-urls-of-youtube-playlist-channel/ site.
  • I can encode the raw url list into a .xspf file with a Notepad++ macro to wrap each url with <track><location>http://[insert url]<location></track>, along with some easy additional XML data manually inserted.
  • I am able to play this .xspf file in VLC, but there are no previews, nor filters for broken URLs.
  • I can manually play each video in the list, which will load the preview data. I can then save the updated (and now-verbose) playlist to a new file.

Problem is, that last step will take an enormous amount of time, and I don't know of a way to automate it quickly. Is there an easy way to do this without writing a custom VLC lua script or something?

Update: I found this site, which allows for extracting song titles along with the urls. I'm still working out how to get them into the playlist format, though.

2
  • Does it have to be XSPF? Or can it be e.g. M3U?
    – Destroy666
    Commented Jan 29 at 3:27
  • It shouldn't matter what playlist file format. I just used XSPF because it was easier to macro process the URLs for.
    – hamstar
    Commented Jan 29 at 8:41

1 Answer 1

0

Here's an idea for you - use yt-dlp in a way or another.

For example, this command:

yt-dlp https://www.youtube.com/playlist?list=PLpeFO20OwBF4q8wyEukQxs5h_ktfIvpcG --skip-download --no-warning --print "#EXTIMG:%(thumbnail)s" --print webpage_url

will output all the YT video thumbnail URLs followed by new line and video URLs. It'll skip unavailable/inaccessible videos.

Then you could rework that to print into e.g. extended M3U format instead. First, print the header to a new file:

echo #EXTM3U > playlist.m3u

Afterwards use similar appending redirection (>>) in the yt-dlp command mentioned above.

Few notes:

  • extended M3U is not widely supported, although many modern players at least partially support it
  • #EXTIMG with URL might not be an available option in various players on top of that
  • different formats of thumbnails might also not work, e.g. you can get default .webp thumbnail using the above command. You could try to further work around that by requesting a more specific format like .jpg from printable thumbnails_table property. Or you could go for JSON processing with --flat-playlist and --dump-single-json options instead, but that will require another program, like jq.
  • the command may have unintended results with hidden/deleted videos
1
  • VLC allows saving playlists in different formats, so I'm not worried about m3u.
    – hamstar
    Commented Feb 17 at 0:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .