mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 09:41:26 +01:00
Compare commits
5 Commits
7a467f554c
...
824d9c2917
Author | SHA1 | Date | |
---|---|---|---|
|
824d9c2917 | ||
|
4b5eec0aaa | ||
|
3b8e915274 | ||
|
732929ae38 | ||
|
aa1f5c7689 |
|
@ -497,7 +497,11 @@ class FragmentFD(FileDownloader):
|
||||||
'fragment_filename_sanitized': frag_filename,
|
'fragment_filename_sanitized': frag_filename,
|
||||||
'fragment_index': frag_index,
|
'fragment_index': frag_index,
|
||||||
})
|
})
|
||||||
if not append_fragment(decrypt_fragment(fragment, self._read_fragment(ctx)), frag_index, ctx):
|
decrypted_fragment = decrypt_fragment(fragment, self._read_fragment(ctx))
|
||||||
|
if self.params.get('keep_fragments', False):
|
||||||
|
f, _ = self.sanitize_open(ctx.get('fragment_filename_sanitized'), 'wb')
|
||||||
|
f.write(decrypted_fragment)
|
||||||
|
if not append_fragment(decrypted_fragment, frag_index, ctx):
|
||||||
return False
|
return False
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
self._finish_multiline_status()
|
self._finish_multiline_status()
|
||||||
|
@ -511,8 +515,11 @@ class FragmentFD(FileDownloader):
|
||||||
break
|
break
|
||||||
try:
|
try:
|
||||||
download_fragment(fragment, ctx)
|
download_fragment(fragment, ctx)
|
||||||
result = append_fragment(
|
decrypted_fragment = decrypt_fragment(fragment, self._read_fragment(ctx))
|
||||||
decrypt_fragment(fragment, self._read_fragment(ctx)), fragment['frag_index'], ctx)
|
if self.params.get('keep_fragments', False):
|
||||||
|
f, _ = self.sanitize_open(ctx.get('fragment_filename_sanitized'), 'wb')
|
||||||
|
f.write(decrypted_fragment)
|
||||||
|
result = append_fragment(decrypted_fragment, fragment['frag_index'], ctx)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
if info_dict.get('is_live'):
|
if info_dict.get('is_live'):
|
||||||
break
|
break
|
||||||
|
|
|
@ -59,16 +59,15 @@ class ChaturbateIE(InfoExtractor):
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
}, fatal=False, impersonate=True) or {}
|
}, fatal=False, impersonate=True) or {}
|
||||||
|
|
||||||
status = response.get('room_status')
|
|
||||||
if status != 'public':
|
|
||||||
if error := self._ERROR_MAP.get(status):
|
|
||||||
raise ExtractorError(error, expected=True)
|
|
||||||
self.report_warning('Falling back to webpage extraction')
|
|
||||||
return None
|
|
||||||
|
|
||||||
m3u8_url = response.get('url')
|
m3u8_url = response.get('url')
|
||||||
if not m3u8_url:
|
if not m3u8_url:
|
||||||
self.raise_geo_restricted()
|
status = response.get('room_status')
|
||||||
|
if error := self._ERROR_MAP.get(status):
|
||||||
|
raise ExtractorError(error, expected=True)
|
||||||
|
if status == 'public':
|
||||||
|
self.raise_geo_restricted()
|
||||||
|
self.report_warning(f'Got status "{status}" from API; falling back to webpage extraction')
|
||||||
|
return None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user