mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-20 03:18:30 +00:00
refactor: return both hls and llhls streams
This commit is contained in:
parent
57c5540f5a
commit
c3f86881df
@ -96,14 +96,18 @@ def webpage_extraction(self, video_id):
|
|||||||
params = self.get_required_params(webpage)
|
params = self.get_required_params(webpage)
|
||||||
if not params.get('sid'):
|
if not params.get('sid'):
|
||||||
raise UserNotLive('Model offline')
|
raise UserNotLive('Model offline')
|
||||||
|
|
||||||
|
formats = self._extract_m3u8_formats(
|
||||||
|
'https://edgevideo.myfreecams.com/llhls/NxServer/' + params['sid'] + '/ngrp:mfc_' + params['a'] + params['mid'] + '.f4v_mobile/playlist.m3u8',
|
||||||
|
video_id, ext='mp4', m3u8_id='llhls', live=True)
|
||||||
|
formats.extend(self._extract_m3u8_formats('https://edgevideo.myfreecams.com/hls/NxServer/' + params['sid'] + '/ngrp:mfc_' + params['a'] + params['mid'] + '.f4v_mobile/playlist.m3u8',
|
||||||
|
video_id, ext='mp4', m3u8_id='hls', live=True))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': video_id,
|
'title': video_id,
|
||||||
'is_live': True,
|
'is_live': True,
|
||||||
'formats': self._extract_m3u8_formats(
|
'formats': formats,
|
||||||
'https://edgevideo.myfreecams.com/hls/NxServer/' + params['sid'] + '/ngrp:mfc_' + params['a'] + params['mid'] + '.f4v_mobile/playlist.m3u8',
|
|
||||||
video_id, 'mp4', live=True),
|
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
'thumbnail': self._search_regex(r'(https?://img\.mfcimg\.com/photos2?/\d+/\d+/avatar\.\d+x\d+.jpg(?:\?nc=\d+)?)', webpage, 'thumbnail', fatal=False),
|
'thumbnail': self._search_regex(r'(https?://img\.mfcimg\.com/photos2?/\d+/\d+/avatar\.\d+x\d+.jpg(?:\?nc=\d+)?)', webpage, 'thumbnail', fatal=False),
|
||||||
}
|
}
|
||||||
@ -160,7 +164,10 @@ def _real_extract(self, url):
|
|||||||
|
|
||||||
formats = self._extract_m3u8_formats(
|
formats = self._extract_m3u8_formats(
|
||||||
f'https://edgevideo.myfreecams.com/llhls/NxServer/{server_id}/ngrp:mfc_{phase}{mid}.f4v_cmaf/playlist_sfm4s.m3u8?nc={rand_val}&v=1.97.23',
|
f'https://edgevideo.myfreecams.com/llhls/NxServer/{server_id}/ngrp:mfc_{phase}{mid}.f4v_cmaf/playlist_sfm4s.m3u8?nc={rand_val}&v=1.97.23',
|
||||||
video_id, 'mp4', live=True)
|
video_id, ext='mp4', m3u8_id='llhls', live=True)
|
||||||
|
formats.extend(self._extract_m3u8_formats(
|
||||||
|
f'https://edgevideo.myfreecams.com/hls/NxServer/{server_id}/ngrp:mfc_{phase}{mid}.f4v_cmaf/playlist_sfm4s.m3u8?nc={rand_val}&v=1.97.23',
|
||||||
|
video_id, ext='mp4', m3u8_id='hls', live=True))
|
||||||
|
|
||||||
if not formats or len(formats) < 1:
|
if not formats or len(formats) < 1:
|
||||||
self.report_warning('Unable to stream urls from api, falling back to webpage extraction')
|
self.report_warning('Unable to stream urls from api, falling back to webpage extraction')
|
||||||
|
Loading…
Reference in New Issue
Block a user