-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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 link regex fails for youtu.be links. #55
Comments
An annotated version of the above, which is not as verbose as it could be, but attempts some explanation of parts: |
Fixed. Thanks. |
…ta-fix [youtube] fix: extract artist metadata from ytInitialData (ytdl-org#49)
Given the example link "http://youtu.be/watch?v=COiIC3A0ROM"
and the _VALID_URL regex present in the Jan 7 checkout, the groups() results are as follows:
('http://youtu.be/', 'watch')
The fix for the regex is a parenthesis that is placed too late. There should be an extra one after the ".com/" part, closing the optional matching group for youtu.be | \w+.youtube.com.
The regular expression that "works for me" is as follows:
_VALID_URL = r'^((?:https?://)?(?:youtu.be/|(?:\w+.)?youtube(?:-nocookie)?.com/)(?:(?:v/)|(?:(?:watch(?:popup)?(?:.php)?)?(?:?|#!?)(?:.+&)?v=)))?([0-9A-Za-z-]+)(?(1).+)?$'
The text was updated successfully, but these errors were encountered: