mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 03:33:02 +00:00
[svt] Improve (closes #15809)
This commit is contained in:
parent
488ff2dd3a
commit
6cdaaf7031
1 changed files with 7 additions and 5 deletions
|
@ -137,7 +137,7 @@ class SVTPlayBaseIE(SVTBaseIE):
|
||||||
|
|
||||||
class SVTPlayIE(SVTPlayBaseIE):
|
class SVTPlayIE(SVTPlayBaseIE):
|
||||||
IE_DESC = 'SVT Play and Öppet arkiv'
|
IE_DESC = 'SVT Play and Öppet arkiv'
|
||||||
_VALID_URL = r'https?://(?:www\.)?(?:svtplay|oppetarkiv)\.se/(?:video|klipp|kanaler)/(?P<id>\w+)'
|
_VALID_URL = r'https?://(?:www\.)?(?:svtplay|oppetarkiv)\.se/(?:video|klipp|kanaler)/(?P<id>[^/?#&]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.svtplay.se/video/5996901/flygplan-till-haile-selassie/flygplan-till-haile-selassie-2',
|
'url': 'http://www.svtplay.se/video/5996901/flygplan-till-haile-selassie/flygplan-till-haile-selassie-2',
|
||||||
'md5': '2b6704fe4a28801e1a098bbf3c5ac611',
|
'md5': '2b6704fe4a28801e1a098bbf3c5ac611',
|
||||||
|
@ -179,6 +179,10 @@ def _real_extract(self, url):
|
||||||
|
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
|
||||||
|
def adjust_title(info):
|
||||||
|
if info['is_live']:
|
||||||
|
info['title'] = self._live_title(info['title'])
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
video_info = try_get(
|
video_info = try_get(
|
||||||
data, lambda x: x['context']['dispatcher']['stores']['VideoTitlePageStore']['data']['video'],
|
data, lambda x: x['context']['dispatcher']['stores']['VideoTitlePageStore']['data']['video'],
|
||||||
|
@ -189,8 +193,7 @@ def _real_extract(self, url):
|
||||||
'title': data['context']['dispatcher']['stores']['MetaStore']['title'],
|
'title': data['context']['dispatcher']['stores']['MetaStore']['title'],
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
})
|
})
|
||||||
if info_dict['is_live']:
|
adjust_title(info_dict)
|
||||||
info_dict['title'] = self._live_title(info_dict['title'])
|
|
||||||
return info_dict
|
return info_dict
|
||||||
|
|
||||||
video_id = self._search_regex(
|
video_id = self._search_regex(
|
||||||
|
@ -206,8 +209,7 @@ def _real_extract(self, url):
|
||||||
info_dict['title'] = re.sub(
|
info_dict['title'] = re.sub(
|
||||||
r'\s*\|\s*.+?$', '',
|
r'\s*\|\s*.+?$', '',
|
||||||
info_dict.get('episode') or self._og_search_title(webpage))
|
info_dict.get('episode') or self._og_search_title(webpage))
|
||||||
if info_dict['is_live']:
|
adjust_title(info_dict)
|
||||||
info_dict['title'] = self._live_title(info_dict['title'])
|
|
||||||
return info_dict
|
return info_dict
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue