yt-dlp appreciation thread

Try opening the kick stream first in firefox, then use --cookes-from-browser firefox option.
It's been a bit since I've tried it, but it let me download the age-gated streams that failed to download.
 
  • Like
Reactions: Fagnacious D
Does yt-dlp get the right audio version when there are multiple ones available? You Tube recently added a feature for content creators that would add an automatically translated voice over in lots of languages, and the viewer chose what they wanted to hear. I've been using JDownloader for years, but it just seems to pick one language at random and download that. Just about 100% of the time it gets it wrong, and the resulting download is unwatchable. And the developers don't seem to be keen to change that. I've had a look at the github page for yt-dlp, but I can't see anything mentioned.
 
Does yt-dlp get the right audio version when there are multiple ones available? You Tube recently added a feature for content creators that would add an automatically translated voice over in lots of languages, and the viewer chose what they wanted to hear. I've been using JDownloader for years, but it just seems to pick one language at random and download that. Just about 100% of the time it gets it wrong, and the resulting download is unwatchable. And the developers don't seem to be keen to change that. I've had a look at the github page for yt-dlp, but I can't see anything mentioned.
Do you have a random example video that has one of these voice tracks? I checked a few channels latest uploads but did not see something like this.
I ask because yt-dlp lets you pick which track to download (and if you want it to combine after downloading which could also prevent the ruining of the final output) so I guess you could deliberately pick one if you can figure out which one the correct/desireable track is.
 
Does yt-dlp get the right audio version when there are multiple ones available? You Tube recently added a feature for content creators that would add an automatically translated voice over in lots of languages, and the viewer chose what they wanted to hear. I've been using JDownloader for years, but it just seems to pick one language at random and download that. Just about 100% of the time it gets it wrong, and the resulting download is unwatchable. And the developers don't seem to be keen to change that. I've had a look at the github page for yt-dlp, but I can't see anything mentioned.
Here's one from Dave Jones' channel https://www.youtube.com/watch?v=vXeZVGMzExw
If you go there and look at the settings, you'll see there's a new one called Audio Track. It seems to be completely different from the Quality setting Using JDownloader I got a German audio track
Tried it on that video and it downloaded the original english audio track as expected. yt-dlp won't download alternative audio tracks by default unless you tell it to, regardless of language.
 
Here's one from Dave Jones' channel https://www.youtube.com/watch?v=vXeZVGMzExw
If you go there and look at the settings, you'll see there's a new one called Audio Track. It seems to be completely different from the Quality setting Using JDownloader I got a German audio track
Interesting, running that through yt-dlp with the -F (list formats) flag shows a shitload of those audio tracks. I guess the default may have been confused on your system locale, potentially a VPN or simply random YouTube kikery.
1733308659088.png

If you need to specify a particular audio track you can use the -f flag and specify an audio+video track to have them stitched together afterwards. I tested three of these and it works fine. The audio track is weird stilted AI voice lady but it worked for DE/ES/FR at least and stitched them together without issue.
 
I guess the default may have been confused on your system locale, potentially a VPN or simply random YouTube kikery.
It has nothing to do with that, it's because the German tracks are 233-0 and 234-0, i.e. the first ones in that particular bitrate/format. Which is why JDownloader mistakenly selected those instead of the English 233-5 or 234-5 like yt-dlp did.
 
  • Informative
Reactions: Pee Cola
I'm going to autistically praise yt-dlp again for being one of the greatest programs to ever grace this Earth.

If you have yt-dlp and ffmpeg installed on your machine, you can do this command

Code:
yt-dlp -f best --external-downloader ffmpeg --external-downloader-args "ffmpeg_i:-t 01:30:00" -o "clipped_video.mp4" (YouTube Link)

The "best" arg is downloading the best quality version of the video but you can download different qualities.

Code:
yt-dlp -f best -o "video.mp4" https://www.youtube.com/watch?v=PzK0NN-2NfU

The "-o" arg denotes the file name for your YouTube video instead of grabbing the original title

Code:
ffmpeg -i video.mp4 -t 01:30:00 -c copy clipped_video.mp4

