From: Thorsten Date: Mon, 19 Dec 2022 15:21:05 +0000 (+0100) Subject: attempt to fix amazon errors X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=6f136ea565852e8eff066949105163beaa2886c1;p=urlbot-v3.git attempt to fix amazon errors --- 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)