From 6f136ea565852e8eff066949105163beaa2886c1 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Mon, 19 Dec 2022 16:21:05 +0100 Subject: [PATCH] attempt to fix amazon errors --- distbot/common/utils.py | 2 +- distbot/plugins/url.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/distbot/common/utils.py b/distbot/common/utils.py index c115ab9..6ca819a 100644 --- a/distbot/common/utils.py +++ b/distbot/common/utils.py @@ -11,7 +11,7 @@ from functools import wraps logger = logging.getLogger(__name__) BUFSIZ = 8192 -USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36' +USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/108.0.5359.112 Mobile/15E148 Safari/604.1' def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None): diff --git a/distbot/plugins/url.py b/distbot/plugins/url.py index e421f89..dae31d4 100644 --- a/distbot/plugins/url.py +++ b/distbot/plugins/url.py @@ -102,6 +102,8 @@ class URLResolver(Worker): url = url.rstrip(stupid) try: title = extract_title(url) + if "amazon" in url and "Tut uns Leid!" in title: + return except UnicodeError as e: message = 'Bug triggered (%s), invalid URL/domain part: %s' % (str(e), url) logger.warning(message) -- 2.39.2