From 732929ae3864067990004e1025177ef5bbc08f91 Mon Sep 17 00:00:00 2001 From: Isaac Schmidt Date: Wed, 28 Jun 2023 21:07:26 -0400 Subject: [PATCH] use actual filename --- yt_dlp/downloader/fragment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py index be068c0aa5..8d558e3d18 100644 --- a/yt_dlp/downloader/fragment.py +++ b/yt_dlp/downloader/fragment.py @@ -517,7 +517,7 @@ def _download_fragment(fragment): }) decrypted_fragment = decrypt_fragment(fragment, self._read_fragment(ctx)) if self.params.get('keep_fragments', False): - f, _ = self.sanitize_open(format(fragment['frag_index'], '05d') + '.ts', 'wb') + 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 @@ -535,7 +535,7 @@ def _download_fragment(fragment): download_fragment(fragment, ctx) decrypted_fragment = decrypt_fragment(fragment, self._read_fragment(ctx)) if self.params.get('keep_fragments', False): - f, _ = self.sanitize_open(format(fragment['frag_index'], '05d') + '.ts', 'wb') + 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: