marklagendijk/node-toogoodtogo-watcher

apptoogoodtogo.com/api/item/v8 - 403 Error

Opened this issue ยท 11 comments

I think I have configured it correctly, logged in, and ran the watch command.

root@ubuntu-s-1vcpu-1gb-nyc1-01:/var/www/tgtg-watcher# toogoodtogo-watcher watch
Error during request:
POST https://apptoogoodtogo.com/api/item/v8/
undefined

HTTPError: Response code 403 ()
    at Request.<anonymous> (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:628:26)
    at Request.emit (node:events:525:35)
    at Request._onResponseBase (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:726:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:765:13)
Error during request:
POST https://apptoogoodtogo.com/api/item/v8/
undefined

HTTPError: Response code 403 ()
    at Request.<anonymous> (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:628:26)
    at Request.emit (node:events:525:35)
    at Request._onResponseBase (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:726:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:765:13)
Error during request:
POST https://apptoogoodtogo.com/api/item/v8/
undefined

HTTPError: Response code 403 ()
    at Request.<anonymous> (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:628:26)
    at Request.emit (node:events:525:35)
    at Request._onResponseBase (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:726:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Request._onResponse (file:///root/.nvm/versions/node/v18.13.0/lib/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:765:13)

Do you have set some favorites in your TGTG app?
I think I've seen this error before, which occurs when no favorites are defined in order to be checked by the application.

Same issue for me and I do have favorites.

I've also have this issue, with favorites

Strange error tbh...
The last change regarding any api v8 was here

#210

and it was just the small endpoint change from v7 to v8 and worked again. I'm not experiencing the error you've described. Which notifications did you set to TRUE?

fxhuhn commented

Same here, after relogin it worked for a couple of hours
toogoodtogo-watcher.pdf

Maybe they updated their API again and it's just v9 now instead of v8? Can somebody try just like here

#210

UPDT: It has to be something else, just tried v9 and did not work, but with v8 it still does. Just noticed though that from time to time i get a similar error like this one here, to be precise it's the one from #210 but this time it just shows the error but keeps working.

TooGoodToGo has added a bot check to its api. I've also got this in my app where I have to slide a puzzle tile to the correct position in an image.

Have a look at #231
It contains a description how to add the verification result (User-Agent & Datadome Cookie) to the config. For me this has worked.

gblanc commented

Hello, for me it doesn't work...
I work with docker, I have added datadome in my config file and I have always this error :

Error during request:
toogoodtogo-watcher_1 | POST https://apptoogoodtogo.com/api/auth/v3/token/refresh
toogoodtogo-watcher_1 | undefined
toogoodtogo-watcher_1 |
toogoodtogo-watcher_1 | HTTPError: Response code 403 (Forbidden)
toogoodtogo-watcher_1 | at Request. (file:///home/node/app/node_modules/got/dist/source/as-promise/index.js:86:42)
toogoodtogo-watcher_1 | at Object.onceWrapper (node:events:628:26)
toogoodtogo-watcher_1 | at Request.emit (node:events:525:35)
toogoodtogo-watcher_1 | at Request._onResponseBase (file:///home/node/app/node_modules/got/dist/source/core/index.js:726:22)
toogoodtogo-watcher_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
toogoodtogo-watcher_1 | at async Request._onResponse (file:///home/node/app/node_modules/got/dist/source/core/index.js:765:13)
toogoodtogo-watcher_1 | Error during request:
toogoodtogo-watcher_1 | POST https://apptoogoodtogo.com/api/auth/v3/token/refresh

Same here, I also deleted my saved credentials from the config file, thinking it had something to do with the refresh token not being valid anymore, but still getting 403s

yldun commented

Hello,

I had the same error
HTTPError: Response code 403 (Forbidden) at Request. (file:///home/node/app/node_modules/got/dist/source/as-promise/index.js:86:42)
I replaced Node 19.X.Y with Node 20.X.Y and everything is now working though I had to remove nodejs then reinstall it from here https://github.com/nodesource/distributions#debinstall

FYI - the datadome cookie seems to expire from time to time, which could result in certain errors, which was the case for me. In this case just get a new one via

https://apptoogoodtogo.com/api/item/v8/

solve the captcha and edit the config accordingly.
After that, it worked again for me.

UPDT:
The error messages still appear but the notifications are working. :)