It’s wrapping a somewhat opinionated and mildly bizarre yt-dlp invocation, for each line of a file doing a mkdir/cd and then invoking yt-dlp.<p>—⁂—<p>From the “Features” section of the README:<p>> <i>• Organized Structure: Creates separate directories for each channel.</i><p>… depending on you mentioning that name in your playlists.txt file, so that if you were writing a script you’d just be doing a mkdir/cd yourself, trivial.<p>> <i>• Smart Sync: Skips files that have already been downloaded (--no-overwrites).</i><p>That’s not really what --no-overwrites does. The default of --no-force-overwrites is probably actually what you want: “do not overwrite the video, but overwrite related files”. You probably <i>do</i> want metadata files to be updated on subsequent runs.<p>> <i>• Clean Naming: Saves files as Playlist Title/Video Title.mp4 (no numeric prefixes).</i><p>This is an Opinion.<p>> <i>• Batch Processing: Reads multiple playlists from a playlists.txt file.</i><p>Meh, you’re invoking a script, putting the stuff in the script would be at least as easy.<p>—⁂—<p>From the script itself, going through the arguments passed to yt-dlp:<p><pre><code> --cookies "$COOKIES_FILE"
</code></pre>
My impression is that this is discouraged unless <i>necessary</i>. And if you need it, --cookies-from-browser will be more convenient.<p><pre><code> -f "bv*+ba/b"
</code></pre>
That’s equivalent to the default.<p><pre><code> --merge-output-format mp4
</code></pre>
This is an Opinion.<p><pre><code> --no-overwrites
</code></pre>
I’m not convinced this is desirable. Videos already won’t be overwritten by default, this just stops metadata from being updated on subsequent runs, though I’m not sure what things might be updated.<p><pre><code> -o "%(playlist_title)s/%(title)s.%(ext)s"
</code></pre>
This is an Opinion.<p>—⁂—<p>Instead of having a playlists.txt file containing `Channel Name|<a href="https://www.youtube.com/playlist?list=x" rel="nofollow">https://www.youtube.com/playlist?list=x</a>` and having a separate 73-line file download_playlists.sh, you might as well have just one download_playlists.sh file containing:<p><pre><code> dl() {
mkdir -p "$1"
pushd "$1"
yt-dlp -o "%(playlist_title)s/%(title)s.%(ext)s" "$2"
popd
}
dl 'Channel Name' 'https://www.youtube.com/playlist?list=x'
</code></pre>
By dint of its simplicity, easier to work with and tweak to your own requirements (such as dropping `--merge-output-format mp4` as I did here). Also more obvious how to invoke it just once. (Aside: use pushd/popd instead of `cd "$channel_name"` and `cd ..`, because then $channel_name containing a slash won’t bork it.)