From 70f305b758a84b170b33a1e207fcfe36cd516a5a Mon Sep 17 00:00:00 2001 From: Alejandro Perez Lopez Date: Wed, 20 Mar 2024 21:33:39 +0100 Subject: [PATCH 1/2] Add .idea folder as ignored --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7c2e09e..82951f7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ /data/images/products /data/images/last_iteration/*.png venv -.DS_Store \ No newline at end of file +.DS_Store +.idea/* \ No newline at end of file From b7322c863db16880bd464c50bfd7257195930b1e Mon Sep 17 00:00:00 2001 From: Alejandro Perez Lopez Date: Wed, 20 Mar 2024 21:34:16 +0100 Subject: [PATCH 2/2] Return a controlled value when the link is invalid (not an amazon link) so we avoid throwing an exception --- bot/bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/bot.py b/bot/bot.py index c5c9bec..250b153 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -67,6 +67,9 @@ def extract_amazon_url_with_referer(text: str): return helpers.new_refer_url(product_code, extra_params), original_message + # we return here the original message without modification and None for the URL marking that the url is not valid + return None, text + def resolve_captcha(driver: webdriver): logging.info("Trying to resolve captcha")