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.1k stars 9.92k forks source link

[YT music] Add support for /browse URL types #27731

Open someziggyman opened 3 years ago

someziggyman commented 3 years ago

Checklist

Description

So, I've tried to download this YT music playlist by this URL: https://music.youtube.com/browse/MPREb_ionshzGThBb And if fails with Error 404, though playable in browser. Log will be below.

If I use playlist link from the Share menu or try individual tracks everything works flawlessly. Playlist share url: https://music.youtube.com/playlist?list=OLAK5uy_kTszKQkux0dNJZUBM94ghp_1b1KE1Be3I Individual track: https://music.youtube.com/watch?v=5zZLsvbO1nI&list=OLAK5uy_kTszKQkux0dNJZUBM94ghp_1b1KE1Be3I

For "browse" URL type full log looks like this: youtube-dl -v -F https://music.youtube.com/browse/MPREb_ionshzGThBb [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u'-v', u'-F', u'https://music.youtube.com/browse/MPREb_ionshzGThBb'] [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2021.01.08 [debug] Python version 2.7.16 (CPython) - Darwin-20.2.0-x86_64-i386-64bit [debug] exe versions: none [debug] Proxy map: {} [youtube:tab] browse: Downloading webpage ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 632, in _request_webpage return self._downloader.urlopen(url_or_request) File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2248, in urlopen return self._opener.open(req, timeout=self._socket_timeout) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(args) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(args) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

adolson commented 3 years ago

I've noticed that the last few days, albums are opening up in "channel" links, using the same id as the "browse" links, but without the redirect. For example, here's the same album that @someziggyman used as an example, but with the newer[?] URL format:

https://music.youtube.com/channel/MPREb_ionshzGThBb

(Also, I am using ver. 2021-03-03).