From 80dc7c1baa08852f691fc614820316a478a44d80 Mon Sep 17 00:00:00 2001 From: Lovi <62809003+Arrowar@users.noreply.github.com> Date: Sun, 15 Jun 2025 10:16:55 +0200 Subject: [PATCH] core: Fix issue #341 --- StreamingCommunity/Lib/Downloader/HLS/downloader.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/StreamingCommunity/Lib/Downloader/HLS/downloader.py b/StreamingCommunity/Lib/Downloader/HLS/downloader.py index e887c0c..bdab2a4 100644 --- a/StreamingCommunity/Lib/Downloader/HLS/downloader.py +++ b/StreamingCommunity/Lib/Downloader/HLS/downloader.py @@ -156,7 +156,7 @@ class M3U8Manager: If it's a master playlist, only selects video stream. """ if not self.is_master: - self.video_url, self.video_res = self.m3u8_url, "0px" + self.video_url, self.video_res = self.m3u8_url, "undefined" self.audio_streams = [] self.sub_streams = [] @@ -165,8 +165,9 @@ class M3U8Manager: self.video_url, self.video_res = self.parser._video.get_best_uri() elif str(FILTER_CUSTOM_REOLUTION) == "worst": self.video_url, self.video_res = self.parser._video.get_worst_uri() - elif "px" in str(FILTER_CUSTOM_REOLUTION): - self.video_url, self.video_res = self.parser._video.get_custom_uri(int(FILTER_CUSTOM_REOLUTION.replace("p", ""))) + elif str(FILTER_CUSTOM_REOLUTION).replace("p", "").replace("px", "").isdigit(): + resolution_value = int(str(FILTER_CUSTOM_REOLUTION).replace("p", "").replace("px", "")) + self.video_url, self.video_res = self.parser._video.get_custom_uri(resolution_value) else: logging.error("Resolution not recognized.") self.video_url, self.video_res = self.parser._video.get_best_uri()