Cleanup YoutubeTabIE _VALID_URL regex

This commit is contained in:
pukkandan 2020-11-23 01:55:14 +05:30
parent 386e1dd908
commit 434406a982

View file

@ -64,7 +64,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
_TFA_URL = 'https://accounts.google.com/_/signin/challenge?hl=en&TL={0}' _TFA_URL = 'https://accounts.google.com/_/signin/challenge?hl=en&TL={0}'
_RESERVED_NAMES = ( _RESERVED_NAMES = (
r'course|embed|watch|w|results|storefront|' r'course|embed|playlist|watch|w|results|storefront|'
r'shared|index|account|reporthistory|t/terms|about|upload|signin|logout|' r'shared|index|account|reporthistory|t/terms|about|upload|signin|logout|'
r'feed/(watch_later|history|subscriptions|library|trending|recommended)') r'feed/(watch_later|history|subscriptions|library|trending|recommended)')
@ -2532,12 +2532,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
class YoutubeTabIE(YoutubeBaseInfoExtractor): class YoutubeTabIE(YoutubeBaseInfoExtractor):
IE_DESC = 'YouTube.com tab' IE_DESC = 'YouTube.com tab'
_VALID_URL = ( _VALID_URL = (r'''(?x)
r'https?://(?:\w+\.)?(?:youtube(?:kids)?\.com|invidio\.us)/' https?://(?:\w+\.)?(?:youtube(?:kids)?\.com|invidio\.us)/(?:
r'(?:(?!(%s)([/#?]|$))|' (?!(%s)([/#?]|$))|channel/|c/|user/|
r'(?:channel|c|user)/|' (?P<not_channel>playlist|watch)/?\?.*?\blist=)
r'(?:playlist|watch)\?.*?\blist=)' (?P<id>[^/?#&]+)''') % YoutubeBaseInfoExtractor._RESERVED_NAMES
r'(?P<id>[^/?#&]+)') % YoutubeBaseInfoExtractor._RESERVED_NAMES
IE_NAME = 'youtube:tab' IE_NAME = 'youtube:tab'
_TESTS = [{ _TESTS = [{