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 shorts URL causes "unable to recognize tab page" error #30269

Closed
6 tasks done
reticivis-net opened this issue Nov 24, 2021 · 13 comments · Fixed by #30577
Closed
6 tasks done

youtube shorts URL causes "unable to recognize tab page" error #30269

reticivis-net opened this issue Nov 24, 2021 · 13 comments · Fixed by #30577

Comments

@reticivis-net
Copy link

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2021.06.06
  • 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

PS C:\Users\minec\PycharmProjects\captionbot> youtube-dl -v https://youtube.com/shorts/4L2J27mJ3Dc
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://youtube.com/shorts/4L2J27mJ3Dc']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.8.3 (CPython) - Windows-10-10.0.22504-SP0
[debug] exe versions: ffmpeg 4.4-full_build-www.gyan.dev, ffprobe 4.4-full_build-www.gyan.dev
[debug] Proxy map: {}
[youtube:tab] shorts: 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; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag
 and include its complete output.
Traceback (most recent call last):
  File "c:\users\minec\.virtualenvs\captionbot-ffal0v-r\lib\site-packages\youtube_dl\YoutubeDL.py", line 815, in wrapper
    return func(self, *args, **kwargs)
  File "c:\users\minec\.virtualenvs\captionbot-ffal0v-r\lib\site-packages\youtube_dl\YoutubeDL.py", line 836, in __extract_info
    ie_result = ie.extract(url)
  File "c:\users\minec\.virtualenvs\captionbot-ffal0v-r\lib\site-packages\youtube_dl\extractor\common.py", line 534, in extract
    ie_result = self._real_extract(url)
  File "c:\users\minec\.virtualenvs\captionbot-ffal0v-r\lib\site-packages\youtube_dl\extractor\youtube.py", line 2844, in _real_extract
    raise ExtractorError('Unable to recognize tab page')
youtube_dl.utils.ExtractorError: Unable to recognize tab page; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-
dl with the --verbose flag and include its complete output.

Description

the "share" button on youtube shorts can generate a URL in the following format: https://youtube.com/shorts/[videoid]?feature=share. this causes the above error. reformatting the URL to the typical https://youtube.com/watch?v=[videoid] works fine.

@reticivis-net
Copy link
Author

i know there are workarounds but for a program called "youtube-dl" I feel like it should work for all youtube links

@reticivis-net
Copy link
Author

well then its a convenience i think it should have

@dirkf
Copy link
Contributor

dirkf commented Nov 24, 2021

i know there are workarounds but for a program called "youtube-dl" I feel like it should work for all youtube links

It doesn't seem unreasonable, but it's a simple change:

--- old/youtube-dl/youtube_dl/extractor/youtube.py
+++ new/youtube-dl/youtube_dl/extractor/youtube.py
@@ -415,6 +415,7 @@
                          (?:.*?\#/)?                                          # handle anchor (#/) redirect urls
                          (?:                                                  # the various things that can precede the ID:
                              (?:(?:v|embed|e)/(?!videoseries))                # v/ or embed/ or e/
+                             |shorts/
                              |(?:                                             # or the v= param in all its forms
                                  (?:(?:watch|movie)(?:_popup)?(?:\.php)?/?)?  # preceding watch(_popup|.php) or nothing (like /?v=xxxx)
                                  (?:\?|\#!?)                                  # the params delimiter ? or # or #!

@Arsh1219
Copy link

facing the same issue on my website savetube, any solution?

@reticivis-net
Copy link
Author

If you can parse out the ID of the video you can just pass that to YouTube-dl

The fork yt-dlp has this fixed if you don't feel like doing that and want some extra features

@dirkf
Copy link
Contributor

dirkf commented Nov 25, 2021

Or just apply the patch that was posted ...

@reticivis-net
Copy link
Author

Modifying libraries in use can be a pain and if managed by pip or similar changes can be overwritten. Yes they could make a pull and implement the change but that's a big hassle

@dirkf
Copy link
Contributor

dirkf commented Nov 25, 2021

The poster has a website, where applying a 1-line patch to free software should be the least problem. A production system with live updates from a package repository deserves any breakage that will occur.

As you suggest, anyone manually downloading would normally find it easier just to pass the ID instead.

Generally, a statement that package Y solves a problem with yt-dl isn't helpful, particularly when package Y is already well discussed in other issues, rather than, say, offering to maintain a new release.

@reticivis-net
Copy link
Author

Modifying libraries in use can be a pain and if managed by pip or similar changes can be overwritten. Yes they could make a pull and implement the change but that's a big hassle

This is one of the most selfish comments Ive read in a while. @dirkf and I have had our differences, but he took time out of his day to help you, while you just spit on his work. Shame on you.

I had no intention do to that. I was expecting their work to make it into the project via a pull. I wasn't specifically talking about this patch, I just thought that modifying libraries directly in general wasn't best practice. Wrongly so apparently, so I apologize.

@jxu
Copy link
Contributor

jxu commented Dec 1, 2021

Feel free to submit a PR, though this project is seemingly abandoned by @dstftw for the indefinite future.

@reticivis-net
Copy link
Author

Ah
yt-dlp has this fixed so I'll just use that
I'll leave this issue open if anyone else wants to PR or something

@dennisnez
Copy link

Thanks for the above tip, and the patch.

@distherapy

This comment was marked as outdated.

@ytdl-org ytdl-org locked as resolved and limited conversation to collaborators Jul 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants