mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-24 21:56:53 +01:00
[nowness] fix _VALID_URL regex
This commit is contained in:
parent
c23c3d7d7d
commit
75b399f455
@ -33,7 +33,7 @@ def extract_url_result(self, post):
|
|||||||
|
|
||||||
class NownessIE(NownessBaseIE):
|
class NownessIE(NownessBaseIE):
|
||||||
IE_NAME = 'nowness'
|
IE_NAME = 'nowness'
|
||||||
_VALID_URL = r'https?://(?:(?:www|cn)\.)?nowness\.com/(story|series/[^/])/(?P<id>[0-9a-z-]+)'
|
_VALID_URL = r'https?://(?:(?:www|cn)\.)?nowness\.com/(story|series/[^/]+)/(?P<id>[0-9a-z-]+)'
|
||||||
_TESTS = [
|
_TESTS = [
|
||||||
{
|
{
|
||||||
'url': 'https://www.nowness.com/story/candor-the-art-of-gesticulation',
|
'url': 'https://www.nowness.com/story/candor-the-art-of-gesticulation',
|
||||||
@ -112,7 +112,7 @@ def _real_extract(self, url):
|
|||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
|
|
||||||
lang = 'zh-cn' if 'cn.nowness.com' in url else 'en-us'
|
lang = 'zh-cn' if 'cn.nowness.com' in url else 'en-us'
|
||||||
request = compat_urllib_request.Request('https://api.nowness.com/api/series/getBySlug/%s' % display_id, headers={
|
request = compat_urllib_request.Request('http://api.nowness.com/api/series/getBySlug/%s' % display_id, headers={
|
||||||
'X-Nowness-Language': lang,
|
'X-Nowness-Language': lang,
|
||||||
})
|
})
|
||||||
serie = self._download_json(request, display_id)
|
serie = self._download_json(request, display_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user