From aceee97031ec2726ac7ffaf9048e50ad97bb1f81 Mon Sep 17 00:00:00 2001 From: stabbedbybrick <125766685+stabbedbybrick@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:28:24 +0100 Subject: [PATCH] [all4] Improve error handling and sorting of assets --- services/channel4/channel4.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/services/channel4/channel4.py b/services/channel4/channel4.py index c202e19..3ac11f3 100644 --- a/services/channel4/channel4.py +++ b/services/channel4/channel4.py @@ -328,11 +328,7 @@ class CHANNEL4(Config): client, r, ) - try: - r = proxy_session(self, url=manifest, method="get", location="UK") - except IndexError as e: - self.log.warning("Proxy attempt failed. %s", e) - return + r = proxy_session(self, url=manifest, method="get", location="UK") if not r.ok: self.log.warning("Proxy attempt failed. %s", r) return @@ -345,7 +341,10 @@ class CHANNEL4(Config): ) return heights - def sort_assets(self, android_assets: tuple, web_assets: tuple): + def sort_assets(self, android_assets: tuple, web_assets: tuple) -> tuple: + android_heights = None + web_heights = None + if android_assets is not None: a_manifest, a_token, a_subtitle = android_assets android_heights = self.get_heights(a_manifest, client="ANDROID")