diff --git a/README.md b/README.md index cc31597..5abce36 100644 --- a/README.md +++ b/README.md @@ -404,7 +404,7 @@ The `run-container` command mounts also the `config.json` file, so any change to | [Altadefinizione](https://altadefinizione.prof/) | ✅ | | [AnimeUnity](https://animeunity.so/) | ✅ | | [Ilcorsaronero](https://ilcorsaronero.link/) | ✅ | -| [CB01New](https://cb01new.quest/) | ✅ | +| [CB01New](https://cb01new.sbs/) | ✅ | | [DDLStreamItaly](https://ddlstreamitaly.co/) | ✅ | | [GuardaSerie](https://guardaserie.academy/) | ✅ | | [MostraGuarda](https://mostraguarda.stream/) | ✅ | diff --git a/StreamingCommunity/Lib/Downloader/HLS/downloader.py b/StreamingCommunity/Lib/Downloader/HLS/downloader.py index 279b690..749b316 100644 --- a/StreamingCommunity/Lib/Downloader/HLS/downloader.py +++ b/StreamingCommunity/Lib/Downloader/HLS/downloader.py @@ -11,7 +11,7 @@ import httpx # Internal utilities from StreamingCommunity.Util._jsonConfig import config_manager -from StreamingCommunity.Util.console import console, Panel, Table +from StreamingCommunity.Util.console import console, Panel from StreamingCommunity.Util.color import Colors from StreamingCommunity.Util.os import ( compute_sha1_hash, @@ -284,6 +284,7 @@ class ContentExtractor: print("") + class DownloadTracker: def __init__(self, path_manager: PathManager): """ @@ -815,6 +816,9 @@ class HLS_Downloader: else: console.log("[red]Error: m3u8_index is None") + # Reset + self._reset() + def _clean(self, out_path: str) -> None: """ Cleans up temporary files and folders after downloading and processing. @@ -953,3 +957,9 @@ class HLS_Downloader: # Clean up temporary files and directories self._clean(self.content_joiner.converted_out_path) + + def _reset(self): + global list_MissingTs, m3u8_url_fixer + + m3u8_url_fixer.reset_playlist() + list_MissingTs = [] diff --git a/StreamingCommunity/Lib/Downloader/HLS/segments.py b/StreamingCommunity/Lib/Downloader/HLS/segments.py index 4445426..d33d7f1 100644 --- a/StreamingCommunity/Lib/Downloader/HLS/segments.py +++ b/StreamingCommunity/Lib/Downloader/HLS/segments.py @@ -558,15 +558,16 @@ class M3U8_Segments: if file_size == 0: raise Exception("Output file is empty") - # Display additional - if self.info_nRetry >= len(self.segments) * 0.3: + # Display additional info when there is missing stream file + if self.info_nFailed > 0: # Get expected time ex_hours, ex_minutes, ex_seconds = format_duration(self.expected_real_time_s) ex_formatted_duration = f"[yellow]{int(ex_hours)}[red]h [yellow]{int(ex_minutes)}[red]m [yellow]{int(ex_seconds)}[red]s" console.print(f"[cyan]Max retry per URL[white]: [green]{self.info_maxRetry}[green] [white]| [cyan]Total retry done[white]: [green]{self.info_nRetry}[green] [white]| [cyan]Missing TS: [red]{self.info_nFailed} [white]| [cyan]Duration: {print_duration_table(self.tmp_file_path, None, True)} [white]| [cyan]Expected duation: {ex_formatted_duration} \n") - console.print("[yellow]⚠ Warning:[/yellow] Too many retries detected! Consider reducing the number of [cyan]workers[/cyan] in the [magenta]config.json[/magenta] file. This will impact [bold]performance[/bold]. \n") + if self.info_nRetry >= len(self.segments) * 0.3: + console.print("[yellow]⚠ Warning:[/yellow] Too many retries detected! Consider reducing the number of [cyan]workers[/cyan] in the [magenta]config.json[/magenta] file. This will impact [bold]performance[/bold]. \n") # Info to return return {'type': type, 'nFailed': self.info_nFailed} \ No newline at end of file diff --git a/StreamingCommunity/Lib/M3U8/url_fixer.py b/StreamingCommunity/Lib/M3U8/url_fixer.py index 78778c9..0626b90 100644 --- a/StreamingCommunity/Lib/M3U8/url_fixer.py +++ b/StreamingCommunity/Lib/M3U8/url_fixer.py @@ -49,4 +49,10 @@ class M3U8_UrlFix: full_url = urljoin(base_url, url_resource) return full_url + + def reset_playlist(self) -> None: + """ + Reset the M3U8 playlist URL to its default state (None). + """ + self.url_playlist = None \ No newline at end of file diff --git a/config.json b/config.json index 9fdba69..770ec93 100644 --- a/config.json +++ b/config.json @@ -20,7 +20,7 @@ "not_close": false }, "REQUESTS": { - "timeout": 35, + "timeout": 30, "max_retry": 8, "proxy_start_min": 0.1, "proxy_start_max": 0.5 @@ -81,7 +81,7 @@ "domain": "so" }, "cb01new": { - "domain": "quest" + "domain": "sbs" }, "1337xx": { "domain": "to"