From 9c1d1375b00a35e526f43c3a03c7783e92b5d43a Mon Sep 17 00:00:00 2001 From: lossless1024 Date: Wed, 10 Jul 2024 09:31:44 +0200 Subject: [PATCH] MFC better error messages #151 --- streamonitor/sites/myfreecams.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/streamonitor/sites/myfreecams.py b/streamonitor/sites/myfreecams.py index 520abb4..a634344 100644 --- a/streamonitor/sites/myfreecams.py +++ b/streamonitor/sites/myfreecams.py @@ -31,8 +31,10 @@ def getVideoUrl(self, refresh=False): def getStatus(self): r = requests.get(f'https://share.myfreecams.com/{self.username}') + if r.status_code == 404: + return Bot.Status.NOTEXIST if r.status_code != 200: - return False + return Bot.Status.UNKNOWN doc = r.content startpos = doc.find(b'https://www.myfreecams.com/php/tracking.php?') endpos = doc.find(b'"', startpos)