Giter Site home page Giter Site logo

der-henning / tgtg Goto Github PK

View Code? Open in Web Editor NEW
334.0 9.0 58.0 1.02 MB

Scanner for Too Good To Go Notifications

Home Page: https://github.com/Der-Henning/tgtg/wiki

License: GNU General Public License v3.0

Python 98.09% Dockerfile 1.42% Makefile 0.37% Procfile 0.02% Shell 0.11%
tgtg docker python notifications ifttt webhook pushsafer mail prometheus telegram

tgtg's Introduction

TGTG Scanner

Tests codecov GitHub Workflow Status GitHub release Docker Pulls

TGTG Scanner observes your favorite TGTG Magic Bags for newly available items and notifies you via mail, IFTTT, Ntfy, Telegram, PushSafer, Apprise or any other WebHook. Notifications will be sent when the available amount of Magic Bags rises from zero to something.

Additionally, the currently available amounts can be provided via an HTTP server.

Running in a docker container the scanner can be seamlessly integrated with OpenHab, Prometheus, and other automation, notification, and visualization services.

This software is provided as is without warranty of any kind. If you have problems, find bugs, or have suggestions for improvement feel free to create an issue or contribute to the project. Before creating an issue please refer to the FAQ.

Disclaimer

This Project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Too Good To Go, or any of its subsidiaries or its affiliates.

Too Good To Go explicitly forbids the use of their platform the way this tool does if you use it. In their Terms and Conditions, it says: "The Consumer must not misuse the Platform (including hacking or 'scraping')."

If you use this tool you do it at your own risk. Too Good To Go may stop you from doing so by (temporarily) blocking your access and may even delete your account.

Error 403

If you see the Error 403 in your logs please refer to the FAQ.

Installation

You can install this tool on any computer. For 24/7 notifications I recommended an installation on a NAS like Synology or a Raspberry Pi. You can also try to use a virtual cloud server.

If you have any problems or questions feel free to create an issue.

For configuration options please refer to the projects wiki: Configuration

You have the following three options to install the scanner, ascending in complexity:

Use a prebuilt binary

This is the simplest but least flexible solution suitable for most operating systems.

The binaries are built for latest Ubuntu, MacOS, and Windows running on an x64 architecture. If you are using another architecture like arm (e.g. RaspberryPi, Synology, etc.) you have to run from source, compile the binary yourself or use the docker images.

  1. Download latest Releases for your OS
  2. Unzip the archive
  3. Edit config.ini as described in the Wiki
  4. Run the scanner

You can run the scanner manually if you need it, add it to your startup or create a system service.

The executables for Windows and MacOS are not signed by Microsoft and Apple, which would be very expensive. On MacOS, you have to hold the control key while opening the file and on Windows, you have to confirm the displayed dialog.

Run with Docker

My preferred method for servers, NAS, and RapsberryPis is using the pre-build multi-arch Linux images available via Docker Hub. The images are built for Linux on amd64, arm64, armv7, armv6, and i386.

  1. Install Docker
  2. Copy and edit docker-compose.yml as described in the Wiki
  3. Run docker compose up -d

The container automatically creates a volume mounting \tokens where the app saves the TGTG credentials after login. These credentials will be reused at every start of the container to avoid the mail login process. To log in with a different account you have to delete the created volume or the files in it.

To update the running container to the latest version of the selected tag run

docker-compose pull
docker-compose up -d

Install as package

  1. Install Git, Python>=3.9 and pip
  2. Run pip install git+https://github.com/Der-Henning/tgtg
  3. Create config.ini as described in the Wiki
  4. Start scanner with python -m tgtg_scanner

To update to the latest release run pip install --upgrade git+https://github.com/Der-Henning/tgtg.

If you receive the ModuleNotFoundError: No module named '_ctypes' you may need to install libffi-dev.

Run from source

Method for advanced usage.

  1. Install Git, Python>=3.9 and poetry
  2. Clone the repository git clone https://github.com/Der-Henning/tgtg
  3. Enter repository folder cd tgtg
  4. Run poetry install --without test,build
  5. Create config file cp config.sample.ini config.ini
  6. Modify config.ini as described in the Wiki
  7. Run poetry run scanner

Alternatively, you can use environment variables as described in the wiki. The scanner will look for environment variables if no config.ini is present.

To update to the latest release run git pull.

If you receive the ModuleNotFoundError: No module named '_ctypes' you may need to install libffi-dev.

Build your own binary

You could also build your own binary for your OS/Arch combination.

  1. Clone the repository as described above
  2. Run poetry install --without test
  3. Run make executable

