[extractor/BiliIntl] Support uppercase lang in _VALID_URL

Seen in some rare cases
Authored by: coletdjnz
This commit is contained in:
coletdjnz 2022-09-10 10:06:48 +12:00
parent c26f9b991a
commit 0831d95c46
No known key found for this signature in database
GPG key ID: 91984263BB39894A

View file

@ -909,7 +909,7 @@ class BiliIntlBaseIE(InfoExtractor):
class BiliIntlIE(BiliIntlBaseIE): class BiliIntlIE(BiliIntlBaseIE):
_VALID_URL = r'https?://(?:www\.)?bili(?:bili\.tv|intl\.com)/(?:[a-z]{2}/)?(play/(?P<season_id>\d+)/(?P<ep_id>\d+)|video/(?P<aid>\d+))' _VALID_URL = r'https?://(?:www\.)?bili(?:bili\.tv|intl\.com)/(?:[a-zA-Z]{2}/)?(play/(?P<season_id>\d+)/(?P<ep_id>\d+)|video/(?P<aid>\d+))'
_TESTS = [{ _TESTS = [{
# Bstation page # Bstation page
'url': 'https://www.bilibili.tv/en/play/34613/341736', 'url': 'https://www.bilibili.tv/en/play/34613/341736',
@ -952,6 +952,10 @@ class BiliIntlIE(BiliIntlBaseIE):
# No language in URL # No language in URL
'url': 'https://www.bilibili.tv/video/2019955076', 'url': 'https://www.bilibili.tv/video/2019955076',
'only_matching': True, 'only_matching': True,
}, {
# Uppercase language in URL
'url': 'https://www.bilibili.tv/EN/video/2019955076',
'only_matching': True,
}] }]
def _real_extract(self, url): def _real_extract(self, url):
@ -975,7 +979,7 @@ class BiliIntlIE(BiliIntlBaseIE):
class BiliIntlSeriesIE(BiliIntlBaseIE): class BiliIntlSeriesIE(BiliIntlBaseIE):
_VALID_URL = r'https?://(?:www\.)?bili(?:bili\.tv|intl\.com)/(?:[a-z]{2}/)?play/(?P<id>\d+)/?(?:[?#]|$)' _VALID_URL = r'https?://(?:www\.)?bili(?:bili\.tv|intl\.com)/(?:[a-zA-Z]{2}/)?play/(?P<id>\d+)/?(?:[?#]|$)'
_TESTS = [{ _TESTS = [{
'url': 'https://www.bilibili.tv/en/play/34613', 'url': 'https://www.bilibili.tv/en/play/34613',
'playlist_mincount': 15, 'playlist_mincount': 15,
@ -993,6 +997,9 @@ class BiliIntlSeriesIE(BiliIntlBaseIE):
}, { }, {
'url': 'https://www.biliintl.com/en/play/34613', 'url': 'https://www.biliintl.com/en/play/34613',
'only_matching': True, 'only_matching': True,
}, {
'url': 'https://www.biliintl.com/EN/play/34613',
'only_matching': True,
}] }]
def _entries(self, series_id): def _entries(self, series_id):