From 25db0847ec33ede3bdad20dad8442312e79d527d Mon Sep 17 00:00:00 2001 From: dvingerh Date: Fri, 4 Sep 2020 16:44:45 +0200 Subject: [PATCH] Add extra sanitation for segment name in json --- pyinstalive/assembler.py | 1 + pyinstalive/dlfuncs.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyinstalive/assembler.py b/pyinstalive/assembler.py index c6178bb..59f65f1 100644 --- a/pyinstalive/assembler.py +++ b/pyinstalive/assembler.py @@ -90,6 +90,7 @@ def assemble(user_called=True, retry_with_zero_m4v=False): logger.info("Assembling video segment files from specified folder: {}".format(ass_segment_dir)) for segment in all_segments: + segment = re.sub('\?.*$', '', segment) if not os.path.isfile(segment.replace('.m4v', '.m4a')): logger.warn('Audio segment not found: {0!s}'.format(segment.replace('.m4v', '.m4a'))) continue diff --git a/pyinstalive/dlfuncs.py b/pyinstalive/dlfuncs.py index 0f5877a..8b1731b 100644 --- a/pyinstalive/dlfuncs.py +++ b/pyinstalive/dlfuncs.py @@ -150,11 +150,11 @@ def merge_segments(): logger.info('Merging downloaded files into video.') pil.broadcast_downloader.stitch(live_mp4_file, cleartempfiles=pil.clear_temp_files) logger.info('Successfully merged downloaded files into video.') + if pil.clear_temp_files: + helpers.remove_temp_folder() else: logger.binfo("Merging of downloaded files has been disabled.") logger.binfo("Use --assemble command to manually merge downloaded segments.") - if pil.clear_temp_files: - helpers.remove_temp_folder() helpers.remove_lock() except ValueError as e: logger.separator()