Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
6 tasks done
budowski opened this issue Apr 26, 2021 · 9 comments · May be fixed by #31003
Closed
6 tasks done

Comments

@budowski
Copy link

budowski commented Apr 26, 2021

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2021.04.26
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

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 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 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 gettingWARNING: Unable to look up account info: HTTP Error 400: Bad Request
@coletdjnz
Copy link
Contributor

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
Copy link
Author

  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
Copy link
Contributor

coletdjnz commented May 14, 2021 via email

@budowski
Copy link
Author

budowski commented May 14, 2021

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
Copy link
Contributor

coletdjnz commented May 14, 2021 via email

@axet
Copy link

axet commented Sep 3, 2021

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
Copy link
Author

budowski commented Sep 3, 2021

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

@axet
Copy link

axet commented Sep 3, 2021

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
Copy link
Author

budowski commented Sep 3, 2021

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants