-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Request fails without the __Secure-1PSIDTS cookie #29
Comments
I did include those cookies and it worked then after 20 minutes the request fails again. What do you think? |
Those cookies always change per 10mins |
I guess they added this requirement to make programatically calliing the api more difficult. |
Oh sorry about that. My fault keep refreshing my browser page and it generates new value. The code works well now. |
@nerblock thanks for creating this issue, by adding __Secure-1PSIDTS=<COOKIE_VALUE> I was able to make it work. However, I did not try to use __Secure-2PSIDTS or __Secure-3PSIDTS. Any way to generate those cookies programmatically? |
You can use browser_cookie3. |
You can get them if you get the success response. The response has Set-Cookie: |
@nerblock Did you find a way to get the __Secure-1PSIDTS cookie programmatically? |
year too late but I'm experiencing something similar on youtube. \(\'(\d+)\', after that, you make an authenticated POST request to async with session.post(...) as r:
psid = r.headers.get("Set-Cookie") the string from the first request should last a day, but I got no clue how to get it. |
The value of __Secure-1PSIDTS (or __Secure-2PSIDTS, __Secure-3PSIDTS, etc, depending on the user number) must be included in the cookie. This is what the cookies variable should look like in order to make a successful request:
When it is not included (as described in the current readme) the request fails with this error:
The text was updated successfully, but these errors were encountered: