Closed li7vinov-denis closed 9 months ago
Just tested but didn't change anythings for me. It's installed on a RPi using my home IP.
I got the same i got it running on a NUC can't change my ip adres. The app is working normal on the same ip adres
Did you changed coordinates in configuration using -config
command?
I double check the changes I made from your pull but still have this error...
Saved config at: /home/data/tgtg-bot/.config/toogoodtogo-watcher-nodejs/config.json node:events:495 throw er; // Unhandled 'error' event ^
Error: spawn vim ENOENT at ChildProcess._handle.onexit (node:internal/child_process:284:19) at onErrorNT (node:internal/child_process:477:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Emitted 'error' event on ChildProcess instance at: at ChildProcess._handle.onexit (node:internal/child_process:290:12) at onErrorNT (node:internal/child_process:477:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -2, code: 'ENOENT', syscall: 'spawn vim', path: 'vim', spawnargs: [ '/home/data/tgtg-bot/.config/toogoodtogo-watcher-nodejs/config.json' ] }
Node.js v18.19.0
Did you changed coordinates in configuration using
-config
command?
I just changed it in the config file as i have the same error as zig I had VIM not installed that was the problem. But i changed it according to your changes yes.
Do the changes work for someone?
No change for me !
@li7vinov-denis do you have a docker image with these changes published somewhere?
I can't get it to work anymore either.
Problem is that all of your sessions have probably expired, and the captcha cannot be avoided by sending the coordinates when logging back in. You'll have to log in using the app e.g. through an emulator, then copy access/refresh tokens and datadome cookie into the config manually. Then it should work.
Tried to re-auth with the code in the PR but it seems the captcha is still being triggered. I'm still getting a 403 response
Something went wrong: HTTPError: Response code 403 (Forbidden)
at Request.<anonymous> (file:///home/node/app/node_modules/got/dist/source/as-promise/index.js:86:42)
at Object.onceWrapper (node:events:632:26)
at Request.emit (node:events:529:35)
at Request._onResponseBase (file:///home/node/app/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:///home/node/app/node_modules/got/dist/source/core/index.js:765:13)
....
Problem is that all of your sessions have probably expired, and the captcha cannot be avoided by sending the coordinates when logging back in. You'll have to log in using the app e.g. through an emulator, then copy access/refresh tokens and datadome cookie into the config manually. Then it should work.
I'm not sure this is the long term solution. Before updating to latest version of this application, I just did that, since the datadome cookie I got from solving the captcha or just opening
https://apptoogoodtogo.com/api/auth/v3/token/refresh
has a max. validity and basically expired every couple of days. After the update this was not necessary anymore.
Where do you put the datadome in config files ?
Weird things is that login is working using a tgtg-python script. And trigger the (old one??) email link/digit code verification process.
EDIT : Python script not working from now... Asking for captcha code
Where do you put the datadome in config files ?
Weird things is that login is working using a tgtg-python script. And trigger the (old one??) email link/digit code verification process.
This is described here
https://github.com/marklagendijk/node-toogoodtogo-watcher/issues/201#issuecomment-1399439700
how the datadome cookie was added manually before the latest update to the application, which should have made this redundant.
Ok thanks for the link :) Used this https://github.com/marklagendijk/node-toogoodtogo-watcher/issues/231#issue-1668501045 to get my cookie datadome and it's working well now !
Ok thanks for the link :) Used this https://github.com/marklagendijk/node-toogoodtogo-watcher/issues/231#issue-1668501045 to get my cookie datadome and it's working well now !
Ok, then I will do the same. Please keep us updated, how long the cookie is valid or if it expires at all.
For me opening the https://apptoogoodtogo.com/api/auth/v3/token/refresh website doesn't show any captcha to solve (shows text with 405 GET error, which shouldn't be any problem). I can still get my cookie datadome however, but after adding to the config file there's still the 403 error. Can't login in the tgtg watcher too due to the same error
Even from another web browser ? Or try clean you web browser cookies/sessions.
Also try emptying the "session" section
"session": { },
Then try to login.
For me opening the https://apptoogoodtogo.com/api/auth/v3/token/refresh website doesn't show any captcha to solve (shows text with 405 GET error, which shouldn't be any problem). I can still get my cookie datadome however, but after adding to the config file there's still the 403 error. Can't login in the tgtg watcher too due to the same error
Same here. Started off greenfield and getting the 403 even at log in stage, so that an email is not sent.
EDIT: It's not an IP related issue btw, since I tried starting off fresh with a different IP as well.
Even from another web browser ? Or try clean you web browser cookies/sessions. Also try emptying the "session" section
"session": { },
Then try to login.
Already tried all of that, still the same issue
Ok, got it working miraculously. In the config beside "cookie" I've also put "user-agent" like this:
"headers": { "User-Agent": "TooGoodToGo/23.12.1 (550) (iPhone/iPhone 11 (GSM); iOS 16.3.1; Scale/2.00)", "Cookie": "" }
Put your datadome after the cookie. What I've done to make it work is that I changed the app version in the "user-agent" to the latest one, which is 23.12.1 and it started working.
Ok, got it working miraculously. In the config beside "cookie" I've also put "user-agent" like this:
"headers": { "User-Agent": "TooGoodToGo/23.12.1 (550) (iPhone/iPhone 11 (GSM); iOS 16.3.1; Scale/2.00)", "Cookie": "" }
Put your datadome after the cookie. What I've done to make it work is that I changed the app version in the "user-agent" to the latest one, which is 23.12.1 and it started working.
Yup, that did it also for me. Log-in and watching works! I started from scratch with reinstalling Node as well as the application itsself. Thanks! :)
I hope that the cookie is not expiring any time soon.
Thank you its working again
am not able to retrieve the datadome anymore from https://apptoogoodtogo.com/api/auth/v3/token/refresh
I just get: {"type":"about:blank","title":"Method Not Allowed","status":405,"detail":"Method 'GET' is not supported.","instance":"/api/auth/v3/token/refresh"}
and when I go to the network tab in the dev tools I just see this:
Any idea on what could be wrong?
am not able to retrieve the datadome anymore from
https://apptoogoodtogo.com/api/auth/v3/token/refresh
I just get:
{"type":"about:blank","title":"Method Not Allowed","status":405,"detail":"Method 'GET' is not supported.","instance":"/api/auth/v3/token/refresh"}
and when I go to the network tab in the dev tools I just see this:Any idea on what could be wrong?
The refresh doc with the error code 403 should have the information regarding the cookie, at least that's where I got it from. That GET is not allowed anymore as method is new, but nevertheless you get a cookie, so it doesn't matter in the end.
thanks it work for me.
:)
I tried to apply NickXDD's solution but after trying everything I can't do it. could someone help me?
I tried to apply NickXDD's solution but after trying everything I can't do it. could someone help me?
What kind of errors do you get?
I tried to apply NickXDD's solution but after trying everything I can't do it. could someone help me?
What kind of errors do you get?
Something went wrong: HTTPError: Response code 403 () at Request.<anonymous> (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42) at Object.onceWrapper (node:events:629:26) at Request.emit (node:events:526:35) at Request._onResponseBase (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:727:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Request._onResponse (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:766:13)
I tried to apply NickXDD's solution but after trying everything I can't do it. could someone help me?
What kind of errors do you get?
Something went wrong: HTTPError: Response code 403 () at Request.<anonymous> (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42) at Object.onceWrapper (node:events:629:26) at Request.emit (node:events:526:35) at Request._onResponseBase (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:727:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Request._onResponse (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:766:13)
Hm...hard to say tbh. I would start completely from scratch and then apply the changes mentioned here. That's how I got it start working.
am not able to retrieve the datadome anymore from
https://apptoogoodtogo.com/api/auth/v3/token/refresh
I just get:{"type":"about:blank","title":"Method Not Allowed","status":405,"detail":"Method 'GET' is not supported.","instance":"/api/auth/v3/token/refresh"}
and when I go to the network tab in the dev tools I just see this:Any idea on what could be wrong?
The refresh doc with the error code 403 should have the information regarding the cookie, at least that's where I got it from. That GET is not allowed anymore as method is new, but nevertheless you get a cookie, so it doesn't matter in the end.
Hmm not sure I get it. Before I just had to copy the value from the datadome field and it was working. Now there is no datadome field at all.
am not able to retrieve the datadome anymore from
https://apptoogoodtogo.com/api/auth/v3/token/refresh
I just get:{"type":"about:blank","title":"Method Not Allowed","status":405,"detail":"Method 'GET' is not supported.","instance":"/api/auth/v3/token/refresh"}
and when I go to the network tab in the dev tools I just see this:Any idea on what could be wrong?
The refresh doc with the error code 403 should have the information regarding the cookie, at least that's where I got it from. That GET is not allowed anymore as method is new, but nevertheless you get a cookie, so it doesn't matter in the end.
Hmm not sure I get it. Before I just had to copy the value from the datadome field and it was working. Now there is no datadome field at all.
There should be a datadome value. It should be in the details of the network tab in the developer tools for the refresh value where you get the 405, when you click on it. Somewhere with the value 'cookie' or 'set-cookie' At least, that's where I found it. I use firefox btw.
J'ai essayé d'appliquer la solution de NickXDD mais après avoir tout essayé, je n'y arrive pas. quelqu'un pourrait-il m'aider ?
Quel genre d'erreurs obtenez-vous ?
Something went wrong: HTTPError: Response code 403 () at Request.<anonymous> (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42) at Object.onceWrapper (node:events:629:26) at Request.emit (node:events:526:35) at Request._onResponseBase (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:727:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Request._onResponse (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:766:13)
Hm... difficile à dire, à vrai dire. Je repartirais complètement de zéro, puis appliquerais les changements mentionnés ici. C'est comme ça que je l'ai fait fonctionner.
Yes but I don't know where and in which file applied the changes indicated above
J'ai essayé d'appliquer la solution de NickXDD mais après avoir tout essayé, je n'y arrive pas. quelqu'un pourrait-il m'aider ?
Quel genre d'erreurs obtenez-vous ?
Something went wrong: HTTPError: Response code 403 () at Request.<anonymous> (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42) at Object.onceWrapper (node:events:629:26) at Request.emit (node:events:526:35) at Request._onResponseBase (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:727:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Request._onResponse (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:766:13)
Hm... difficile à dire, à vrai dire. Je repartirais complètement de zéro, puis appliquerais les changements mentionnés ici. C'est comme ça que je l'ai fait fonctionner.
Yes but I don't know where and in which file applied the changes indicated above
This
"headers": {
"User-Agent": "TooGoodToGo/23.12.1 (550) (iPhone/iPhone 11 (GSM); iOS 16.3.1; Scale/2.00)",
"Cookie": ""
}
is done in the config file.
J'ai essayé d'appliquer la solution de NickXDD mais après avoir tout essayé, je n'y arrive pas. quelqu'un pourrait-il m'aider ?
Quel genre d'erreurs obtenez-vous ?
Something went wrong: HTTPError: Response code 403 () at Request.<anonymous> (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42) at Object.onceWrapper (node:events:629:26) at Request.emit (node:events:526:35) at Request._onResponseBase (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:727:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Request._onResponse (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:766:13)
Hm... difficile à dire, à vrai dire. Je repartirais complètement de zéro, puis appliquerais les changements mentionnés ici. C'est comme ça que je l'ai fait fonctionner.
Yes but I don't know where and in which file applied the changes indicated above
This
"headers": { "User-Agent": "TooGoodToGo/23.12.1 (550) (iPhone/iPhone 11 (GSM); iOS 16.3.1; Scale/2.00)", "Cookie": "" }
is done in the config file.
I put it in the config.defaults.json file, but I still get the same error, nothing has changed
J'ai essayé d'appliquer la solution de NickXDD mais après avoir tout essayé, je n'y arrive pas. quelqu'un pourrait-il m'aider ?
Quel genre d'erreurs obtenez-vous ?
Something went wrong: HTTPError: Response code 403 () at Request.<anonymous> (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42) at Object.onceWrapper (node:events:629:26) at Request.emit (node:events:526:35) at Request._onResponseBase (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:727:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Request._onResponse (file:///C:/Users/jules/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:766:13)
Hm... difficile à dire, à vrai dire. Je repartirais complètement de zéro, puis appliquerais les changements mentionnés ici. C'est comme ça que je l'ai fait fonctionner.
Yes but I don't know where and in which file applied the changes indicated above
This
"headers": { "User-Agent": "TooGoodToGo/23.12.1 (550) (iPhone/iPhone 11 (GSM); iOS 16.3.1; Scale/2.00)", "Cookie": "" }
is done in the config file.
I put it in the config.defaults.json file, but I still get the same error, nothing has changed
You have to check the cached config file as well. The first time you started the application, a cached config is saved from the config defaults json file. So if you did not change it in there as well, it will not work, since the old information in the cached config is used, which leads to the error. The cached config file is somewhere else in the directories.
So, delete the cached config or change it in there as well or install the application/NodeJS from scratch, then it should work.
I think it is a problem with the headers. I've added the following configuration to my config.json file and it seems to be working normally again
"headers": {
"User-Agent": "TGTG/21.1.12 Dalvik/2.1.0 (Linux; Android 12; SM-G920V Build/MMB29K)'"
}
and also change "deviceType": "IOS"
to "deviceType": "ANDROID"
Then I redeployed the container (in my case I use docker), did the login
command first and then watch
command and everything worked perfectly.
I have also noticed that if I deploy it on a server in another country other than where my account is configured, then it returns 403 error, but if I deploy it on a server at home, it no longer returns the 403.
I have not seen any evidence that changing the coordinates makes any difference. @jjavierrg I tried your suggestions and they worked, so I updated the config and made a new release.