From 6ede093624eb261f97abfe7bd79f6bdae89f1710 Mon Sep 17 00:00:00 2001 From: Lovi <62809003+Lovi-0@users.noreply.github.com> Date: Fri, 7 Feb 2025 16:17:16 +0100 Subject: [PATCH] Fix requirements --- StreamingCommunity/Lib/Downloader/HLS/downloader.py | 1 - StreamingCommunity/Lib/Downloader/HLS/segments.py | 3 +-- StreamingCommunity/Lib/M3U8/estimator.py | 12 +++++------- StreamingCommunity/Util/os.py | 2 +- StreamingCommunity/run.py | 2 +- setup.py | 2 +- test_run.py | 2 +- 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/StreamingCommunity/Lib/Downloader/HLS/downloader.py b/StreamingCommunity/Lib/Downloader/HLS/downloader.py index e3e124c..dc8d436 100644 --- a/StreamingCommunity/Lib/Downloader/HLS/downloader.py +++ b/StreamingCommunity/Lib/Downloader/HLS/downloader.py @@ -506,7 +506,6 @@ class HLS_Downloader: file_size = internet_manager.format_file_size(os.path.getsize(self.path_manager.output_path)) duration = print_duration_table(self.path_manager.output_path, description=False, return_string=True) - print() panel_content = ( f"[cyan]File size: [bold red]{file_size}[/bold red]\n" f"[cyan]Duration: [bold]{duration}[/bold]\n" diff --git a/StreamingCommunity/Lib/Downloader/HLS/segments.py b/StreamingCommunity/Lib/Downloader/HLS/segments.py index 1525cd9..195ebdd 100644 --- a/StreamingCommunity/Lib/Downloader/HLS/segments.py +++ b/StreamingCommunity/Lib/Downloader/HLS/segments.py @@ -391,8 +391,7 @@ class M3U8_Segments: f"{Colors.YELLOW}[HLS] {Colors.WHITE}({Colors.CYAN}{description}{Colors.WHITE}): " f"{Colors.RED}{{percentage:.2f}}% " f"{Colors.MAGENTA}{{bar}} " - f"{Colors.WHITE}[ {Colors.YELLOW}{{n_fmt}}{Colors.WHITE} / {Colors.RED}{{total_fmt}} {Colors.WHITE}] " - f"{Colors.YELLOW}{{elapsed}} {Colors.WHITE}< {Colors.CYAN}{{remaining}}{{postfix}} {Colors.WHITE}]" + f"{Colors.WHITE}[ {Colors.YELLOW}{{elapsed}}{Colors.WHITE} < {Colors.CYAN}{{remaining}}{Colors.WHITE}{{postfix}}{Colors.WHITE} ]" ) def _get_worker_count(self, stream_type: str) -> int: diff --git a/StreamingCommunity/Lib/M3U8/estimator.py b/StreamingCommunity/Lib/M3U8/estimator.py index 799fe4a..f68db29 100644 --- a/StreamingCommunity/Lib/M3U8/estimator.py +++ b/StreamingCommunity/Lib/M3U8/estimator.py @@ -106,12 +106,12 @@ class M3U8_Ts_Estimator: try: self.add_ts_file(total_downloaded * self.total_segments, total_downloaded, duration) - downloaded_file_size_str = internet_manager.format_file_size(self.now_downloaded_size) + #downloaded_file_size_str = internet_manager.format_file_size(self.now_downloaded_size) file_total_size = self.calculate_total_size() - number_file_downloaded = downloaded_file_size_str.split(' ')[0] + #number_file_downloaded = downloaded_file_size_str.split(' ')[0] number_file_total_size = file_total_size.split(' ')[0] - units_file_downloaded = downloaded_file_size_str.split(' ')[1] + #units_file_downloaded = downloaded_file_size_str.split(' ')[1] units_file_total_size = file_total_size.split(' ')[1] if USE_LARGE_BAR: @@ -124,19 +124,17 @@ class M3U8_Ts_Estimator: average_internet_speed = "N/A" average_internet_unit = "" - # Retrieve retry count from segments_instance retry_count = self.segments_instance.active_retries if self.segments_instance else 0 progress_str = ( - f"{Colors.WHITE}[ {Colors.GREEN}{number_file_downloaded} {Colors.WHITE}< " + #f"{Colors.WHITE}[ {Colors.GREEN}{number_file_downloaded} {Colors.WHITE}< " f"{Colors.GREEN}{number_file_total_size} {Colors.RED}{units_file_total_size} " f"{Colors.WHITE}| {Colors.CYAN}{average_internet_speed} {Colors.RED}{average_internet_unit} " f"{Colors.WHITE}| {Colors.GREEN}CRR {Colors.RED}{retry_count}" ) else: - # Retrieve retry count from segments_instance retry_count = self.segments_instance.active_retries if self.segments_instance else 0 progress_str = ( - f"{Colors.WHITE}[ {Colors.GREEN}{number_file_downloaded} {Colors.WHITE}< " + #f"{Colors.WHITE}[ {Colors.GREEN}{number_file_downloaded} {Colors.WHITE}< " f"{Colors.GREEN}{number_file_total_size} {Colors.RED}{units_file_total_size} " f"{Colors.WHITE}| {Colors.GREEN}CRR {Colors.RED}{retry_count}" ) diff --git a/StreamingCommunity/Util/os.py b/StreamingCommunity/Util/os.py index 90216d0..08bb289 100644 --- a/StreamingCommunity/Util/os.py +++ b/StreamingCommunity/Util/os.py @@ -461,7 +461,7 @@ class OsSummary: optional_libraries = [line.strip().split("=")[0] for line in open(requirements_file, 'r', encoding='utf-8-sig')] for lib in optional_libraries: - installed_version = self.get_library_version(lib) + installed_version = self.get_library_version(lib.split("<")[0]) if 'not installed' in installed_version: user_response = msg.ask(f"{lib} is not installed. Do you want to install it? (yes/no)", default="y") if user_response.lower().strip() in ["yes", "y"]: diff --git a/StreamingCommunity/run.py b/StreamingCommunity/run.py index ee7e71d..cc9f154 100644 --- a/StreamingCommunity/run.py +++ b/StreamingCommunity/run.py @@ -178,7 +178,7 @@ def force_exit(): os._exit(0) -def main(script_id): +def main(script_id = 0): if TELEGRAM_BOT: bot = get_bot_instance() diff --git a/setup.py b/setup.py index 533ee45..a1f3cb1 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ with open("requirements.txt", "r", encoding="utf-8-sig") as f: setup( name="StreamingCommunity", - version="2.5.6", + version="2.5.7", long_description=read_readme(), long_description_content_type="text/markdown", author="Lovi-0", diff --git a/test_run.py b/test_run.py index abe28dc..012c2d5 100644 --- a/test_run.py +++ b/test_run.py @@ -18,4 +18,4 @@ if TELEGRAM_BOT: main(script_id) else: - main(0) \ No newline at end of file + main() \ No newline at end of file