You will find the bundled binary including the config.ini in the ./dist directory.

Usage

When the scanner is started it will first try to log in to your TGTG account. Similar to logging in to the TGTG app, you have to click on the link sent to you by mail. This won't work on your mobile phone if you have installed the TGTG app, so you have to check your mailbox on your PC.

After a successful login, the scanner will send a test notification on all configured notifiers. If you don't receive any notifications, please check your configuration.

Helper functions

The executable or the tgtg_scanner/__main__.py contains some useful helper functions that can be accessed via optional command line arguments. Running scanner[.exe] --help, poetry run scanner --help, python tgtg_scanner/__main__.py --help or python -m tgtg_scanner --help displays the available commands.

usage: scanner [-h] [-v] [-d] [-c config_file] [-l log_file] [-t | -f | -F | -a item_id [item_id ...] | -r item_id [item_id ...] | -R] [-j | -J] [--base_url BASE_URL]

Notifications for Too Good To Go

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -d, --debug           activate debugging mode
  -c config_file, --config config_file
                        path to config file (default: config.ini)
  -l log_file, --log_file log_file
                        path to log file (default: scanner.log)
  -t, --tokens          display your current access tokens and exit
  -f, --favorites       display your favorites and exit
  -F, --favorite_ids    display the item ids of your favorites and exit
  -a item_id [item_id ...], --add item_id [item_id ...]
                        add item ids to favorites and exit
  -r item_id [item_id ...], --remove item_id [item_id ...]
                        remove item ids from favorites and exit
  -R, --remove_all      remove all favorites and exit
  -j, --json            output as plain json
  -J, --json_pretty     output as pretty json
  --base_url BASE_URL   Overwrite TGTG API URL for testing

Example (Unix only):

poetry run scanner -f -J >> items.json

Creates a formatted JSON file containing all your favorite items and their available information.

Metrics

Enabling the metrics option will expose an HTTP server on the specified port supplying the currently available items. You can scrape the data with Prometheus to create and visualize historic data or use it with your home automation.

Scrape config:

- job_name: 'TGTG'
  scrape_interval: 1m
  scheme: http
  metrics_path: /
  static_configs:
  - targets:
    - 'localhost:8000'

Development

For development, I recommend using docker.

If you are developing with VSCode, you can open the project in the configured development container including all required dependencies.

Alternatively, install all required development environment dependencies, including linting, testing, and building by executing

make install

For developement and testing it is sometimes usefull to trigger TGTG Magic Bag events. For this purpose you can run the TGTG dev API proxy server. The proxy redirects all requests to the official TGTG API server. The responses from the item endpoint are modified by randomizing the amount of available magic bags.

make server

Makefile commands

  • make install installs development dependencies and pre-commit hooks
  • make server starts TGTG dev API proxy server
  • make start runs the scanner with debugging and using the API proxy
  • make test runs unit tests
  • make lint run pre-commit hooks including linting and code checks
  • make executable creates a bundled executable in /dist
  • make images builds docker images with tag tgtg-scanner:latest and tgtg-scanner:latest-alpine

Creating new notifiers

Feel free to create and contribute new notifiers for other services and endpoints. You can use an existing notifier as a template or build upon the webhook notifier. E.g. see the ifttt notifier.


If you want to support me, feel free to buy me a coffee.

Buy Me A Coffee

tgtg's People

Contributors

abgd1234 avatar bisselch avatar crashcoq avatar dalins avatar dependabot[bot] avatar der-henning avatar floriandrott avatar floriegl avatar frazew avatar lars-devs avatar leonghui avatar maherm avatar mike221002 avatar nikdav avatar p0lycarpio avatar sjoerdj avatar thomasdelsart avatar tomekk3108 avatar tqnsls avatar web2brain avatar zinen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tgtg's Issues

TGTG API Error: (403...)

Hello,

I'm still getting the 403 issue, and I'm using the latest version :

