|
|
|
@ -8,17 +8,20 @@ class DLiveVODIE(InfoExtractor):
|
|
|
|
|
IE_NAME = 'dlive:vod'
|
|
|
|
|
_VALID_URL = r'https?://(?:www\.)?dlive\.tv/p/(?P<uploader_id>.+?)\+(?P<id>[^/?#&]+)'
|
|
|
|
|
_TESTS = [{
|
|
|
|
|
'url': 'https://dlive.tv/p/pdp+3mTzOl4WR',
|
|
|
|
|
'url': 'https://dlive.tv/p/planesfan+wDeWRZ8HR',
|
|
|
|
|
'info_dict': {
|
|
|
|
|
'id': '3mTzOl4WR',
|
|
|
|
|
'id': 'wDeWRZ8HR',
|
|
|
|
|
'ext': 'mp4',
|
|
|
|
|
'title': 'Minecraft with james charles epic',
|
|
|
|
|
'upload_date': '20190701',
|
|
|
|
|
'timestamp': 1562011015,
|
|
|
|
|
'uploader_id': 'pdp',
|
|
|
|
|
'title': 'Money\'s in, guys!',
|
|
|
|
|
'upload_date': '20250712',
|
|
|
|
|
'timestamp': 1752354913,
|
|
|
|
|
'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,
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
@ -36,7 +39,7 @@ class DLiveVODIE(InfoExtractor):
|
|
|
|
|
thumbnailUrl
|
|
|
|
|
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']
|
|
|
|
|
formats = self._extract_m3u8_formats(
|
|
|
|
|
broadcast['playbackUrl'], vod_id, 'mp4', 'm3u8_native')
|
|
|
|
@ -71,13 +74,20 @@ class DLiveStreamIE(InfoExtractor):
|
|
|
|
|
}
|
|
|
|
|
username
|
|
|
|
|
}
|
|
|
|
|
}''' % display_name}).encode())['data']['userByDisplayName'] # noqa: UP031
|
|
|
|
|
}''' % display_name}).encode(), headers={'content-type': 'application/json'})['data']['userByDisplayName'] # noqa: UP031
|
|
|
|
|
livestream = user['livestream']
|
|
|
|
|
title = livestream['title']
|
|
|
|
|
username = user['username']
|
|
|
|
|
formats = self._extract_m3u8_formats(
|
|
|
|
|
f'https://live.prd.dlive.tv/hls/live/{username}.m3u8',
|
|
|
|
|
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 {
|
|
|
|
|
'id': display_name,
|
|
|
|
|
'title': title,
|
|
|
|
|