From cf65886eb7cbc7a1cc142dbd0fa3317ce1b75106 Mon Sep 17 00:00:00 2001 From: Imran Hussain Date: Mon, 28 Oct 2024 12:11:56 +0000 Subject: [PATCH] On channel watch error, mark the channel offline and try another --- channel.py | 5 +++-- twitch.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/channel.py b/channel.py index 25124574..95c8a991 100644 --- a/channel.py +++ b/channel.py @@ -397,5 +397,6 @@ async def send_watch(self) -> bool: async with self._twitch.request("HEAD", stream_chunk_url) as head_response: return head_response.status == 200 except aiohttp.InvalidURL as exc: - # Temporarily log the entire response into the output - raise MinerException(available_chunks) from exc + return False + ## Temporarily log the entire response into the output + #raise MinerException(available_chunks) from exc diff --git a/twitch.py b/twitch.py index 37a1e133..720e1edd 100644 --- a/twitch.py +++ b/twitch.py @@ -888,6 +888,10 @@ async def _watch_loop(self) -> NoReturn: succeeded: bool = await channel.send_watch() if not succeeded: logger.log(CALL, f"Watch requested failed for channel: {channel.name}") + logger.info(f"Failed to watch {channel.name} so marking as offline & removing...") + channel.set_offline() + channel.remove() + continue elif not self.gui.progress.is_counting(): # If the previous update was more than 60s ago, and the progress tracker # isn't counting down anymore, that means Twitch has temporarily