李恒道 发表于 2025-3-31 15:20:55

twitter authtoken强💡

```py
def GetAuthCookies(auth_token):
    url = "https://x.com/home"
    response = requests.get(url, cookies={"auth_token": auth_token})
    set_cookie_header = response.headers.get("Set-Cookie")
    if set_cookie_header:
      cookie = SimpleCookie()
      cookie.load(set_cookie_header)
      cookies_dict = {key: morsel.value for key, morsel in cookie.items()}
      cookies_dict["auth_token"]=auth_token
      return cookies_dict
    else:
      return None
```
页: [1]
查看完整版本: twitter authtoken强💡