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.37k stars 9.95k forks source link

Add support for youtube music search #18200

Open BRFNGRNBWS opened 5 years ago

BRFNGRNBWS commented 5 years ago

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.11.07. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

Before submitting an issue make sure you have:

What is the purpose of your issue?


[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://music.youtube.com/search?q=rick+astley+never+gonna+give+you+up']
[debug] Encodings: locale cp1252, fs mbcs, out cp1252, pref cp1252
[debug] youtube-dl version 2018.11.07
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17134
[debug] exe versions: none
[debug] Proxy map: {}
[youtube:user] search: Downloading channel page
WARNING: Unable to download webpage: HTTP Error 404: Not Found
[youtube:user] search: Downloading page #1
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 "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpj6iiia1g\build\youtube_dl\extractor\common.py", line 605, in _request_webpage
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpj6iiia1g\build\youtube_dl\YoutubeDL.py", line 2211, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 470, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response
  File "C:\Python\Python34\lib\urllib\request.py", line 508, in error
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default

...
<end of log>

I find that youtube music search results are generally more consistent in finding actual songs (as opposed to things like music videos, lyric videos, etc.), so I'd like it if there were support for downloading the first result from a music.youtube.com search, in the form of something like a ytmsearch1: or support for a search url (ex. https://music.youtube.com/search?q=rick+astley+never+gonna+give+you+up, the command line for that is above)

KharmaScribbles commented 5 years ago

Not sure if you're aware, and also FYI for anyone wanting to take the issue, but a music.youtube URL is the same as a youtube URL, just with the "music." added/removed..

For instance, when I create a batch file from searching on music.youtube.com or the YT Music app, I find the link for the video, which is for example "https://music.youtube.com/watch?v=V1Pl8CzNzCw" .. then the URL I need to get youtube-dl to download is "https://youtube.com/watch?v=V1Pl8CzNzCw" or simply "V1Pl8CzNzCw"