2022-07-01 09:35:43 INFO ____ ___ ____ ___ ____ ___ __ __ _ __ _ ____ ____
2022-07-01 09:35:43 INFO (_ )/ )( _)/ ) / ) / ) / \ ( ( ( ( ( )( _
2022-07-01 09:35:43 INFO )( ( (
\ )( ( (
\ _
( (
/ / // / ) _) ) /
2022-07-01 09:35:43 INFO () _
/ (
) __/ (
/ _)_/_/_))_)__)(_)(___)
2022-07-01 09:35:43 INFO
2022-07-01 09:35:43 INFO Version 1.11.1_rc1
2022-07-01 09:35:43 INFO ©2021, Henning Merklinger
2022-07-01 09:35:43 INFO For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-07-01 09:35:43 INFO
2022-07-01 09:35:43 INFO Loaded config from environment variables
2022-07-01 09:35:43 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':'AHrlqAAAAAMAGsWl5av6ClIA2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'da9634dfedc6c595161d183c107298e88120ab6efd28440bf26abc13afaa6636','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n')

When I start the container it's exiting everytime. I also rebooted the server.
What can I do next ?

403 Error

403 Error popped out again
Solution found somewhere on the web :
USER_AGENTS = [
"TGTG/22.5.5 Dalvik/2.1.0 (Linux; U; Android 9; SM-G955F Build/PPR1.180610.011)"
]

Invalid telegram configuration

Hi

I was sucessfully able to run the scanner with my bot that was created round 5 years ago and I am unsing for home automation. Here the isssue is that the scanner is giving the error that it is already used in an nother instance what is true.

2022-06-25 06:20:56 WARNING You enabled the Telegram notifications without providing a chat id! 2022-06-25 06:20:56 WARNING Send 6266 to the bot in your desired chat. 2022-06-25 06:20:56 WARNING Waiting for code ... Traceback (most recent call last): File "scanner.py", line 238, in <module> File "scanner.py", line 223, in main File "scanner.py", line 73, in __init__ File "notifiers\__init__.py", line 18, in __init__ File "notifiers\telegram.py", line 38, in __init__ File "notifiers\telegram.py", line 109, in _get_chat_id File "telegram\ext\extbot.py", line 226, in get_updates File "telegram\bot.py", line 133, in decorator File "telegram\bot.py", line 3057, in get_updates File "telegram\bot.py", line 298, in _post File "telegram\utils\request.py", line 361, in post File "telegram\utils\request.py", line 283, in _request_wrapper telegram.error.Conflict: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running [12580] Failed to execute script 'scanner' due to unhandled exception!

When enting a chatID I got a sample notification and the scanner runs with the warning about multiple instances of the getUpdate request. Fine

Thats why I created an additional bot in telegram and here I see an issue. When using a new/additional bot the scanner reports an Error saying that the Telegram Configuration is invalid. I verified the token, tired to enable all possible right to the bot. No sucess.

2022-06-25 06:27:49 INFO Version 1.10.4 2022-06-25 06:27:49 INFO ©2021, Henning Merklinger 2022-06-25 06:27:49 INFO For documentation and support please visit https://github.com/Der-Henning/tgtg 2022-06-25 06:27:49 INFO 2022-06-25 06:27:49 INFO Loaded config from config.ini 2022-06-25 06:27:51 ERROR Configuration Error - Invalid Telegram configuration

I observed that the new bots token is longer than the one of my 5 years old bot.

Please check why this is not working or at least provide some more output for this error if possible to see why the condig is invalid.

Thank you in advance. Luke

Telegram

Hi,

Is it possible to integrate telegram?

getItem Error

i continuously get this error spammed in the console, it is runned on ubuntu 20.4, without anything else, what do i need to do?

2021-11-09 21:26:21 ERROR getItem 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\':\'AHrlqAAAAAMAzmoEBc3lcScAD6HzYw==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35560,\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7f210aea0f00>)

edit:
i tried restarting the scanner and i get this, i dont changed anything both in the config and in tgtg account/app:
2021-11-09 21:37:42 INFO ____ ___ ____ ___ ____ ___ __ __ _ __ _ ____ ____ 2021-11-09 21:37:42 INFO (_ _)/ __)(_ _)/ __) / ___) / __) / _\ ( ( \( ( \( __)( _ \ 2021-11-09 21:37:42 INFO )( ( (_ \ )( ( (_ \ \___ \( (__ / \/ // / ) _) ) / 2021-11-09 21:37:42 INFO (__) \___/ (__) \___/ (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 2021-11-09 21:37:42 INFO 2021-11-09 21:37:42 INFO Version 1.2.4 2021-11-09 21:37:42 INFO ©2021, Henning Merklinger 2021-11-09 21:37:42 INFO For documentation and support please visit https://github.com/Der-Henning/tgtg 2021-11-09 21:37:42 INFO 2021-11-09 21:37:42 INFO Loaded config from config.ini 2021-11-09 21:37:42 INFO Debugging mode enabled 2021-11-09 21:37:42 DEBUG Starting new HTTPS connection (1): apptoogoodtogo.com:443 2021-11-09 21:37:42 DEBUG https://apptoogoodtogo.com:443 "POST /api/auth/v1/loginByEmail HTTP/1.1" 403 475 2021-11-09 21:37:42 ERROR Configuration Error - Invalid TGTG configuration

Occasional error when sending notifications -

I get the following error on occasion when sending telegram notifications:

2022-08-16 07:58:03 ERROR urllib3 HTTPError ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

This is on the latest version 1.11.1

Once that error comes up, the program stops sending me any notifications entirely but continues running. That is the program continues detecting bags in my favourite, but then does not send any further notifications.

I have to exit the program, and then re-start again and then it works again.

I only have Telegram notifications set up as I was unable to set up the gmail SMTP using the default settings in the config file (replacing the e-mail with my gmail account, and entering my password).

WARNING Failed to get latest APK version!

When running the Windows prebuild release version 1.11.1 I get the following warning upon startup:

WARNING Failed to get latest APK version!

Not sure if this effects the running of the program or not, but have had several telegram notifications time out and not go through today, but the gmail notifications seem to work.

EMail notifications not working - test notification does work

As title

The initial test notification for Gmail email works on program start (docker) but notifications for actual stock doesn't seem to send an email

Debug enabled and result below:

2022-03-25 17:34:11 INFO Sending notifications for shopname - 1 bags available 2022-03-25 17:34:11 DEBUG Sending Mail Notification send: 'noop\r\n' reply: b'451 4.4.2 Timeout - closing connection. do8-20020a170906c10800b006dfe4h7edc6sm2525244ejc.61 - gsmtp\r\n' reply: retcode (451); Msg: b'4.4.2 Timeout - closing connection. do8-20020a170906220800b006dfe4d1edc6sm2525244ejc.61 - gsmtp' send: 'mail FROM:<[email protected]> size=428\r\n'

TGTG Login Not Working

I was logged in and the scanner was working, when i logged out to try a thing the token refreshed and with the same credentials i wasn't able to log in, i get TGTG configuration error, i also noticed that they don't use the password anymore, just the emailed code so i think it needs to be reworked, error: https://paste.ofcode.org/3w2ymv97sT6BfbqVDqkji9

How to get the right item ID

Hello,

I'm also wondering how to get the right ID. I think it's going throught the app and using the share link and search the id. Am I doing it right ?

Telegram notification error : "Timed out"

scanner.log

Hello!

I set up the scanner to receive notifications on Telegram but on the 5 times it should have sent me one because new bags were available, it only worked once. The other 4 times, an error "Timed out" occurred at the time it should send me a notification (like in the scanner.log at 17:16:42).

However there is no problem with the test notification that I received every time I launch the scanner. It also worked one other time but stopped just after, I have no idea why... By the way, I'm on MacOs.

Do you know where the problem could be ?

Thank you!

Can we add the note like 4.8/5

Can we add the note on the telegram notification ?

2022-05-10 14:16:03 INFO Sending notifications for Casino Supermarché - Cagnes Sur Mer - 4.8/8 - 1 bags available
instead of
2022-05-10 14:16:03 INFO Sending notifications for Casino Supermarché - Cagnes Sur Mer - 1 bags available

Add the ability to notify multiple Telegram Chat-IDs

I think it'd be great if it was possible to have Telegram notifications sent to multiple Chat-IDs at once.

As far as I can tell all it would take is for the config parser to be able to handle a list of IDs supplied via TELEGRAM_CHAT_ID= and then iterating over the IDs when sending the notifications from telegram.py.

I'd make a PR myself, but I don't really get how the config parsing works, sorry.

Issue: Unexpected notification behaviour

Test notifications fire, but "new amount" events don't trigger notifications.

On-startup test notification fires successfully (in my config, SMTP).

Scanner successfully watches item amounts and detects change, visible in human readable format in console.

However, no mail appears to be attempted when these events are occuring.

Invalid syntax

Invalid syntax in line 63

File "scanner.py", line 63
def _check_item(self, item: Item):
^
SyntaxError: invalid syntax

Operating system Linux (debian 8.11), python version 2.7.9

Password-based login unavailable?

Error we're getting:
“Configuration Error - Invalid TGTG configuration”

Meanwhile, looks like Android/iOS TGTG apps have deprecated password-based sign-on. Related?

TgtgAPIError 403

Hi, thanks for your app.
Unfortunately I've been getting 403 error messages for a longer time. That's why I haven't used the tgtg scanner for a while (> 7 days) and started it again today with the hope that 1.10.4 will fix it, login via email works but then only 403 error messages come again:

2022-06-19 18:56:59 INFO       ____  ___  ____  ___    ____   ___   __   __ _  __ _  ____  ____  
2022-06-19 18:56:59 INFO      (_  _)/ __)(_  _)/ __)  / ___) / __) / _\ (  ( \(  ( \(  __)(  _ \ 
2022-06-19 18:56:59 INFO        )( ( (_ \  )( ( (_ \  \___ \( (__ /    \/    //    / ) _)  )   / 
2022-06-19 18:56:59 INFO       (__) \___/ (__) \___/  (____/ \___)\_/\_/\_)__)\_)__)(____)(__\_) 
2022-06-19 18:56:59 INFO     
2022-06-19 18:56:59 INFO     Version 1.10.4
2022-06-19 18:56:59 INFO     ©2021, Henning Merklinger
2022-06-19 18:56:59 INFO     For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-06-19 18:56:59 INFO     
2022-06-19 18:56:59 WARNING  No token files in token path.
2022-06-19 18:56:59 INFO     Loaded config from environment variables
2022-06-19 18:56:59 INFO     Debugging mode enabled
2022-06-19 18:56:59 DEBUG    Starting new HTTPS connection (1): apptoogoodtogo.com:443
2022-06-19 18:57:00 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByEmail HTTP/1.1" 200 None
2022-06-19 18:57:00 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-06-19 18:57:00 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-06-19 18:57:05 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 202 0
2022-06-19 18:57:05 WARNING  Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)
2022-06-19 18:57:10 DEBUG    https://apptoogoodtogo.com:443 "POST /api/auth/v3/authByRequestPollingId HTTP/1.1" 200 None
2022-06-19 18:57:10 INFO     Logged in!
2022-06-19 18:57:10 INFO     Metrics server startet on port 8000
2022-06-19 18:57:10 INFO     Activated notifiers:
2022-06-19 18:57:10 INFO     Scanner started ...
2022-06-19 18:57:10 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:57:10 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:57:10 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:57:10 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:57:10 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:57:10 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:57:10 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:57:10 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:57:10 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:57:10 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:57:10 DEBUG    new State: {}
2022-06-19 18:58:11 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:58:11 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:58:11 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:58:11 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:58:11 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:58:11 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:58:11 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:58:11 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={<redacted>\'e\':\'...\',\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n'), <traceback object at 0x7fad044c1680>)
2022-06-19 18:58:11 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 403 546
2022-06-19 18:58:11 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={<redacted>\'e\'ˇ

Any tips?

Build of 1.3.1 for Linux issue

The build either thinks it's 1.3.0 while there's an update available (for 1.3.1); or the build actually is 1.3.0 and the build labelled 1.3.1 is in fact a an build (for 1.3.0).

Meanwhile, the build reports "ERROR Configuration Error - Invalid TGTG configuration".

Thanks for all your help as always.

How did you figure out the API endpoints used by this app?

Hi!

Really cewl and hany tool!
I'm wondering how did you figure out the API endpoints used by this app.

I would like to build something similar for a different kind of app, but don't know API endpoints it uses.
I tried to figure that out with proxying all the http requests of my phone but that didn't work out.

Really looking forward to know how you did it.

Cheers

Crash on launch

Error:
“Configuration Error - Invalid TGTG configuration”

The program's crashing on launch, it was working fine a few days ago.

I'm using the latest Windows zip

Question: Debug mode ambiguity

Does debug mode actually suppress notifications, or does it just increase the level of reporting verbosity in the console?

tgtg scanner for windows

when I download the tgtg scanner for windows it still says it is version 1.10.4 and not the latest version 1.11.0

More information in notifications/messages on telegram & Stock tracking

Hi. I like this program you have wrote however there are a few suggestions I would like to make to help improve it. For example if you have the app installed there is a share function and you might be able to scrape the share data from it and include it in the message for the user to just click on it and reserve a bag with the app.

for example

image

The next idea is being able to track items stock levels and provide message updates to tell the user if there is added stock or less stock or if the item becomes sold out.

for example

image

please let me know what you think. thanks.

Issue

Hi, have some issues with the program and is there an option that I can contact you to send some screenshots?

Script don't read docker-compose.yml in docker

Hello.

I've placed docker-compose.yml (and edited, ofcourse) in the right folder, but the script gives error: Unexpected Error! - (<class 'TypeError'>, TypeError('You must provide at least email or access_token, refresh_token and user_id'), <traceback object at 0x7f8599d4f980>)

File placed in /var/lib/docker/containers/04f596f96f2613227932f1d29335f968b21303293d33be42ccdd111780f70fbb/

After running: docker-compose up -d the error:

ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?

    Supported filenames: docker-compose.yml, docker-compose.yaml, compose.yml, compose.yaml

what i'm doing wrong?
I'm new with docker, i'm sorry if i'm doing things wrong.

get item error!

Hello,

My container is running since 2 weeks. I'm getting some error doing docker logs tgnotifier

Here are the logs :

2022-05-27 12:48:03 ERROR get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(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':'AHrlqAAAAAMAJ-F87cBnZ78A2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'357168bb20bd32a92ba3edbdc3e6de436e2f7734ce4ade68b92bef85c1953dfa','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n'), <traceback object at 0x7f999afd0700>)
2022-05-27 12:48:03 ERROR get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(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':'AHrlqAAAAAMAJ-F87cBnZ78A2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'ade6551fdce774669f820e5a4c786e6c9341b0ac39df9248824a2b0010b0ff52','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n'), <traceback object at 0x7f999afd0700>)
2022-05-27 12:48:03 ERROR get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(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':'AHrlqAAAAAMAJ-F87cBnZ78A2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'d817662027b827580ae1f8a855aedf75ca101bcb80ffa1d9ab8bf2a5becf7bf1','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n'), <traceback object at 0x7f999afd0700>)
2022-05-27 12:49:39 ERROR itemID 461919 Error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(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':'AHrlqAAAAAMAJ-F87cBnZ78A2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'54e8933a533f349b130f2e1079b87f1a7669971d6a7070ddcbf9c3865e69e50c','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n'), <traceback object at 0x7f99986ef380>)
2022-05-27 12:50:51 ERROR itemID 479359 Error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(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':'AHrlqAAAAAMAJ-F87cBnZ78A2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'9cd1a3d8108ae710bb8af1711889d07fd529a2acfe27acf45a8ccaee0cb49456','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n'), <traceback object at 0x7f999a7ea200>)
2022-05-27 12:53:46 ERROR itemID 428645 Error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(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':'AHrlqAAAAAMAJ-F87cBnZ78A2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'4df48996670412d4e9ec4a2dcb8b3f5d99a1209a3f4e3402fa0dd3a218a47886','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n'), <traceback object at 0x7f99986f1640>)
2022-05-27 12:58:17 ERROR itemID 478268 Error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(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':'AHrlqAAAAAMAJ-F87cBnZ78A2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'2bc2a5cca4c9a4e756e45191c8a85038dbe5bdb3d4b079a11414440211c5b686','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n'), <traceback object at 0x7f99986d5200>)
2022-05-27 13:01:55 ERROR get item error! - (<class 'requests.exceptions.ConnectionError'>, ConnectionError(MaxRetryError("HTTPSConnectionPool(host='apptoogoodtogo.com', port=443): Max retries exceeded with url: /api/item/v7/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9998678d60>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))")), <traceback object at 0x7f99986f1640>)

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
      - [email protected]       ## TGTG Username / Login EMail
      - SLEEP_TIME=60                                 ## Time to wait till next scan in seconds - default 60 seconds
      - ITEM_IDS=451911          ## (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
      - [email protected]        ## 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
      - [email protected]          ## sender adress - same as Login for google and most smtp servers
      - [email protected]       ## 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=111111111:111111                               ## Telegram Bot token - see @botfather
      - TELEGRAM_CHAT_IDS=-111111                            ## 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:

Thanks for any help

% symbol in passwords is not escaped

Hi,

I just discovered that the % symbol in passwords breaks the app if it is not explicitly escaped with %% (I guess because Python interprets it as a template placeholder). Just a small cosmetic issue, but wanted to let you know anyway.

"status":401,"error" version 1.10.4

Just updated to the new version, but i'm receiving the error below (on windows)

2022-06-27 20:06:23 ERROR get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(401, b'{"timestamp":1656353183890,"status":401,"error":"Unauthorized","path":"/api/item/v7/"}'), <traceback object at 0x000002037E603C40>)
2022-06-27 20:06:24 ERROR get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(401, b'{"timestamp":1656353184219,"status":401,"error":"Unauthorized","path":"/api/item/v7/"}'), <traceback object at 0x000002037E6087C0>)
2022-06-27 20:06:24 ERROR get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(401, b'{"timestamp":1656353184538,"status":401,"error":"Unauthorized","path":"/api/item/v7/"}'), <traceback object at 0x000002037E6087C0>)
2022-06-27 20:06:24 ERROR get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(401, b'{"timestamp":1656353184729,"status":401,"error":"Unauthorized","path":"/api/item/v7/"}'), <traceback object at 0x000002037E6087C0>)
2022-06-27 20:06:25 ERROR get item error! - (<class 'models.errors.TgtgAPIError'>, TgtgAPIError(401, b'{"timestamp":1656353185049,"status":401,"error":"Unauthorized","path":"/api/item/v7/"}'), <traceback object at 0x000002037E6087C0>)
2022-06-27 20:06:25 ERROR TGTG API Error: (401, b'{"timestamp":1656353185364,"status":401,"error":"Unauthorized","path":"/api/item/v7/"}')

Can't get Discord webhook to work

I can't get the webhook notifier to work with Discord. The test notification sends fine, but then it doesn't send any more messages for the rest of the session (maybe due to the 204 response?).

python src/scanner.py:

2022-04-11 14:56:01 INFO     Activated notifiers:
2022-04-11 14:56:01 INFO     - WebHook: https://discord.com/api/webhooks/XXXXXX/XXXXXX
2022-04-11 14:56:01 INFO     Sending test notifications ...
2022-04-11 14:56:01 DEBUG    Sending WebHook Notification
2022-04-11 14:56:01 DEBUG    Webhook url: https://discord.com/api/webhooks/XXXXXX/XXXXXX
2022-04-11 14:56:01 DEBUG    Webhook headers: {'Content-Type': 'application/json'}
2022-04-11 14:56:01 DEBUG    Webhook body: {"content": "hi"}
2022-04-11 14:56:01 DEBUG    Starting new HTTPS connection (1): discord.com:443
2022-04-11 14:56:01 DEBUG    https://discord.com:443 "POST /api/webhooks/XXXXXX/XXXXXX HTTP/1.1" 204 0
2022-04-11 14:56:01 ERROR    WebHook Request failed with status code 204
2022-04-11 14:56:01 INFO     Scanner started ...
2022-04-11 14:56:01 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 200 None
2022-04-11 14:56:01 DEBUG    new State: {'XXXXXX': 1, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0}
2022-04-11 14:57:04 DEBUG    https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 200 None
2022-04-11 14:57:04 DEBUG    new State: {'XXXXXX': 1, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0, 'XXXXXX': 0}

My config.ini looks like this for the Discord webhook:

[WEBHOOK]
enabled = true
URL = https://discord.com/api/webhooks/XXXXXX/XXXXXX
Method = POST
body = {"content": "hi"}
type = application/json
timeout = 60

Thanks!

TGTG API Error: 403 (recaptcha)

I think it was fun as long as it lasted, or do you have a solution in mind?
2022-02-17 11:59:33 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\':\'AHrlqAAAAAMAZo-yyBw10l8AkTX8xA==\',\'hsh\':\'1D42C2CA6131C526E09F294FE96F94\',\'t\':\'fe\',\'r\':\'b\',\'s\':35558,\'host\':\'geo.captcha-delivery.com\'}</script><script src="https://ct.captcha-delivery.com/c.js"></script></body></html>\n')

Not found any records.

Hi, I have a problem with docker version (not tested another).
I see in logs:
2022-08-26 20:26:31 DEBUG https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 200 None 2022-08-26T18:26:31.499435705Z 2022-08-26 20:26:31 DEBUG new State: {} 2022-08-26T18:27:30.243069839Z 2022-08-26 20:27:30 DEBUG https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 200 None 2022-08-26T18:27:30.245633120Z 2022-08-26 20:27:30 DEBUG new State: {} 2022-08-26T18:28:30.942151624Z 2022-08-26 20:28:30 DEBUG https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 200 None 2022-08-26T18:28:30.944585868Z 2022-08-26 20:28:30 DEBUG new State: {} 2022-08-26T18:29:30.919015847Z 2022-08-26 20:29:30 DEBUG https://apptoogoodtogo.com:443 "POST /api/item/v7/ HTTP/1.1" 200 None 2022-08-26T18:29:30.921535646Z 2022-08-26 20:29:30 DEBUG new State: {}

and no notifications was send (I use PushSafer and test notification is ok).
On the phone (in same time) in the application, I normally see opportunities to intercept.
I set correct email address and timezone in docker-compose file.
Where is the problem?

Captcha Error in Ubuntu AWS

Hello,

a new issue popped up when trying to run scanner on AWS ubuntu.
Seems tgtg added a captcha to it's login process when coming from certain IPs? (did some github search, this is an issue with another project as well)

Anything we can do about it? So far no success walking around this.

For reference this is the error message:

(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':'AHrlqAAAMA5VLBIC9MQALMlnQ==','hsh':'xxx','t':'fe','r':'b','s':35587,'host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n')

Question: Unexpected Repeat Identical Notifications (solved)

Expected: notifications are sent when quantity available changes since last email. notifications are sent out only on numeric change to quantity available.

What happens: identical notifications can be sent in rapid succession with identical quantity available. This means repeat emails in succession alert with same quantity number

Debug print-out: {missing} (Next time this happens I will try to print/paste-out the debug information. Because I missed the last occurrence by 30 minutes to share here. And I don't see the debug info is logged to file anywhere (?).)

Affected: v1.2.1 of this repo †; also legacy ▅▅-notifications.com suffered from this issue ‡ from time to time.


This could be because the quantity goes up and down again to the same number between checks/notifications, but I don't think it's intended behaviour for notifications to be sent out as they are now.

Screenshots:—
•† example: https://ibb.co/3mLXYbF
•‡ example: https://ibb.co/v3y542X

Error when running

I get the following error code when running:

Jul 01 15:41:54 pi systemd[1]: Started TooGoodToGo.
Jul 01 15:41:55 pi python3[10189]: Traceback (most recent call last):
Jul 01 15:41:55 pi python3[10189]: File "/home/pi/Desktop/tgtg-1.11.0/src/scanner.py", line 33, in
Jul 01 15:41:55 pi python3[10189]: class Scanner():
Jul 01 15:41:55 pi python3[10189]: File "/home/pi/Desktop/tgtg-1.11.0/src/scanner.py", line 115, in Scanner
Jul 01 15:41:55 pi python3[10189]: def _get_favorites(self) -> list[Item]:
Jul 01 15:41:55 pi python3[10189]: TypeError: 'type' object is not subscriptable
Jul 01 15:41:55 pi systemd[1]: 2good2go.service: Main process exited, code=exited, status=1/FAILURE
Jul 01 15:41:55 pi systemd[1]: 2good2go.service: Failed with result 'exit-code'.

What am I doing wrong?

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

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.

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)", ]

tgtg scanner for linux aarch64 arm

HI,
I would like to put the application on Oracle free tier cloud "always free" for Arm Ampere A1 Compute : scanner-linux-v1.6.0.
The executable "scanner" is for x86-64 and does not work for aarc64 Arm.
Can you add a version compatible with this platform ?
Thanks

SMTP Configuration not working

I've tried both on linux and windows with latest version but i always get that the SMTP configuration is not working, even with your defaults, these are my settings:
[SMTP]

SMTP Settings / Example for gmail

SMTP = true
enabled = true
Host = smtp.gmail.com
Port = 465
Username = my secondary mail
Password = my secondary mail password
TLS = true
Sender = my secondary mail
Recipient = my personal mail

Activate only PUSHSAVER

Hi,

2022-02-03 18:49:39 WARNING Check your mailbox on PC to continue... (Mailbox on mobile won't work, if you have installed tgtg app.)

I have this issue, but I dont want to use mail...

thanks a lot for your work !

TGTG API Error: 403

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

TGTG API Error: (403...)

Hello,

I'm still getting the following issue using the latest version :

2022-07-01 09:35:43 INFO ____ ___ ____ ___ ____ ___ __ __ _ __ _ ____ ____
2022-07-01 09:35:43 INFO (_ )/ )( _)/ ) / ) / ) / \ ( ( ( ( ( )( _
2022-07-01 09:35:43 INFO )( ( (
\ )( ( (
\ _
( (
/ / // / ) _) ) /
2022-07-01 09:35:43 INFO () _
/ (
) __/ (
/ _)_/_/_))_)__)(_)(___)
2022-07-01 09:35:43 INFO
2022-07-01 09:35:43 INFO Version 1.11.1_rc1
2022-07-01 09:35:43 INFO ©2021, Henning Merklinger
2022-07-01 09:35:43 INFO For documentation and support please visit https://github.com/Der-Henning/tgtg
2022-07-01 09:35:43 INFO
2022-07-01 09:35:43 INFO Loaded config from environment variables
2022-07-01 09:35:43 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':'AHrlqAAAAAMAGsWl5av6ClIA2aA2Pw==','hsh':'1D42C2CA6131C526E09F294FE96F94','t':'fe','r':'b','s':35558,'e':'da9634dfedc6c595161d183c107298e88120ab6efd28440bf26abc13afaa6636','host':'geo.captcha-delivery.com'}</script><script src="https://ct.captcha-delivery.com/c.js"></script>\n')

The container is instantly exiting, I have no idea what I can do. I also rebooted the server.

Improve obfuscation measures

I thought about a few things that might help to avoid or at least delay this bot being detected by TGTG.

  • Randomized SLEEP_TIME between a lower and upper bound resulting in less regular refresh intervals.
  • Schedule active and inactive hours (i.e. active only 08:00 - 22:00) resulting in more realistic usage patterns.

Obviously I realize this introduces a lot of possibly unwanted complexity, but I wanted to make these suggestions nonetheless.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.