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
131.18k stars 9.93k forks source link

Youtube Music Premium Account - cannot download, even using cookies (getting "Video unavailable") #28883

Closed budowski closed 3 years ago

budowski commented 3 years ago

Checklist

Verbose log

' ``` youtube-dl --verbose --cookies "cookies.txt" -F https://music.youtube.com/watch?v=tbGe4ekwNIs [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['--verbose', '--cookies', 'cookies.txt', '-F', 'https://music.youtube.com/watch?v=tbGe4ekwNIs'] [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2021.04.26 [debug] Python version 3.7.3 (CPython) - Darwin-19.6.0-x86_64-i386-64bit [debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1, rtmpdump 2.4 [debug] Proxy map: {} [youtube] tbGe4ekwNIs: Downloading webpage This video is not available ERROR: Video unavailable This video is not available Traceback (most recent call last): File "~/.pyenv/versions/3.7.3/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 806, in wrapper return func(self, *args, **kwargs) File "/~/.pyenv/versions/3.7.3/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 827, in __extract_info ie_result = ie.extract(url) File "/~/.pyenv/versions/3.7.3/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 534, in extract ie_result = self._real_extract(url) File "/~/.pyenv/versions/3.7.3/Python.framework/Versions/3.7/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1712, in _real_extract raise ExtractorError(reason, expected=True) youtube_dl.utils.ExtractorError: Video unavailable This video is not available ``` ## Description 1. Using `cookies.txt` file created by [this](https://addons.mozilla.org/en-US/firefox/addon/export-cookies-txt/?src=search) Firefox extension (included all domains, include youtube.com, music.youtube.com and accounts.google.com). 2. Youtube Music songs. 3. Works for "normal" / publicly available YT Music songs. 4. Does *not* work for YT Music songs only available to premium users. 5. Tried using username/password combo as well, didn't work. 6. Google account has 2FA turned on (update: Tried it again after turning off 2FA - did not work). 7. Note: The [song](https://music.youtube.com/watch?v=tbGe4ekwNIs) does work when played using a YT Music premium account (will not work for non-premium accounts). 8. Update: Also tried using `--netrc` config or `--username` and `--password` - didn't work, while getting`WARNING: Unable to look up account info: HTTP Error 400: Bad Request`
coletdjnz commented 3 years ago

Do you have any other examples of YTM "premium only" videos? That one gives me video unavailable in the browser even though I have premium.

Update: Also tried using --netrc config or --username and --password - didn't work, while gettingWARNING: Unable to look up account info: HTTP Error 400: Bad Request

these options don't work for youtube extractor afaik. Have to use cookies.

budowski commented 3 years ago
  1. Very odd, because that song still works for me in the browser.
  2. Here is an entire album that is premium only: https://music.youtube.com/browse/MPREb_OYSfQZ2Pm9g
  3. Regarding cookies only working for the youtube extractor - that's good to know, but it's weird that the --cookies option isn't working though.
coletdjnz commented 3 years ago

Interesting and slightly confusing.

That album doesn't work for me, however if I use a VPN to US it works. So that issue might be regional.

But on the VPN I can play the album & the earlier song both with no premium/account and when I'm on my premium account.

For you, if it was YTM & premium only (i.e. won't play on normal YT) then I would expect the erroneous behaviour you see as yt-dl requests everything as the normal yt web client. But the same behaviour happens if there is some regional block. :/

There was some discussion here with some people mentioning similar to what you are seeing https://www.reddit.com/r/YoutubeMusic/comments/kuzyun/free_vs_premium_and_unavailable_tracks/

Possibly could be regional block where they deny non-premium users or everyone in some places?

-------- Original Message -------- On 14 May 2021, 21:58, budowski wrote:

  • Very odd, because that song still works for me in the browser.
  • Here is an entire album that is premium only: https://music.youtube.com/browse/MPREb_OYSfQZ2Pm9g
  • Regarding cookies only working for the youtube extractor - that's good to know, but it's weird that the --cookies option isn't working though.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

budowski commented 3 years ago

Holy crap, I tried using youtube-dl with a US-based VPN and it worked!!! Thanks for the idea! :-D

(I'm currently outside the US, the track does work outside the US in the browser)

coletdjnz commented 3 years ago

Yay! Most likely a region block of some sort then. -------- Original Message -------- On 14 May 2021, 22:32, budowski wrote:

Holy crap, I tried using youtube-dl with a US-based VPN and it worked!!! Thanks for the idea! :-D

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

axet commented 3 years ago

I have same error with my library on music.youtube.com, I put all cookies and get "video unavailable" message. Just upload your audiobook to music.youtube.com and try to download it - fails!

budowski commented 3 years ago

@axet - did you try running your script with a VPN (US-based)? It worked for me

axet commented 3 years ago

Nope, my browser works fine, I expect youtube_dl works as well. This is a my uploads to music.youtube.com, I'm pretty sure it is not required a VPN (and I do not have one).

budowski commented 3 years ago

If I were you, I would check this with a VPN (assuming you're getting the same error as I did) - since it did work for me from the browser, but not from youtube-dl. Once I ran the script via the US-based VPN -> it worked!