1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 08:58:30 +00:00
This commit is contained in:
Zachary24 2025-06-27 13:33:47 +08:00 committed by GitHub
commit 21c01a1454
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,15 +51,14 @@ class ChaturbateIE(InfoExtractor):
def _extract_from_api(self, video_id, tld):
response = self._download_json(
f'https://chaturbate.{tld}/get_edge_hls_url_ajax/', video_id,
data=urlencode_postdata({'room_slug': video_id}),
f'https://chaturbate.{tld}/api/chatvideocontext/{video_id}', video_id,
headers={
**self.geo_verification_headers(),
'X-Requested-With': 'XMLHttpRequest',
'Accept': 'application/json',
}, fatal=False, impersonate=True) or {}
m3u8_url = response.get('url')
m3u8_url = response.get('hls_source').replace('live-edge', 'live-fhls').replace('playlist.m3u8', 'playlist_sfm4s.m3u8')
if not m3u8_url:
status = response.get('room_status')
if error := self._ERROR_MAP.get(status):