>>107919577 (me)To keep on the distractions, I'll detail how to download streams,videos and playlists efficiently for those who want them, because it sure isn't as easy as it seems.
First, install yt-dlp.
https://github.com/yt-dlp/yt-dlpPlace it in a dedicated folder. Create a "Download" folder inside.
Second, config
Create a config.txt file in "C:\Users\YOUR_NAME\AppData\Roaming\yt-dlp". Fill it up with :
# EJS scripts challenge solver
--remote-components ejs:github
# Max quality
# bv* : Best video, any format, ba : Best Audio, /b : any pre-merged best
-f bv*+ba/b
# Trusty container
--merge-output-format mkv
# Allow playlists
--yes-playlist
# Start with last (optionnal)
--playlist-reverse
# Downloads folder
-P Downloads
# Clean naming with date + index
-o "%(upload_date)s - %(title)s.%(ext)s"
# ffmpeg
# --ffmpeg-location "ffmpeg/bin"
# Continue even if a video dies midway
# --ignore-errors
# Pull browser cookies
--cookies-from-browser YOUR_BROWSER_NAME
# Manual + auto subtitles (YouTube)
--write-subs
--write-auto-subs
--sub-langs ja,en
--sub-format srt
--embed-subs
Third. ffmpeg
ffmpeg is a free utility to manipulate video streams. This is necessary to merge audios and videos that aren't shipped together by Youtube. Download and install at
https://www.ffmpeg.org. Make sure ffmpeg is correctly installed by running "ffmpeg --version" in the console. If you have no response, search in Windows "Environment Variables" => "Environment Variables..." => System Variables : look up the line "Path" => Edit => New => Enter the folder you installed/dumped the ffmpeg folder +"\ffmpeg\bin". (the actual ffmpeg.exe position)
Alternatively you can uncomment the line "--ffmpeg-location "ffmpeg/bin" from the config file and place it in a subfolder of ytp-dl. That's what I did.
Fourth. Cookies.
You can skip this if you don't intend to download members videos.
In your brower, install a cookie puller extension like "cookies.txt" for Firefox :
https://addons.mozilla.org/en-US/firefox/addon/cookies-txtAllow it for Private browsing. Start a new private page and connect to Youtube in it. Use the extension => "Current site" => "Download". Rename something easy and place in the same folder as yt-dlp.
This step is important if you intend to download a huge number of videos. Without it, the download breaks after a few hours because cookies are refreshed by Youtube's opened tabs.
Five. JS environment and puzzle solver.
This is a very important step now because Youtube is more and more anal against bots. If you use "ytp-dl -F URL" in this state, you'll most likely just have mp4 pre-merged videos. VP9 and Opus codecs are much lighter (about 10-25%) than the AV1 codec for a similar quality. Without this step you'll end up with heavy mp4 files.
Download and install Deno :
https://docs.deno.com/runtime/getting_started/installationMight be preinstalled in the lastest releases of ytp-dl. (Wasn't for me) Then, you need an external JS engine to unravel (shit, shouldn't have typed that word) the Youtube Javascript templates and scripts that serve the different video sources. The line "--remote-components ejs:github" in the config file should auto-install ejs.
See
https://github.com/yt-dlp/yt-dlp/wiki/EJS#step-2-install-ejs-challenge-solver-scriptsLastly, open a console, go in the yt-dlp folder (cd FOLDER_NAME), and paste :
> yt-dlp -P "Downloads/SUBFOLDER_NAME" --download-archive "Download/SUBFOLDER_NAME/Playlist_Downloads.txt" --cookies "COOKIES_FILE_NAME" PLAYLIST_URLPlaylist_Downloads.txt is for saving the download progress and start where it left off when you launch this command again.
With this setup, you can also download any video with just:
> yt-dlp VIDEO_URLI'm not enticing you to do anything potentially illegal, but Kanata's members videos are all in a playlist at :
https://www.youtube.com/playlist?list=UUMOZlDXzGoo7d44bwdNObFacg