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

HTTPError: Response code 404 () #258

Closed
azeazr939 opened this issue Feb 27, 2025 · 11 comments
Closed

HTTPError: Response code 404 () #258

azeazr939 opened this issue Feb 27, 2025 · 11 comments

Comments

@azeazr939
Copy link

When attempting to execute the application with the command toogoodtogo-watcher watch, I encounter this error message :

Error during request:
POST https://apptoogoodtogo.com/api/auth/v4/token/refresh
undefined

HTTPError: Response code 404 ()
    at Request.<anonymous> (file:///C:/Users/a/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/as-promise/index.js:86:42)
    at Object.onceWrapper (node:events:622:26)
    at Request.emit (node:events:519:35)
    at Request._onResponseBase (file:///C:/Users/a/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:105:5)
    at async Request._onResponse (file:///C:/Users/a/AppData/Roaming/npm/node_modules/toogoodtogo-watcher/node_modules/got/dist/source/core/index.js:766:13)

I tried completely reinstalling it, no change.
What to do?

@c0lumb0
Copy link

c0lumb0 commented Feb 27, 2025

Same here, same error.
I searched a little bit throughout the different TGTG apps here in Github. Everyone seems to have the same issue apparently related to Datadome protection and/or captcha codes again.

Der-Henning/tgtg#579
ahivert/tgtg-python#335

@denoise
Copy link

denoise commented Feb 27, 2025

the same for me :(

@c0lumb0
Copy link

c0lumb0 commented Feb 28, 2025

OK, I think I found something.
TGTG just changed the URL for the token refresh, saw this one here:
ahivert/tgtg-python#335 (comment)

Applied it also to this application by changing the endpoint in toogoodtogo-api.js
from

return api
    .post("auth/v4/token/refresh"

to

return api
    .post("token/v1/refresh"

Tested and works.
Can someone verify and the create a PR please?
Thx :)

UPDT:
What could be changed in behavior as well could be the polling time, also mentioned here
ahivert/tgtg-python#335 (comment)

Did not change this in this application, but new requests, in my case via telegram, are just delivered every couple of minutes. I do not get any errors or something like that, like mentioned in the linked comment, but I did not change the default polling time, but still I'm just getting the messages less frequent than before.

@azeazr939
Copy link
Author

Thanks for your help.
I made the change as instructed, but I still get the same error coming back.
What to do ?

@c0lumb0
Copy link

c0lumb0 commented Mar 3, 2025

Thanks for your help. I made the change as instructed, but I still get the same error coming back. What to do ?

Do you have the most current version of this application?
This is the only difference I can think of, since it is working on my side with just the change of the URL as mentioned.

@azeazr939
Copy link
Author

Merci pour votre aide. J'ai effectué le changement comme indiqué, mais j'obtiens toujours la même erreur. Que faire ?

Avez-vous la version la plus récente de cette application ? C'est la seule différence à laquelle je peux penser, car elle fonctionne de mon côté avec juste le changement de l'URL comme mentionné.

Yes.
I have the impression that the changes made are not saved because the same errors always come back. I think I'll wait until someone updates the file.

@dynek
Copy link

dynek commented Mar 3, 2025

@marklagendijk will you release a new version with the fix?

@marklagendijk
Copy link
Owner

@basti1499 thanks for the PR!
Fix is released as 4.0.7.

@nurp
Copy link

nurp commented Mar 3, 2025

This fix unfortunately doesn't work for me. I see no output. Just blank, waiting. Is it normal? Should I wait long?
I also did config-reset.

@c0lumb0
Copy link

c0lumb0 commented Mar 4, 2025

This fix unfortunately doesn't work for me. I see no output. Just blank, waiting. Is it normal? Should I wait long? I also did config-reset.

Did you start the bot properly?
If the bot is blanking, but not thowing any errors, this might be the issue, happened to me in the past as well.

@nurp
Copy link

nurp commented Mar 4, 2025

Did you start the bot properly?

It is Telegram bot. I tried debugging the app and it never goes into the "listFavoriteBusinesses" function. I don't know what else I can check in the code. If it works for everyone, then I'll register a new bot and try again.

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

6 participants