Der-Henning / tgtg

Scanner for Too Good To Go Notifications
https://github.com/Der-Henning/tgtg/wiki
GNU General Public License v3.0
393 stars 62 forks source link

TGTG API ERROR 403 (Please enable JS and disable ad-blocker) and invalid configuration #96

Closed itsbasix closed 2 years ago

itsbasix commented 2 years ago

Similar to existing issue marked as closed. Rebooting router (my ISP does not give me another IP er every reboot) and putting container to stop for whole day then restarting it did not solve it. SLEEP_TIME is set to 70

2022-05-26 09:50:31 INFO ____ ___ ____ ___ ____ ___ __ __ _ __ _ ____ ____ 2022-05-26 09:50:31 INFO (_ _)/ __)(_ _)/ __) / ___) / __) / _\ ( ( \( ( \( __)( _ \ 2022-05-26 09:50:31 INFO )( ( (_ \ )( ( (_ \ \___ \( (__ / \/ // / ) _) ) / 2022-05-26 09:50:31 INFO (__) \___/ (__) \___/ (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 2022-05-26 09:50:31 INFO 2022-05-26 09:50:31 INFO Version 1.10.1 2022-05-26 09:50:31 INFO ©2021, Henning Merklinger 2022-05-26 09:50:31 INFO For documentation and support please visit https://github.com/Der-Henning/tgtg 2022-05-26 09:50:31 INFO 2022-05-26 09:50:31 INFO Loaded config from environment variables 2022-05-26 09:50:31 INFO Debugging mode enabled 2022-05-26 09:50:31 DEBUG Starting new HTTPS connection (1): apptoogoodtogo.com:443 2022-05-26 09:50:32 DEBUG https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 403 546 2022-05-26 09:50:32 ERROR (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMAe3jo0btZSJYAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35587,\'e\':\'930e69450ef9d27215f36c88e266e7ccd702690c28a6a3fc918cb220a397a0cc\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n') 2022-05-26 09:50:32 ERROR Configuration Error - Invalid TGTG configuration

I saw the fix in this project in latest release is about updating user agent information.

https://github.com/Der-Henning/tgtg/compare/v1.10.0...v1.10.1#diff-4af1acdae058472fc5a77ffe64645d4bc06078d844795bb2f7a066d39b54fa37

In another project (tgtg-python) this is fixed the same way but by using more updated user agents

USER_AGENTS = [ "TGTG/22.5.5 Dalvik/2.1.0 (Linux; U; Android 6.0.1; Nexus 5 Build/M4B30Z)", "TGTG/22.5.5 Dalvik/2.1.0 (Linux; U; Android 7.0; SM-G935F Build/NRD90M)", "TGTG/22.5.5 Dalvik/2.1.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K)", ]

Der-Henning commented 2 years ago

Hi @itsbasix. I will update the USER_AGENTS with the next release. There should be no problem with the current version though... Did it work for you until some point or did you just start using the scanner? Did you maybe by mistake run multiple instances of the scanner? That increases the chances of receiving a ban significantly. Actually there is no real fix for the 403 Error. It is caused by the TGTG API protection and a temporary ban. I didn't hear of anyone receiving a permanent ban.

Der-Henning commented 2 years ago

Hi @itsbasix. The latest docker image includes the updated USER_AGENTS. Please pull the latest image and let me know if it is working for you. I will create a new release after some more testing.

nouzun commented 2 years ago

I'm getting the same error. I tried the latest docker image but it didn't solve the problem for me.

itsbasix commented 2 years ago

same here, still not working also with latest image. To answer your other questions:

Latest log attached (delete my old stack and created a new one, hence no token. Cannot to log in anymore)

022-05-28 02:06:48 INFO       ____  ___  ____  ___    ____   ___   __   __ _  __ _  ____  ____  
2022-05-28 02:06:48 INFO      (_  _)/ __)(_  _)/ __)  / ___) / __) / _\ (  ( \(  ( \(  __)(  _ \ 
2022-05-28 02:06:48 INFO        )( ( (_ \  )( ( (_ \  \___ \( (__ /    \/    //    / ) _)  )   / 
2022-05-28 02:06:48 INFO       (__) \___/ (__) \___/  (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 
2022-05-28 02:06:48 INFO     
2022-05-28 02:06:48 INFO     Version 1.10.2
2022-05-28 02:06:48 INFO     ©2021, Henning Merklinger
2022-05-28 02:06:48 INFO     For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-05-28 02:06:48 INFO     
2022-05-28 02:06:48 ERROR    Failed checking for new Version! - (<class 'KeyError'>, KeyError('tag_name'), <traceback object at 0x7f7a3d49de00>)
2022-05-28 02:06:48 WARNING  No token files in token path.
2022-05-28 02:06:48 INFO     Loaded config from environment variables
2022-05-28 02:06:48 INFO     Debugging mode enabled
2022-05-28 02:06:48 DEBUG    Starting new HTTPS connection (1): apptoogoodtogo.com:443
2022-05-28 02:06:48 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 403 546
2022-05-28 02:06:48 ERROR    (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMAghh1cINnHZYAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35587,\'e\':\'3342410c6e726a5021a77fedb8cef7fe95fec8fb738e95c88a745ef2eca73d22\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
2022-05-28 02:06:48 ERROR    Configuration Error - Invalid TGTG configuration
Der-Henning commented 2 years ago

Look like you have a problem with your internet connection, since the version check is a simple request to https://api.github.com/repos/Der-Henning/tgtg/releases/latest. The 403 Error indicates though, that you could connect to the tgtg API. But as I said it is a temporary ban from tgtg. Since you can login with a different account on the same network (same IP), it seems to be an account wise ban. Maybe try creating a new account?

itsbasix commented 2 years ago

Different account also cannot log in. I think it has to do with ip checking (i connect from my home location).

Anyhow, I think I partially understood what caused the ban, still not sure if temporary or not. My container has a restart until stopped setting, so every error caused a restart, and every restart a request to the TGTG server was sent.

I removed the unless stopped option and restarted the container after 1 night stop.

I could get the login message and log in. but then i got another error on service.py about item.id[0] (know it is a vague statement but I mistakenly deleted the container stack and lost the log before saving it. Will try to reproduce and post it here.)

Thanks for the support and the good work!

Der-Henning commented 2 years ago

Hi @itsbasix. That's good news. Since you could log in the ban wasn't permanent and expired. I think I know what caused your second error. Do you use a list of item_ids and don't have any favorites in your account? That would cause this kind of error. I will fix that asap.

Der-Henning commented 2 years ago

Latest docker image should fix the problem. d09a1fa6dc4bc9487d72b8e974b0d5656c4427fa

itsbasix commented 2 years ago

Hi @itsbasix. That's good news. Since you could log in the ban wasn't permanent and expired. I think I know what caused your second error. Do you use a list of item_ids and don't have any favorites in your account? That would cause this kind of error. I will fix that asap.

Actually my situation is the opposite, i do not specify any ITEM ID in the docker compose env varaibles and onyl have favourites on my account (it always worked before).

Unfortunately, no luck even with new version. Log in succeeds, but then usual error:

2022-05-29 22:59:39 INFO       ____  ___  ____  ___    ____   ___   __   __ _  __ _  ____  ____  
2022-05-29 22:59:39 INFO      (_  _)/ __)(_  _)/ __)  / ___) / __) / _\ (  ( \(  ( \(  __)(  _ \ 
2022-05-29 22:59:39 INFO        )( ( (_ \  )( ( (_ \  \___ \( (__ /    \/    //    / ) _)  )   / 
2022-05-29 22:59:39 INFO       (__) \___/ (__) \___/  (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 
2022-05-29 22:59:39 INFO     
2022-05-29 22:59:39 INFO     Version 1.10.3
2022-05-29 22:59:39 INFO     ©2021, Henning Merklinger
2022-05-29 22:59:39 INFO     For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-05-29 22:59:39 INFO     
2022-05-29 22:59:39 WARNING  No token files in token path.
2022-05-29 22:59:39 INFO     Loaded config from environment variables
2022-05-29 22:59:39 INFO     Debugging mode enabled
2022-05-29 22:59:39 DEBUG    Starting new HTTPS connection (1): apptoogoodtogo.com:443
2022-05-29 22:59:41 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 200 90
2022-05-29 22:59:41 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 22:59:41 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 22:59:47 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 22:59:47 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 22:59:53 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 22:59:53 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 22:59:58 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 22:59:58 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:04 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:04 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:10 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:10 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:15 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:15 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:21 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:21 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:27 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:27 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:32 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 200 1609
2022-05-29 23:00:32 INFO     Logged in!
2022-05-29 23:00:32 INFO     Activated notifiers:
2022-05-29 23:00:32 INFO     - WebHook: http://192.168.123.230:8123/api/webhook/toogoodtogonotifier
2022-05-29 23:00:32 INFO     Sending test Notifications ...
2022-05-29 23:00:33 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:33 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'a184f9f30346beb0a7a120cc9e17d7f3da50ad9989191b1920a6e4467ada6902\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:33 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:33 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'2b73887cabfd1731289609c2b0ee282ff9b8c0d3c221882d95065628c6638a86\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:33 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:33 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'f948090d0c98464bf658d7cec8157eb9e9b88c98d22ee1757e4452058a91d3c4\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:34 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:34 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'edc0e632b75d5f5cf7dc122fb536a1842a809e06749491540f53d3419c9bd97d\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:34 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:34 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'b5af1f820c76a5728f29a5f9f88095f8c1afb6a2cb09e4ca9176424ec8bbd461\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:35 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:35 ERROR    TGTG API Error: (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'831473167cde3e7df99036816e3914ea1c4d1f5521fd44b516120218e16fdd68\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')

Below my docker-compose

version: "3.3"
services:
  app:
    image: derhenning/tgtg:latest         ## pre build image from docker hub
    #image: tgtg-scanner:latest           ## locally build image
    container_name: 'toogoodtogowatcher_app'
    environment: 
      - TZ=Europe/Berlin                           ## Set timezone for pickupdate, otherwise will be utc
      - DEBUG=true                                    ## true for debug log messages
      - TGTG_USERNAME=myuseraddressmail       ## TGTG Username / Login EMail
      - SLEEP_TIME=70                                 ## Time to wait till next scan in seconds - default 60 seconds
      - ITEM_IDS=                                     ## (optional) Comma seperated list of Item Ids to scan
      - METRICS=false                                 ## Enable to export metrics for Prometheus
      - METRICS_PORT=8000                             ## Port for metrics http server
      - DISABLE_TESTS=false                           ## true to disable test notifications on startup

      - SMTP=false                                    ## true = enable mail notifications via smtp
      - SMTP_HOST=                     ## smtp Server - smtp.gmail.com for google
      - SMTP_PORT=                                ## smtp Server Port - 465 for google
      - SMTP_USERNAME=              ## smtp Login - your EMail for google
      - SMTP_PASSWORD=              ## smtp Login Password - your Login PW for google
      - SMTP_TLS=                                ## enable TLS - true for google and most smtp servers
      - SMTP_SENDER=               ## sender adress - same as Login for google and most smtp servers
      - SMTP_RECIPIENT=           ## recipient for notifications - can be the same as sender

      - PUSH_SAFER=false                              ## true = enable notifications via pushsafer.com
      - PUSH_SAFER_KEY=
      - PUSH_SAFER_DEVICE_ID=

      - TELEGRAM=false                                ## true = enable notifications via Telegram
      - TELEGRAM_TOKEN=                               ## Telegram Bot token - see @botfather
      - TELEGRAM_CHAT_ID=                             ## Telegram Chat id, multiple ids separated by comma

      - IFTTT=false                                   ## true = enable notifications via IFTTT Webhooks
      - IFTTT_EVENT=tgtg_notification                 ## IFTTT Webhooks Event
      - IFTTT_KEY=                                    ## IFTTT Webhooks Key

      ## Possible $${{variable}} variables: item_id, items_available, display_name, price, currency, pickupdate
      ## Example:
      ## - 'WEBHOOK_BODY={"message": "$${{display_name}} - New Amount: $${{items_available}}", "priority": 2, "title": "New TGTG Items"}'
      ## Notice that you have to enclose the variable with ''
      - WEBHOOK=true                                 ## true = enable notifications via costum WebHook
      - WEBHOOK_URL=http://192.168.123.230:8123/api/webhook/toogoodtogonotifier ## URL of your WebHook, can contain $${{variable}}
      - WEBHOOK_METHOD=POST                           ## Request Method
      - WEBHOOK_BODY={"name":"$${{display_name}}", "amount":"$${{items_available}}", "id":"$${{item_id}}"} ## Data to send, can contain $${{variable}}
      - WEBHOOK_TYPE=application/json                 ## Content-Type for header, default: text/plain
      - WEBHOOK_TIMEOUT=60                            ## Request Timeout
    volumes:
      - tokens:/tokens           ## volume to save TGTG credentials to reuse on next start up and avoid login mail
    #restart: unless-stopped
    networks:
      myNetwork:
        ipv4_address: 192.168.123.196

volumes:
  tokens:

networks:
  myNetwork:
    external: true
Der-Henning commented 2 years ago

OK since you mentioned an error containing something like item.id[0] I assumed something else. Fixed the bug anyway :) Your logs only show the 403 error. There are no other solutions than described in the FAQ. Shutting down the scanner and avoid all requests to the TGTG API for 24h fixed it for me 100% of the time.

itsbasix commented 2 years ago

Stopped it for about 20 hours and tried again. Posting the full log in here from login that showed yesterday. Question, why after first login, at restart container logs show a warning "No token files in token path" ?

2022-05-29 22:59:39 INFO       ____  ___  ____  ___    ____   ___   __   __ _  __ _  ____  ____  
2022-05-29 22:59:39 INFO      (_  _)/ __)(_  _)/ __)  / ___) / __) / _\ (  ( \(  ( \(  __)(  _ \ 
2022-05-29 22:59:39 INFO        )( ( (_ \  )( ( (_ \  \___ \( (__ /    \/    //    / ) _)  )   / 
2022-05-29 22:59:39 INFO       (__) \___/ (__) \___/  (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 
2022-05-29 22:59:39 INFO     
2022-05-29 22:59:39 INFO     Version 1.10.3
2022-05-29 22:59:39 INFO     ©2021, Henning Merklinger
2022-05-29 22:59:39 INFO     For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-05-29 22:59:39 INFO     
2022-05-29 22:59:39 WARNING  No token files in token path.
2022-05-29 22:59:39 INFO     Loaded config from environment variables
2022-05-29 22:59:39 INFO     Debugging mode enabled
2022-05-29 22:59:39 DEBUG    Starting new HTTPS connection (1): apptoogoodtogo.com:443
2022-05-29 22:59:41 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 200 90
2022-05-29 22:59:41 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 22:59:41 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 22:59:47 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 22:59:47 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 22:59:53 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 22:59:53 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 22:59:58 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 22:59:58 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:04 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:04 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:10 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:10 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:15 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:15 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:21 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:21 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:27 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-05-29 23:00:27 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-05-29 23:00:32 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 200 1609
2022-05-29 23:00:32 INFO     Logged in!
2022-05-29 23:00:32 INFO     Activated notifiers:
2022-05-29 23:00:32 INFO     - WebHook: http://192.168.123.230:8123/api/webhook/toogoodtogonotifier
2022-05-29 23:00:32 INFO     Sending test Notifications ...
2022-05-29 23:00:33 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:33 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'a184f9f30346beb0a7a120cc9e17d7f3da50ad9989191b1920a6e4467ada6902\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:33 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:33 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'2b73887cabfd1731289609c2b0ee282ff9b8c0d3c221882d95065628c6638a86\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:33 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:33 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'f948090d0c98464bf658d7cec8157eb9e9b88c98d22ee1757e4452058a91d3c4\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:34 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:34 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'edc0e632b75d5f5cf7dc122fb536a1842a809e06749491540f53d3419c9bd97d\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:34 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:34 ERROR    get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'b5af1f820c76a5728f29a5f9f88095f8c1afb6a2cb09e4ca9176424ec8bbd461\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f9c5cd76200>)
2022-05-29 23:00:35 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-05-29 23:00:35 ERROR    TGTG API Error: (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA7La4L03z22MAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'e\':\'831473167cde3e7df99036816e3914ea1c4d1f5521fd44b516120218e16fdd68\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
2022-05-29 23:20:02 INFO       ____  ___  ____  ___    ____   ___   __   __ _  __ _  ____  ____  
2022-05-29 23:20:02 INFO      (_  _)/ __)(_  _)/ __)  / ___) / __) / _\ (  ( \(  ( \(  __)(  _ \ 
2022-05-29 23:20:02 INFO        )( ( (_ \  )( ( (_ \  \___ \( (__ /    \/    //    / ) _)  )   / 
2022-05-29 23:20:02 INFO       (__) \___/ (__) \___/  (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 
2022-05-29 23:20:02 INFO     
2022-05-29 23:20:02 INFO     Version 1.10.3
2022-05-29 23:20:02 INFO     ©2021, Henning Merklinger
2022-05-29 23:20:02 INFO     For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-05-29 23:20:02 INFO     
2022-05-29 23:20:02 WARNING  No token files in token path.
2022-05-29 23:20:02 INFO     Loaded config from environment variables
2022-05-29 23:20:02 INFO     Debugging mode enabled
2022-05-29 23:20:02 DEBUG    Starting new HTTPS connection (1): apptoogoodtogo.com:443
2022-05-29 23:20:03 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 403 546
2022-05-29 23:20:03 ERROR    (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMAdAdW-U58kwUAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35587,\'e\':\'d149a870524142b174c09d400b2fc841d11059be33d7ceb364b4667995bbd035\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
2022-05-29 23:20:03 ERROR    Configuration Error - Invalid TGTG configuration
2022-05-29 23:21:24 INFO       ____  ___  ____  ___    ____   ___   __   __ _  __ _  ____  ____  
2022-05-29 23:21:24 INFO      (_  _)/ __)(_  _)/ __)  / ___) / __) / _\ (  ( \(  ( \(  __)(  _ \ 
2022-05-29 23:21:24 INFO        )( ( (_ \  )( ( (_ \  \___ \( (__ /    \/    //    / ) _)  )   / 
2022-05-29 23:21:24 INFO       (__) \___/ (__) \___/  (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 
2022-05-29 23:21:24 INFO     
2022-05-29 23:21:24 INFO     Version 1.10.3
2022-05-29 23:21:24 INFO     ©2021, Henning Merklinger
2022-05-29 23:21:24 INFO     For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-05-29 23:21:24 INFO     
2022-05-29 23:21:24 WARNING  No token files in token path.
2022-05-29 23:21:24 INFO     Loaded config from environment variables
2022-05-29 23:21:24 INFO     Debugging mode enabled
2022-05-29 23:21:24 DEBUG    Starting new HTTPS connection (1): apptoogoodtogo.com:443
2022-05-29 23:21:24 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 403 546
2022-05-29 23:21:24 ERROR    (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA8tB1dw53Q2QAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35587,\'e\':\'612735b32d86515ab59aa5a983d27d676dd53aede69328d327396249fc4374f3\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
2022-05-29 23:21:24 ERROR    Configuration Error - Invalid TGTG configuration
2022-05-29 23:21:49 INFO       ____  ___  ____  ___    ____   ___   __   __ _  __ _  ____  ____  
2022-05-29 23:21:49 INFO      (_  _)/ __)(_  _)/ __)  / ___) / __) / _\ (  ( \(  ( \(  __)(  _ \ 
2022-05-29 23:21:49 INFO        )( ( (_ \  )( ( (_ \  \___ \( (__ /    \/    //    / ) _)  )   / 
2022-05-29 23:21:49 INFO       (__) \___/ (__) \___/  (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 
2022-05-29 23:21:49 INFO     
2022-05-29 23:21:49 INFO     Version 1.10.3
2022-05-29 23:21:49 INFO     ©2021, Henning Merklinger
2022-05-29 23:21:49 INFO     For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-05-29 23:21:49 INFO     
2022-05-29 23:21:49 WARNING  No token files in token path.
2022-05-29 23:21:49 INFO     Loaded config from environment variables
2022-05-29 23:21:49 INFO     Debugging mode enabled
2022-05-29 23:21:49 DEBUG    Starting new HTTPS connection (1): apptoogoodtogo.com:443
2022-05-29 23:21:49 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 403 546
2022-05-29 23:21:49 ERROR    (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMAviRp8Tz1HDkAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35587,\'e\':\'3cc445c426d49a745ebf486ce485e30f31a3eff50a99bd9ed9cca01e645c6bf3\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
2022-05-29 23:21:49 ERROR    Configuration Error - Invalid TGTG configuration
2022-05-30 19:43:38 INFO       ____  ___  ____  ___    ____   ___   __   __ _  __ _  ____  ____  
2022-05-30 19:43:38 INFO      (_  _)/ __)(_  _)/ __)  / ___) / __) / _\ (  ( \(  ( \(  __)(  _ \ 
2022-05-30 19:43:38 INFO        )( ( (_ \  )( ( (_ \  \___ \( (__ /    \/    //    / ) _)  )   / 
2022-05-30 19:43:38 INFO       (__) \___/ (__) \___/  (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 
2022-05-30 19:43:38 INFO     
2022-05-30 19:43:38 INFO     Version 1.10.3
2022-05-30 19:43:38 INFO     ©2021, Henning Merklinger
2022-05-30 19:43:38 INFO     For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-05-30 19:43:38 INFO     
2022-05-30 19:43:38 WARNING  No token files in token path.
2022-05-30 19:43:38 INFO     Loaded config from environment variables
2022-05-30 19:43:38 INFO     Debugging mode enabled
2022-05-30 19:43:38 DEBUG    Starting new HTTPS connection (1): apptoogoodtogo.com:443
2022-05-30 19:43:38 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 403 546
2022-05-30 19:43:38 ERROR    (403, b'<html><head><title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style></head><body style="margin:0"><p id="cmsg">Please enable JS and disable any ad blocker</p><script>var dd={\'cid\':\'AHrlqAAAAAMA4SM4iJIND8QAVZAS3g==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35587,\'e\':\'420f83939dc1b17e84ec63e2f98adfc05fa126217adda0f98738069c14cbf37b\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')
2022-05-30 19:43:38 ERROR    Configuration Error - Invalid TGTG configuration
Der-Henning commented 2 years ago

In the current release the tokens are saved after each successful item request. Since the item requests fails in your case no tokens are saved. In the next release the tokens will also be saved after the successful login procedure. 243e29166fdcff922c212e23c67699b8bebe3880

gogamid commented 2 years ago

@Der-Henning Thank you a lot! Latest release Version 1.10.4 in docker hub solved the 403 issue for me. In my Linux server, I pulled latest release with docker pull derhenning/tgtg then run the docker compose by sudo docker-compose up -d.

Der-Henning commented 2 years ago

Hi @gogamid. Thank you for the feedback. Feel free to open new issues if needed. Closing. Fixed with 632676d4e1ec067e2ff349feb7ab7c16df5b4e4e