Author wanted yt-dlp to be fed with a custom text file: "playlists.txt"
The script loops through that text file, parses it, and then launches yt-dlp for each valid line with a channel name.
yt-dlp -o "%(channel)s/%(playlist_title)s/%(title)s.%(ext)s" -a playlists.txt
I'm not sure if that warrants a HN postalias yt-pl='yt-dlp -o "%(channel)s/%(playlist_title)s/%(title)s.%(ext)s" -a playlists.txt'
https://github.com/yt-dlp/yt-dlp#:~:text=channel%20%28string...
https://github.com/yt-dlp/yt-dlp#:~:text=%2Da%2C%20%2D%2Dbat...
https://github.com/yt-dlp/yt-dlp#:~:text=%2D%2Ddownload%2Dar...
Not to mention that the script is clearly LLM-generated
Gemini nails it:
When downloading multiple playlists, it is usually better to organize them into separate folders so the files don't all end up in one giant mess. You can use an output template to automatically create folders based on the playlist title:
yt-dlp -a playlists.txt -o "%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s"