mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-18 03:08:31 +00:00
[ie/dlive] Fix extractor
This commit is contained in:
parent
3ae61e0f31
commit
7d98de4c0a
@ -8,17 +8,20 @@ class DLiveVODIE(InfoExtractor):
|
|||||||
IE_NAME = 'dlive:vod'
|
IE_NAME = 'dlive:vod'
|
||||||
_VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P<uploader_id>.+?)\+(?P<id>[^/?#&]+)'
|
_VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P<uploader_id>.+?)\+(?P<id>[^/?#&]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://dlive.tv/p/pdp+3mTzOl4WR',
|
'url': 'https://dlive.tv/p/planesfan+wDeWRZ8HR',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '3mTzOl4WR',
|
'id': 'wDeWRZ8HR',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Minecraft with james charles epic',
|
'title': 'Money\'s in, guys!',
|
||||||
'upload_date': '20190701',
|
'upload_date': '20250712',
|
||||||
'timestamp': 1562011015,
|
'timestamp': 1752354913,
|
||||||
'uploader_id': 'pdp',
|
'uploader_id': 'planesfan',
|
||||||
|
'description': '',
|
||||||
|
'thumbnail': 'https://images.prd.dlivecdn.com/thumbnail/34c9c404-5f67-11f0-a812-52ea47803baf',
|
||||||
|
'view_count': int,
|
||||||
},
|
},
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://dlive.tv/p/pdpreplay+D-RD-xSZg',
|
'url': 'https://dlive.tv/p/planesfan+wDeWRZ8HR',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@ -36,7 +39,7 @@ def _real_extract(self, url):
|
|||||||
thumbnailUrl
|
thumbnailUrl
|
||||||
viewCount
|
viewCount
|
||||||
}
|
}
|
||||||
}''' % (uploader_id, vod_id)}).encode())['data']['pastBroadcast'] # noqa: UP031
|
}''' % (uploader_id, vod_id)}).encode(), headers={'content-type': 'application/json'})['data']['pastBroadcast'] # noqa: UP031
|
||||||
title = broadcast['title']
|
title = broadcast['title']
|
||||||
formats = self._extract_m3u8_formats(
|
formats = self._extract_m3u8_formats(
|
||||||
broadcast['playbackUrl'], vod_id, 'mp4', 'm3u8_native')
|
broadcast['playbackUrl'], vod_id, 'mp4', 'm3u8_native')
|
||||||
@ -71,13 +74,20 @@ def _real_extract(self, url):
|
|||||||
}
|
}
|
||||||
username
|
username
|
||||||
}
|
}
|
||||||
}''' % display_name}).encode())['data']['userByDisplayName'] # noqa: UP031
|
}''' % display_name}).encode(), headers={'content-type': 'application/json'})['data']['userByDisplayName'] # noqa: UP031
|
||||||
livestream = user['livestream']
|
livestream = user['livestream']
|
||||||
title = livestream['title']
|
title = livestream['title']
|
||||||
username = user['username']
|
username = user['username']
|
||||||
formats = self._extract_m3u8_formats(
|
formats = self._extract_m3u8_formats(
|
||||||
f'https://live.prd.dlive.tv/hls/live/{username}.m3u8',
|
f'https://live.prd.dlive.tv/hls/live/{username}.m3u8',
|
||||||
display_name, 'mp4')
|
display_name, 'mp4')
|
||||||
|
|
||||||
|
for unsigned_format in formats:
|
||||||
|
signed_url = self._download_webpage(
|
||||||
|
'https://live.prd.dlive.tv/hls/sign/url', display_name,
|
||||||
|
data=json.dumps({'playlisturi': unsigned_format['url']}).encode())
|
||||||
|
unsigned_format['url'] = signed_url
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': display_name,
|
'id': display_name,
|
||||||
'title': title,
|
'title': title,
|
||||||
|
Loading…
Reference in New Issue
Block a user