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
132k stars 10.01k forks source link

[Youtube] Search result URLs fail with Unable to recognize tab page #28912

Open someziggyman opened 3 years ago

someziggyman commented 3 years ago

Checklist

Description

I might be wrong, but search result links used to work fine, but now failing. Test link: https://www.youtube.com/results?search_query=gta

Log below: youtube-dl -v -F https://www.youtube.com/results?search_query=gta [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u'-v', u'-F', u'https://www.youtube.com/results?search_query=gta'] [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dl version 2021.04.26 [debug] Python version 2.7.16 (CPython) - Darwin-20.4.0-x86_64-i386-64bit [debug] exe versions: none [debug] Proxy map: {} [youtube:tab] results: Downloading webpage ERROR: Unable to recognize tab page; 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. Traceback (most recent call last): File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 806, in wrapper return func(self, *args, **kwargs) File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 827, in __extract_info ie_result = ie.extract(url) File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 534, in extract ie_result = self._real_extract(url) File "/usr/local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 2843, in _real_extract raise ExtractorError('Unable to recognize tab page') ExtractorError: Unable to recognize tab page; 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.

dirkf commented 3 years ago

As a work-around, use ytsearchall:gta instead of the problem URL (or if you want, say, just 42 of the 600+ videos in the search results, ytsearch42:gta).

The code that explicitly handled results URLs was commented out a few months ago, but if it has a replacement it doesn't seem to be working.

pukkandan commented 3 years ago

The code that explicitly handled results URLs was commented out a few months ago, but if it has a replacement it doesn't seem to be working.

I had made a PR with a replacement, but it was never merged. #27749. (changes will be needed in that PR due to recent changes in youtube)

dirkf commented 3 years ago

Well, Sergey said he was working on it. My small patch to the tab extractor failed with HTTP 400 fetching the continuation JSON, which was surprising since I assume that's working for existing URL formats handled by the tab extractor.