As of writing this post, @Lady Rackets thong posted a GitHub where you can schedule archiving a YouTube live stream
(Archive)
 
Code:
yt-dlp --no-download --print "before_dl:%(id)s  # [Duration (H.M.S): %(duration>%H.%M.%S)s] %(title)s" --default-search "ytsearch10:" amazing videos""
Can be used as a minimalist way to view, search youtube videos. Change the :10 to 30 or 50 etc for more results.
It'll give you the ID to paste into yt-dlp -i.
 
I noticed last week that I'm no longer able to download videos with this. YouTube just sends a response telling me I need to log in. This seems to be for all videos, including ones I can just play in the browser without sign in. I tried with the browser cookie flag and with setting a User Agent string. No dice. I haven't tried actually logging in and using browser cookies but that fucks with some of what I want to do. I imagine something like seeing 70 automated downloads from my account will probably get that account suspended.

I hate the antichrist.
 
I haven't tried actually logging in and using browser cookies but that fucks with some of what I want to do.
The process is fairly straightforward, if a tad convoluted:
Open up an incognito tab
log into YT
open a second incognito tab
export cookies
close all incognito tabs
download the video with yt-dlp and include --pass-cookies /path/to/cookies/filename.txt in the command line
I imagine something like seeing 70 automated downloads from my account will probably get that account suspended.
That's what Google burner accounts are for.
I hate the antichrist.
Feels bad, man.
 
  • Like
Reactions: HalHalliday
I noticed last week that I'm no longer able to download videos with this. YouTube just sends a response telling me I need to log in. This seems to be for all videos, including ones I can just play in the browser without sign in. I tried with the browser cookie flag and with setting a User Agent string. No dice. I haven't tried actually logging in and using browser cookies but that fucks with some of what I want to do. I imagine something like seeing 70 automated downloads from my account will probably get that account suspended.

I hate the antichrist.
Always make sure you have the latest version. They just released a new one 3 days ago, and it's work for me at least.
 
In my dreams, someone makes a tool that auto copies all your uploaded videos, titles, etc. to a YouTube competitor like Rumble or Odyssey and vast swathes of content creators just click the button and migrate.

I don't know what degree of fuck-up Google would have to make in order to trigger such behaviour though. Until that glorious day, may yt-dlp ever keep me sane.
 
  • Feels
Reactions: Elwood P. Dowd
yt-dlp is a ticking time bomb. There is no way it will survive 2025. We're hanging on by a thread with only the "Youtube TV" endpoint not having advanced bot checks. They can essentially remove it any day and require a headless browser/whatever crazy setup to download videos, grim times...
 
I was figuring they'd do something to Chromium and then figure out how to get Firefox to work, as the last non-Chromium browser. Its worse than that?
It's not that bad, they have reasons to operate within the bounds of the W3C specs, like Safari and older browser support.
yt-dlp is written in Python and embeds a small Javascript subset interpreter for deciphering signatures, those were put in place as a first line of defense against scrapers. Now they're rolling out po_token which has not yet been reverse engineered, but can be generated by running some browser instance and extracting it from there. yt-dlp can't do this by itself and when it becomes necessary they need to rely on either manual extraction or some webdriver. I wouldn't be surprised if they give up at that point and kill the project.
 
I'm posting this here as per @Brabbit Narp's suggestion. It seems site-wide DRM for Youtube may be imminent.

"We are getting reports of YouTube rolling out an experiment to some accounts where normal videos only have DRM formats available on the tv (TVHTML5) Innertube client.

This is not limited to yt-dlp. Tests have been run with the same account on various official YouTube TV clients (PS3, web browser, apple tv) and they are also only getting DRM formats for videos.


Edit: I noticed this issue has received some attention and the technical YouTube jargon is confusing, so for clarity:

There appears to be an experiment (or A/B test) on some YouTube accounts where, when logged into YouTube on TV, are seeing every YouTube video protected by DRM.

YouTube on TV is the big picture interface/app used on TVs, game consoles, etc. You can access it at https://www.youtube.com/tv (with a TV/game console user agent).


This impacts yt-dlp as we currently request video data from YouTube as if we were YouTube on TV."
 
Back