mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-05 10:42:37 +01:00
[dvtv] Simplify (closes #15442)
This commit is contained in:
parent
6f4ad0db34
commit
8c5fafe29f
@ -104,8 +104,8 @@ class DVTVIE(InfoExtractor):
|
|||||||
def _parse_video_metadata(self, js, video_id, live_js=None):
|
def _parse_video_metadata(self, js, video_id, live_js=None):
|
||||||
data = self._parse_json(js, video_id, transform_source=js_to_json)
|
data = self._parse_json(js, video_id, transform_source=js_to_json)
|
||||||
if live_js:
|
if live_js:
|
||||||
data.update(
|
data.update(self._parse_json(
|
||||||
self._parse_json(live_js, video_id, transform_source=js_to_json))
|
live_js, video_id, transform_source=js_to_json))
|
||||||
|
|
||||||
title = unescapeHTML(data['title'])
|
title = unescapeHTML(data['title'])
|
||||||
|
|
||||||
@ -156,12 +156,12 @@ def _real_extract(self, url):
|
|||||||
# live content
|
# live content
|
||||||
live_item = self._search_regex(
|
live_item = self._search_regex(
|
||||||
r'(?s)embedData[0-9a-f]{32}\.asset\.liveStarter\s*=\s*(\{.+?\});',
|
r'(?s)embedData[0-9a-f]{32}\.asset\.liveStarter\s*=\s*(\{.+?\});',
|
||||||
webpage, 'video', default=None, fatal=False)
|
webpage, 'video', default=None)
|
||||||
|
|
||||||
# single video
|
# single video
|
||||||
item = self._search_regex(
|
item = self._search_regex(
|
||||||
r'(?s)embedData[0-9a-f]{32}\[["\']asset["\']\]\s*=\s*(\{.+?\});',
|
r'(?s)embedData[0-9a-f]{32}\[["\']asset["\']\]\s*=\s*(\{.+?\});',
|
||||||
webpage, 'video', default=None, fatal=False)
|
webpage, 'video', default=None)
|
||||||
|
|
||||||
if item:
|
if item:
|
||||||
return self._parse_video_metadata(item, video_id, live_item)
|
return self._parse_video_metadata(item, video_id, live_item)
|
||||||
|
Loading…
Reference in New Issue
Block a user