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()