diff --git a/yt_dlp/extractor/myfreecams.py b/yt_dlp/extractor/myfreecams.py index 3cf555a72e..2fb6dd6885 100644 --- a/yt_dlp/extractor/myfreecams.py +++ b/yt_dlp/extractor/myfreecams.py @@ -96,14 +96,18 @@ def webpage_extraction(self, video_id): params = self.get_required_params(webpage) if not params.get('sid'): 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 { 'id': video_id, 'title': video_id, 'is_live': True, - 'formats': self._extract_m3u8_formats( - 'https://edgevideo.myfreecams.com/hls/NxServer/' + params['sid'] + '/ngrp:mfc_' + params['a'] + params['mid'] + '.f4v_mobile/playlist.m3u8', - video_id, 'mp4', live=True), + 'formats': formats, '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), } @@ -160,7 +164,10 @@ def _real_extract(self, url): 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', - 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: self.report_warning('Unable to stream urls from api, falling back to webpage extraction')