mirror of https://github.com/yt-dlp/yt-dlp.git
[extractor/malltv] Fix video_id extraction (#4883)
Closes #4870 Authored by: HobbyistDev
This commit is contained in:
parent
9cc5aed990
commit
7e378287c4
|
@ -14,7 +14,7 @@ class MallTVIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:(?:www|sk)\.)?mall\.tv/(?:[^/]+/)*(?P<id>[^/?#&]+)'
|
_VALID_URL = r'https?://(?:(?:www|sk)\.)?mall\.tv/(?:[^/]+/)*(?P<id>[^/?#&]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.mall.tv/18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
|
'url': 'https://www.mall.tv/18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
|
||||||
'md5': '1c4a37f080e1f3023103a7b43458e518',
|
'md5': 'cd69ce29176f6533b65bff69ed9a5f2a',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 't0zzt0',
|
'id': 't0zzt0',
|
||||||
'display_id': '18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
|
'display_id': '18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
|
||||||
|
@ -25,6 +25,11 @@ class MallTVIE(InfoExtractor):
|
||||||
'timestamp': 1538870400,
|
'timestamp': 1538870400,
|
||||||
'upload_date': '20181007',
|
'upload_date': '20181007',
|
||||||
'view_count': int,
|
'view_count': int,
|
||||||
|
'comment_count': int,
|
||||||
|
'thumbnail': 'https://cdn.vpplayer.tech/agmipnzv/encode/vjsnigfq/thumbnails/retina.jpg',
|
||||||
|
'average_rating': 9.060869565217391,
|
||||||
|
'dislike_count': int,
|
||||||
|
'like_count': int,
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://www.mall.tv/kdo-to-plati/18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
|
'url': 'https://www.mall.tv/kdo-to-plati/18-miliard-pro-neziskovky-opravdu-jsou-sportovci-nebo-clovek-v-tisni-pijavice',
|
||||||
|
@ -32,6 +37,24 @@ class MallTVIE(InfoExtractor):
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://sk.mall.tv/gejmhaus/reklamacia-nehreje-vyrobnik-tepla-alebo-spekacka',
|
'url': 'https://sk.mall.tv/gejmhaus/reklamacia-nehreje-vyrobnik-tepla-alebo-spekacka',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': 'https://www.mall.tv/zivoty-slavnych/nadeje-vychodu-i-zapadu-jak-michail-gorbacov-zmenil-politickou-mapu-sveta-a-ziskal-za-to-nobelovu-cenu-miru',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'yx010y',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'dislike_count': int,
|
||||||
|
'description': 'md5:aee02bee5a8d072c6a8207b91d1905a9',
|
||||||
|
'thumbnail': 'https://cdn.vpplayer.tech/agmipnzv/encode/vjsnjdeu/thumbnails/retina.jpg',
|
||||||
|
'comment_count': int,
|
||||||
|
'display_id': 'md5:0ec2afa94d2e2b7091c019cef2a43a9b',
|
||||||
|
'like_count': int,
|
||||||
|
'duration': 752,
|
||||||
|
'timestamp': 1646956800,
|
||||||
|
'title': 'md5:fe79385daaf16d74c12c1ec4a26687af',
|
||||||
|
'view_count': int,
|
||||||
|
'upload_date': '20220311',
|
||||||
|
'average_rating': 9.685714285714285,
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -43,12 +66,12 @@ class MallTVIE(InfoExtractor):
|
||||||
video = self._parse_json(self._search_regex(
|
video = self._parse_json(self._search_regex(
|
||||||
r'videoObject\s*=\s*JSON\.parse\(JSON\.stringify\(({.+?})\)\);',
|
r'videoObject\s*=\s*JSON\.parse\(JSON\.stringify\(({.+?})\)\);',
|
||||||
webpage, 'video object'), display_id)
|
webpage, 'video object'), display_id)
|
||||||
video_source = video['VideoSource']
|
|
||||||
video_id = self._search_regex(
|
video_id = self._search_regex(
|
||||||
r'/([\da-z]+)/index\b', video_source, 'video id')
|
r'<input\s*id\s*=\s*player-id-name\s*[^>]+value\s*=\s*(\w+)', webpage, 'video id')
|
||||||
|
|
||||||
formats = self._extract_m3u8_formats(
|
formats = self._extract_m3u8_formats(
|
||||||
video_source + '.m3u8', video_id, 'mp4', 'm3u8_native')
|
video['VideoSource'], video_id, 'mp4', 'm3u8_native')
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
|
@ -69,7 +92,7 @@ class MallTVIE(InfoExtractor):
|
||||||
info = self._search_json_ld(webpage, video_id, default={})
|
info = self._search_json_ld(webpage, video_id, default={})
|
||||||
|
|
||||||
return merge_dicts({
|
return merge_dicts({
|
||||||
'id': video_id,
|
'id': str(video_id),
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
'title': video.get('Title'),
|
'title': video.get('Title'),
|
||||||
'description': clean_html(video.get('Description')),
|
'description': clean_html(video.get('Description')),
|
||||||
|
|
Loading…
Reference in New Issue