ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
129.64k stars 9.77k forks source link

[YouTube Music] extractor for streaming music quality #28781

Open jefferson018200306 opened 3 years ago

jefferson018200306 commented 3 years ago

Checklist

Example URLs

Description

since it's hard to log into YouTube, I hope to just extract the audio quality of non registered users. it's equivalent to Free membership of YouTube Music. According to Google, there are four streaming qualities for free membership on YouTube Music. Hopefully you can extract those streaming quality and implement this issue. Thank you ☺️

Low Uses least data Upper bound of 48kbps AAC

Normal Default setting Upper bound of 128kbps AAC

High Uses extra data Upper bound of 256kbps AAC

Always High Maintains high quality even when connection is poor Bitrate: 256kbps AAC

dirkf commented 3 years ago

The current version offers (for your first link) these audio formats:

format code  extension  resolution note
249          webm       audio only tiny   53k , webm_dash container, opus @ 53k (48000Hz), 1.28MiB
250          webm       audio only tiny   71k , webm_dash container, opus @ 71k (48000Hz), 1.69MiB
140          m4a        audio only tiny  129k , m4a_dash container, mp4a.40.2@129k (44100Hz), 3.07MiB
251          webm       audio only tiny  139k , webm_dash container, opus @139k (48000Hz), 3.30MiB

You can use -x --audio-format aac to get whichever of these you select as .m4a.

If there should be higher quality versions, please register and post the result of youtube-dl -u username -p password -F with the first link (though not perhaps the actual password).

jefferson018200306 commented 3 years ago
[youtube] Downloading login page
[youtube] Looking up account info
WARNING: Unable to look up account info: HTTP Error 400: Bad Request
dirkf commented 3 years ago

So apparently yt-dl can't handle the Google login.

You may be able to work around that by logging in with your browser and passing the resulting cookies to yt-dl: see "How do I pass cookies to youtube-dl?" in the manual.

jefferson018200306 commented 3 years ago

Do you think this will work if I just export the cookie on my terminal? Example is

export "Cookie:COOKIE_STRING_EXTRACTED_FROM_BROWSER"

dirkf commented 3 years ago

What the manual says is to have the cookie(s) in a file of a certain format and pass that filename as the value of the --cookies parameter. Perhaps read that section again?

I doubt that your proposed command would be effective.

jefferson018200306 commented 3 years ago

Sorry I need to retrieve the cookie using F12 Developer tools of Chrome in Windows. unfortunately, there is no nearest public computer that I can use. Hopefully, the developers implement this to make it easier for us to retrieve cookies or create a new way to log in to YouTube.

craftingmod commented 3 years ago

2021-04-21_21-19-18_WindowsTerminal

In Korea, Youtube music only supports in premium user only so I can't test 🤔

dirkf commented 2 years ago

Apparently OP thinks there are higher bit-rate AAC versions that might be accessed, but no-one has managed to provide details of these. Maybe a YT expert would know.

dirkf commented 2 years ago

Here I read that the 4 quality levels are offered in YT Music Premium.