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: (404, b'') #335

Open
antonioli86 opened this issue Feb 25, 2025 · 24 comments
Open

TGTG API Error: (404, b'') #335

antonioli86 opened this issue Feb 25, 2025 · 24 comments

Comments

@antonioli86
Copy link

antonioli86 commented Feb 25, 2025

Hi,

It started today afternoon to raise:
tgtg.exceptions.TgtgAPIError: (404, b'')

Any clues?

@FlowersPowerz
Copy link

same problem

@antonioli86
Copy link
Author

antonioli86 commented Feb 25, 2025

Being discussed also here: Der-Henning/tgtg#577

@antonioli86
Copy link
Author

Update the USER_AGENTS in init file should do the job. Anyone to check?
https://github.com/ahivert/tgtg-python/blob/master/tgtg/__init__.py

USER_AGENTS = [
    "TGTG/25.2.0 Dalvik/2.1.0 (Linux; U; Android 15; sdk_gphone64_x86_64 Build/AE3A.240806.043))",
]

@arn4
Copy link

arn4 commented Feb 25, 2025

Tried changing the user agent, does not work on my setup.

To give more details, the 404 error originates when calling the refresh_token API, even though it does not give 404 if I call it directly from the browser.

Right now, I have fixed by skipping the usage of old credentials and re-login. I will let you know if it stay logged in or it crashes later

@trainer-walter
Copy link

I tried modifying user-agent but no luck, still hitting 404 error. Also, re-login method didnt work for me as well

@antonioli86
Copy link
Author

Also tried meanwhile and does not work after a while.

@oxamafia
Copy link

Does that mean TGTG blocks recursive calls maybe ?

@simplearetenir
Copy link

Same error. I tried modifying user-agent, still hitting 404 error.

@ElDavoo
Copy link

ElDavoo commented Feb 26, 2025

It suddenly just started working again. Looks like they reverted whatever server-side change they've done.

@simplearetenir
Copy link

no, same error : tgtg/init.py", line 139, in _refresh_token
raise TgtgAPIError(response.status_code, response.content)
tgtg.exceptions.TgtgAPIError: (404, b'')

@Graphir
Copy link

Graphir commented Feb 26, 2025

i removed self.login() in get_items, or other methods.
it works

@arn4
Copy link

arn4 commented Feb 26, 2025

@Graphir not sure that is a long term solution since at some point the access token is going to expire.

If you really want to extend the duration is better to change the variable rather than removing the self.login() line. Anyway, we should figure out why the refresh token API is returning 404, by I haven’t android and can’t sniff the app requests

@deeg61
Copy link

deeg61 commented Feb 27, 2025

Anyone any luck yet, by solving this problem ?

@fbuchacher
Copy link
Contributor

I think they removed the refresh token api route. This request isn't working anymore and returns 404.

@ghecko
Copy link

ghecko commented Feb 27, 2025

I think they removed the refresh token api route. This request isn't working anymore and returns 404.

I confirm that

Image

@ghecko
Copy link

ghecko commented Feb 27, 2025

New refresh url is at: /api/token/v1/refresh
You can temporarly modify the __init__.py file

tested and works now :)

@fbuchacher
Copy link
Contributor

fbuchacher commented Feb 27, 2025

I already created a PR

@ihor-chaban
Copy link

ihor-chaban commented Feb 28, 2025

I'm still getting 403 error at item/v8/
Maybe they haven't rolled out this change everywhere yet, but this endpoint has also changed (and maybe some others too).

I tried changing v8 -> v9 and v10 but it didn't work.

My app version is 25.2.11 now.

upd. It looks like the latest APK version is indeed available only in some countries now.
I wanted to intercept app requests to check the endpoints version and address, but I could get 25.2.11 APK from anywhere. And I couldn't download it from Google Play via third-party tools as they all showed that 25.2.0 version is the latest. I think in a couple of days it should become available globally.

@ghecko
Copy link

ghecko commented Feb 28, 2025

I'm still getting 403 error at item/v8/ Maybe they haven't rolled out this change everywhere yet, but this endpoint has also changed (and maybe some others too).

I tried changing v8 -> v9 and v10 but it didn't work.

My app version is 25.2.11 now.

upd. It looks like the latest APK version is indeed available only in some countries now. I wanted to intercept app requests to check the endpoints version and address, but I could get 25.2.11 APK from anywhere. And I couldn't download it from Google Play via third-party tools as they all showed that 25.2.0 version is the latest. I think in a couple of days it should become available globally.

I do not have any issue on my side, what I've done is reducing my polling time to 1x every 5 minutes, otherwise I have a 403 HTTP error too

@ahivert
Copy link
Owner

ahivert commented Feb 28, 2025

0.18.2 have been realeased with the refresh token updated. Thanks @fbuchacher for the PR

@ihor-chaban
Copy link

ihor-chaban commented Feb 28, 2025

I just intercepted requests from 25.2.11 app.
They don't use item/v8/ endpoint anymore, they use discover/v1/bucket instead.
Attaching full request/response below.

It looks like they will also be migrating other endpoints to something/v1/something
They already changed token refresh and items endpoints to this new schema.

Image
tgtg-25.2.11-request.txt

@ihor-chaban
Copy link

ihor-chaban commented Feb 28, 2025

upd. I still see item/v8 endpoint when opening a particular item, but it looks like favorites list was migrated to discover/v1/bucket

Here I tried refreshing favorites, then opened an item and tried reserving it.

Image

@lampje25
Copy link

Same problem here:

Type your email linked to your TGTG account: [email protected]
Using version 25.2.0
Traceback (most recent call last):
File "C:\Python39\tgtg_get_favorites_item_id.py", line 4, in
from tgtg_get_tokens import tgtgClient
File "C:\Python39\tgtg_get_tokens.py", line 13, in
tgtgClient.get_credentials()
File "C:\Python39\lib\site-packages\tgtg_init_.py", line 89, in get_credentials
self.login()
File "C:\Python39\lib\site-packages\tgtg_init_.py", line 173, in login
raise TgtgLoginError(response.status_code, response.content)
tgtg.exceptions.TgtgLoginError: (403, b'{"url":"https://geo.captcha-delivery.com/captcha/?initialCid=AHrlqAAAAAMAFnHYk6_oK-UA8qTrLg==&cid=h118Vf1Uq3jAjRNpbHPw3huUqYhwZJ_Har0V1ukgWFRA4OjGGIpMDYGujCtMTRy122_kxulsGWeIIBMyujgXs70KyYV2K6EJTQGZvhdL47Q~kLrWBbtVqviOWB7JK20g&referer=https%3A%2F%2Fapptoogoodtogo.com%2Fapi%2Fauth%2Fv5%2FauthByEmail&hash=1D42C2CA6131C526E09F294FE96F94&t=fe&s=35587&e=0bd159b03ee0cd89cfd900775c19c5bd9abf486396713347c96a8bdf697ac987"}')
Press any key to continue . . .

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