Commit Graph
21 Commits
Author SHA1 Message Date
Guorui Yu d8eaee5889 fix(route/twitter): dynamically resolve GraphQL query IDs and fix production CookieAgent (#21544)
* fix(route/twitter): dynamically resolve GraphQL query IDs from Twitter JS bundles

Twitter rotates GraphQL query IDs every 2-4 weeks, causing 404 errors.
Instead of relying solely on hardcoded IDs, fetch and cache the latest
query IDs from Twitter's client-web main.js bundle at runtime.

- Add gql-id-resolver module to extract queryId/operationName pairs
- Cache resolved IDs using CACHE_CONTENT_EXPIRE (Redis supported)
- Fall back to hardcoded IDs if dynamic resolution fails
- Update init() to trigger resolution before first API call

Signed-off-by: yuguorui <yuguorui@pku.edu.cn>

* fix(route/twitter): use undici.fetch directly to preserve CookieAgent dispatcher

Both ofetch and the global wrappedFetch (request-rewriter) drop the
dispatcher option when constructing a new Request object, which prevents
the CookieAgent from attaching cookies in production builds. Use
undici.fetch directly for Twitter API requests to preserve the dispatcher.

Signed-off-by: yuguorui <yuguorui@pku.edu.cn>

---------

Signed-off-by: yuguorui <yuguorui@pku.edu.cn>
2026-04-06 22:46:29 +08:00
DIYgod 7f5ae64a2f feat(twitter): add UserMedia support and enhance pagination logic 2025-12-01 22:57:09 +08:00
github-actions[bot] a28890a135 style: auto format 2025-11-27 02:55:46 +00:00
DIYgod d03f5697a4 fix(twitter): replace zstd decompression with gzip for third-party API requests 2025-11-15 09:01:46 +08:00
Tony daf9460e6a fix(router/twitter): replace zstd decoder with native zlib decompression (#20485)
* fix(twitter): replace zstd decoder with native zlib decompression

* fix(twitter): update node version compatibility and enable experimental features
2025-11-15 01:56:23 +08:00
DIYgod a07565d356 feat(api): implement zstd decoding for third-party API responses 2025-11-14 14:13:18 +08:00
DIYgod 12a519ff83 fix: twitter data 2025-09-25 11:38:11 +08:00
pseudoyu 3e102d5a53 refactor(route/twitter): keep twitter graphql endpoints consistent 2024-11-29 14:18:20 +08:00
pseudoyu 3f12f922bf feat(route/twitter): add third-party twitter api support 2024-11-29 13:50:59 +08:00
DIYgod a2ca21a11b feat(twitter): allowNoAuth for UserByScreenName api 2024-10-06 23:23:17 +08:00
Keisuke Horota df5c044ed8 feat(twitter): add twitter getHomeLatestTimeline (#16549) 2024-08-27 22:01:38 +08:00
DIYgod 7cd8d2de1a feat: clear null userdata 2024-07-13 23:38:35 +08:00
github-actions[bot] 32bc952418 style: auto format 2024-05-04 15:11:03 +00:00
Alan Xian 75d8152540 fix(route): fix /twitter/likes (#15384)
* fix(route): fix /twitter/likes

* fix: delete not used variables

* update: router /twitter/likes config

* feat: throw a error for Twitter Premium accounts.

* feat: throw a error for Twitter Premium accounts
2024-05-04 23:09:33 +08:00
DIYgod 79fcce2729 feat: add ConfigNotFoundError and InvalidParameterError 2024-04-07 17:36:18 +08:00
DIYgod 39f1f61bf5 fix: twitter cookie getUserTweets 2024-03-20 12:42:12 +08:00
DIYgod c5ea105fab feat(twitter): following for webapi 2024-03-19 22:36:56 +08:00
DIYgod 1bc24075c7 feat(twitter): list for webapi 2024-03-19 22:11:20 +08:00
DIYgod 2b6c84c829 feat(twitter): keyword for webapi 2024-03-19 21:51:01 +08:00
DIYgod 52edc7e393 feat(twitter): media for webapi 2024-03-19 21:41:39 +08:00
DIYgod 4a7c00f274 feat(twitter): api structure and web user 2024-03-19 20:57:19 +08:00