From 0c6ef033739f2bca0bb74fec13888366b1ea7366 Mon Sep 17 00:00:00 2001 From: Ghost <62809003+Ghost6446@users.noreply.github.com> Date: Wed, 28 Feb 2024 07:39:55 +0100 Subject: [PATCH] fix msg --- Src/Lib/FFmpeg/file_list.txt | 0 Src/Lib/FFmpeg/my_m3u8.py | 12 ++++++++---- Src/Util/message.py | 18 ++++++++++-------- 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 Src/Lib/FFmpeg/file_list.txt diff --git a/Src/Lib/FFmpeg/file_list.txt b/Src/Lib/FFmpeg/file_list.txt new file mode 100644 index 0000000..e69de29 diff --git a/Src/Lib/FFmpeg/my_m3u8.py b/Src/Lib/FFmpeg/my_m3u8.py index 57b6d19..2cc81b8 100644 --- a/Src/Lib/FFmpeg/my_m3u8.py +++ b/Src/Lib/FFmpeg/my_m3u8.py @@ -194,7 +194,11 @@ class M3U8_Segments: url_number = self.segments.index(ts_url) - is_valid = ( str(url_number) in failed_segments ) + is_valid = True + for failde_seg in failed_segments: + if str(failde_seg) in ts_url: + is_valid = False + break if is_valid: @@ -308,8 +312,8 @@ class M3U8_Segments: with open(file_list_path, 'w') as f: for ts_file in ts_files: - absolute_path = os.path.abspath(os.path.join(self.temp_folder, ts_file), current_dir) - f.write(f"file '{absolute_path}'\n") + relative_path = os.path.relpath(os.path.join(self.temp_folder, ts_file), current_dir) + f.write(f"file '{relative_path}'\n") console.log("[cyan]Start join all file") try: @@ -458,4 +462,4 @@ def download_m3u8(m3u8_playlist=None, m3u8_index = None, m3u8_audio=None, m3u8_s path = output_filename.split("\\") os.makedirs("\\".join(path[:-1]), exist_ok=True) if log: console.log(f"[green]Dowload m3u8 from index [white]=> [purple]{m3u8_index}") - M3U8_Downloader(m3u8_index, m3u8_audio, key=key, output_filename=output_filename).start() + M3U8_Downloader(m3u8_index, m3u8_audio, key=key, output_filename=output_filename).start() \ No newline at end of file diff --git a/Src/Util/message.py b/Src/Util/message.py index b9dba4d..137fc69 100644 --- a/Src/Util/message.py +++ b/Src/Util/message.py @@ -6,14 +6,16 @@ from Src.Util.console import console def msg_start(): msg = """ - _____ _ _ _ _ - / ____| | (_) (_) | - | (___ | |_ _ __ ___ __ _ _ __ ___ _ _ __ __ _ ___ ___ _ __ ___ _ _ _ __ _| |_ _ _ - \___ \| __| '__/ _ \/ _` | '_ ` _ \| | '_ \ / _` | / __/ _ \| '_ ` _ \| | | | '_ \| | __| | | | - ____) | |_| | | __/ (_| | | | | | | | | | | (_| | | (_| (_) | | | | | | |_| | | | | | |_| |_| | - |_____/ \__|_| \___|\__,_|_| |_| |_|_|_| |_|\__, | \___\___/|_| |_| |_|\__,_|_| |_|_|\__|\__, | - __/ | __/ | - |___/ |___/ + + _____ _ _ _____ _ _ + / ____| | (_) / ____| (_) | + | (___ | |_ _ __ ___ __ _ _ __ ___ _ _ __ __ _ | | ___ _ __ ___ _ __ ___ _ _ _ __ _| |_ _ _ + \___ \| __| '__/ _ \/ _` | '_ ` _ \| | '_ \ / _` | | | / _ \| '_ ` _ \| '_ ` _ \| | | | '_ \| | __| | | | + ____) | |_| | | __/ (_| | | | | | | | | | | (_| | | |___| (_) | | | | | | | | | | | |_| | | | | | |_| |_| | + |_____/ \__|_| \___|\__,_|_| |_| |_|_|_| |_|\__, | \_____\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|_|\__|\__, | + __/ | __/ | + |___/ |___/ + """ console.print(f"[purple]{msg}") \ No newline at end of file