Compare commits

...

4 Commits

Author SHA1 Message Date
ischmidt20
7a467f554c
Merge 3b8e915274 into fe70f20aed 2024-11-24 08:16:15 +05:30
ischmidt20
3b8e915274
Merge branch 'yt-dlp:master' into decrypt 2024-09-02 11:34:17 -04:00
Isaac Schmidt
732929ae38 use actual filename 2023-06-28 21:07:26 -04:00
Isaac Schmidt
aa1f5c7689 save decrypted fragments using my preferred naming scheme 2023-06-28 21:05:29 -04:00

View File

@ -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