Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TGTG API Error: 403 #93

Closed
vipera7 opened this issue May 18, 2022 · 6 comments
Closed

TGTG API Error: 403 #93

vipera7 opened this issue May 18, 2022 · 6 comments

Comments

@vipera7
Copy link

vipera7 commented May 18, 2022

Hello,

I'm running tg notifier through docker compose using the latest version (1.10.1). The bot was running smoothly since weeks and I upgraded it to the latest version, and I'm facing the following error :

[root@localhost toogoodtogo]# docker logs toogoodtogo_app_1
2022-05-18 16:40:55 INFO ____ ___ ____ ___ ____ ___ __ __ _ __ _ ____ ____
2022-05-18 16:40:55 INFO (_ )/ )( _)/ ) / ) / ) / \ ( ( ( ( ( )( _
2022-05-18 16:40:55 INFO )( ( (
\ )( ( (
\ _
( (
/ / // / ) _) ) /
2022-05-18 16:40:55 INFO () _
/ (
) __/ (
/ _)_/_/_))_)__)(_)(___)
2022-05-18 16:40:55 INFO
2022-05-18 16:40:55 INFO Version 1.10.1
2022-05-18 16:40:55 INFO ©2021, Henning Merklinger
2022-05-18 16:40:55 INFO For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-05-18 16:40:55 INFO
2022-05-18 16:40:55 INFO Loaded config from environment variables
2022-05-18 16:40:55 ERROR TGTG API Error: (403, b'<title>apptoogoodtogo.com</title><style>#cmsg{animation: A 1.5s;}@Keyframes A{0%{opacity:0;}99%{opacity:0;}100%{opacity:1;}}</style>

Please enable JS and disable any ad blocker

<script>var dd={'cid':'AHrlqAAAAAMANsAP9ysHbxEA2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'d930abc479b69a47d56bbc894c7f3fc8d5c47ef8fefcef7c1786c1502abd2f5b','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n')

Do we need to wait a new version to bypass the captcha ?

Thanks

@Der-Henning
Copy link
Owner

Hi @vipera7.
I am also running on docker with the latest version and don't have any issues. Do you use a very low SLEEP_TIME ?
Sometimes it helps to deactivate the scanner for some hours or reset your internet connection and get a new IP from you ISP.
Let me hear if the problem persists.

@vipera7
Copy link
Author

vipera7 commented May 18, 2022

I'm running the container on a VPS.
Here is my docker-compose.yml

version: "3.3"
services:
  app:
    image: derhenning/tgtg:latest         ## pre build image from docker hub
    #image: tgtg-scanner:latest           ## locally build image
    environment:
      - TZ=Europe/Paris                               ## Set timezone for pickupdate, otherwise will be utc
      - DEBUG=false                                   ## true for debug log messages
      - TGTG_USERNAME=SECRET@example.com       ## TGTG Username / Login EMail
      - SLEEP_TIME=60                                 ## Time to wait till next scan in seconds - default 60 seconds
      - ITEM_IDS=1,2,3,4                                     ## (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.gmail.com                      ## smtp Server - smtp.gmail.com for google
      - SMTP_PORT=465                                 ## smtp Server Port - 465 for google
      - SMTP_USERNAME=max.mustermann@gmail.com        ## smtp Login - your EMail for google
      - SMTP_PASSWORD=                                ## smtp Login Password - your Login PW for google
      - SMTP_TLS=true                                 ## enable TLS - true for google and most smtp servers
      - SMTP_SENDER=max.mustermann@gmail.com          ## sender adress - same as Login for google and most smtp servers
      - SMTP_RECIPIENT=max.mustermann@gmail.com       ## 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=true                                 ## true = enable notifications via Telegram
      - TELEGRAM_TOKEN=SECRET                               ## Telegram Bot token - see @botfather
      - TELEGRAM_CHAT_IDS=-SECRET                            ## Telegram Chat id, multiple ids separated by comma
      #- TELEGRAM_BODY=                               ## Optional message body as markdown, variables as described below
                                                      ## Example:
                                                      ## 'TELEGRAM_BODY={{`*$${{display_name}}*\n*Available*: $${{items_available}}\n*Rating*: $${{rating}}\n*Price*: $${{price}} $${{currency}}\n*Pickup*: $${{pickupdate}}`}}'

      - 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=false                                 ## true = enable notifications via costum WebHook
      - WEBHOOK_URL=                                  ## URL of your WebHook, can contain $${{variable}}
      - WEBHOOK_METHOD=POST                           ## Request Method
      - WEBHOOK_BODY=                                 ## Data to send, can contain $${{variable}}
      - WEBHOOK_TYPE=                                 ## Content-Type for header, default: text/plain
      - WEBHOOK_TIMEOUT=60                            ## Request Timeout
    volumes:
      - /home/tgnotifier/tokens:/tokens           ## volume to save TGTG credentials to reuse on next start up and avoid login mail
volumes:
  tokens:

Do I have to increase the SLEEP_TIME ? I don't think it will resolve because the container is running like 4-5 seconds before exiting Exited (1). Do I need to reboot the VPS ?

Thanks

@Der-Henning
Copy link
Owner

A SLEEP_TIME of 60 should be fine and normally doesn't trigger the "too many requests temporary ban" of the TGTG API.
Rebooting is always a good and cheap way to magically solve any problems :) So it is worth a try.
Usually the 403 is only a temporary ban that is resolved after some hours.
But you can try using a new IP if it is possible for your VPS.

@vipera7
Copy link
Author

vipera7 commented May 18, 2022

Thanks, I rebooted but I'm facing the same issue. I'll give a try tomorrow

1 similar comment
@vipera7
Copy link
Author

vipera7 commented May 18, 2022

Thanks, I rebooted but I'm facing the same issue. I'll give a try tomorrow

@vipera7
Copy link
Author

vipera7 commented May 19, 2022

It's working now. Thanks for the help !

@vipera7 vipera7 closed this as completed May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants