1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 15:40:26 +01:00

update wip

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2025-05-01 01:28:12 +09:00
parent 988d50fd60
commit de523dc052
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
4 changed files with 237 additions and 44 deletions

View file

@ -1,5 +1,7 @@
{ {
"HomeTimeline": { "HomeTimeline": {
"@path": "/i/api/graphql/ci_OQZ2k0rG0Ax_lXRiWVA/HomeTimeline",
"@method": "GET",
"queryId": "ci_OQZ2k0rG0Ax_lXRiWVA", "queryId": "ci_OQZ2k0rG0Ax_lXRiWVA",
"variables": { "variables": {
"count": 20, "count": 20,
@ -45,6 +47,8 @@
} }
}, },
"HomeLatestTimeline": { "HomeLatestTimeline": {
"@path": "/i/api/graphql/nMyTQqsJiUGBKLGNSQamAA/HomeLatestTimeline",
"@method": "GET",
"queryId": "nMyTQqsJiUGBKLGNSQamAA", "queryId": "nMyTQqsJiUGBKLGNSQamAA",
"variables": { "variables": {
"count": 20, "count": 20,
@ -89,6 +93,8 @@
} }
}, },
"ListLatestTweetsTimeline": { "ListLatestTweetsTimeline": {
"@path": "/i/api/graphql/LSefrrxhpeX8HITbKfWz9g/ListLatestTweetsTimeline",
"@method": "GET",
"queryId": "LSefrrxhpeX8HITbKfWz9g", "queryId": "LSefrrxhpeX8HITbKfWz9g",
"variables": { "variables": {
"listId": "1539453138322673664", "listId": "1539453138322673664",
@ -130,6 +136,8 @@
} }
}, },
"UserByScreenName": { "UserByScreenName": {
"@path": "/i/api/graphql/32pL5BWe9WKeSK1MoPvFQQ/UserByScreenName",
"@method": "GET",
"queryId": "32pL5BWe9WKeSK1MoPvFQQ", "queryId": "32pL5BWe9WKeSK1MoPvFQQ",
"variables": { "variables": {
"screen_name": "elonmusk" "screen_name": "elonmusk"
@ -154,6 +162,8 @@
} }
}, },
"UserByRestId": { "UserByRestId": {
"@path": "/i/api/graphql/tD8zKvQzwY3kdx5yz6YmOw/UserByRestId",
"@method": "GET",
"queryId": "tD8zKvQzwY3kdx5yz6YmOw", "queryId": "tD8zKvQzwY3kdx5yz6YmOw",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -172,6 +182,8 @@
} }
}, },
"UsersByRestIds": { "UsersByRestIds": {
"@path": "/i/api/graphql/PyRggX3LQweP9nSF6PHliA/UsersByRestIds",
"@method": "GET",
"queryId": "PyRggX3LQweP9nSF6PHliA", "queryId": "PyRggX3LQweP9nSF6PHliA",
"variables": { "variables": {
"userIds": ["44196397"] "userIds": ["44196397"]
@ -186,6 +198,8 @@
} }
}, },
"ProfileSpotlightsQuery": { "ProfileSpotlightsQuery": {
"@path": "/i/api/graphql/-0XdHI-mrHWBQd8-oLo1aA/ProfileSpotlightsQuery",
"@method": "GET",
"queryId": "-0XdHI-mrHWBQd8-oLo1aA", "queryId": "-0XdHI-mrHWBQd8-oLo1aA",
"variables": { "variables": {
"screen_name": "elonmusk" "screen_name": "elonmusk"
@ -193,6 +207,8 @@
"features": {} "features": {}
}, },
"UserTweets": { "UserTweets": {
"@path": "/i/api/graphql/M3Hpkrb8pjWkEuGdLeXMOA/UserTweets",
"@method": "GET",
"queryId": "M3Hpkrb8pjWkEuGdLeXMOA", "queryId": "M3Hpkrb8pjWkEuGdLeXMOA",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -240,6 +256,8 @@
} }
}, },
"UserTweetsAndReplies": { "UserTweetsAndReplies": {
"@path": "/i/api/graphql/pz0IHaV_t7T4HJavqqqcIA/UserTweetsAndReplies",
"@method": "GET",
"queryId": "pz0IHaV_t7T4HJavqqqcIA", "queryId": "pz0IHaV_t7T4HJavqqqcIA",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -287,6 +305,8 @@
} }
}, },
"UserHighlightsTweets": { "UserHighlightsTweets": {
"@path": "/i/api/graphql/y0aDPjeWFCpvY3GOmGXKhQ/UserHighlightsTweets",
"@method": "GET",
"queryId": "y0aDPjeWFCpvY3GOmGXKhQ", "queryId": "y0aDPjeWFCpvY3GOmGXKhQ",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -333,6 +353,8 @@
} }
}, },
"UserMedia": { "UserMedia": {
"@path": "/i/api/graphql/8B9DqlaGvYyOvTCzzZWtNA/UserMedia",
"@method": "GET",
"queryId": "8B9DqlaGvYyOvTCzzZWtNA", "queryId": "8B9DqlaGvYyOvTCzzZWtNA",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -381,6 +403,8 @@
} }
}, },
"Likes": { "Likes": {
"@path": "/i/api/graphql/uxjTlmrTI61zreSIV1urbw/Likes",
"@method": "GET",
"queryId": "uxjTlmrTI61zreSIV1urbw", "queryId": "uxjTlmrTI61zreSIV1urbw",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -429,6 +453,8 @@
} }
}, },
"Bookmarks": { "Bookmarks": {
"@path": "/i/api/graphql/ztCdjqsvvdL0dE8R5ME0hQ/Bookmarks",
"@method": "GET",
"queryId": "ztCdjqsvvdL0dE8R5ME0hQ", "queryId": "ztCdjqsvvdL0dE8R5ME0hQ",
"variables": { "variables": {
"count": 20, "count": 20,
@ -470,6 +496,8 @@
} }
}, },
"TweetDetail": { "TweetDetail": {
"@path": "/i/api/graphql/b9Yw90FMr_zUb8DvA8r2ug/TweetDetail",
"@method": "GET",
"queryId": "b9Yw90FMr_zUb8DvA8r2ug", "queryId": "b9Yw90FMr_zUb8DvA8r2ug",
"variables": { "variables": {
"focalTweetId": "1349129669258448897", "focalTweetId": "1349129669258448897",
@ -524,6 +552,8 @@
} }
}, },
"TweetResultByRestId": { "TweetResultByRestId": {
"@path": "/i/api/graphql/7xflPyRiUxGVbJd4uWmbfg/TweetResultByRestId",
"@method": "GET",
"queryId": "7xflPyRiUxGVbJd4uWmbfg", "queryId": "7xflPyRiUxGVbJd4uWmbfg",
"variables": { "variables": {
"tweetId": "1691730070669517096", "tweetId": "1691730070669517096",
@ -564,6 +594,8 @@
} }
}, },
"SearchTimeline": { "SearchTimeline": {
"@path": "/i/api/graphql/fL2MBiqXPk5pSrOS5ACLdA/SearchTimeline",
"@method": "GET",
"queryId": "fL2MBiqXPk5pSrOS5ACLdA", "queryId": "fL2MBiqXPk5pSrOS5ACLdA",
"variables": { "variables": {
"rawQuery": "elonmusk", "rawQuery": "elonmusk",
@ -607,6 +639,8 @@
} }
}, },
"Favoriters": { "Favoriters": {
"@path": "/i/api/graphql/q-g2cgR9LuLM6rvXQ-oxFw/Favoriters",
"@method": "GET",
"queryId": "q-g2cgR9LuLM6rvXQ-oxFw", "queryId": "q-g2cgR9LuLM6rvXQ-oxFw",
"variables": { "variables": {
"tweetId": "1349129669258448897", "tweetId": "1349129669258448897",
@ -649,6 +683,8 @@
} }
}, },
"Retweeters": { "Retweeters": {
"@path": "/i/api/graphql/jyA1POBpkjVzqwOD7_6Jtw/Retweeters",
"@method": "GET",
"queryId": "jyA1POBpkjVzqwOD7_6Jtw", "queryId": "jyA1POBpkjVzqwOD7_6Jtw",
"variables": { "variables": {
"tweetId": "1349129669258448897", "tweetId": "1349129669258448897",
@ -691,6 +727,8 @@
} }
}, },
"Followers": { "Followers": {
"@path": "/i/api/graphql/jqZ0_HJBA6mnu18iTZYm9w/Followers",
"@method": "GET",
"queryId": "jqZ0_HJBA6mnu18iTZYm9w", "queryId": "jqZ0_HJBA6mnu18iTZYm9w",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -733,6 +771,8 @@
} }
}, },
"Following": { "Following": {
"@path": "/i/api/graphql/4QHbs4wmzgtU91f-t96_Eg/Following",
"@method": "GET",
"queryId": "4QHbs4wmzgtU91f-t96_Eg", "queryId": "4QHbs4wmzgtU91f-t96_Eg",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -775,6 +815,8 @@
} }
}, },
"BlueVerifiedFollowers": { "BlueVerifiedFollowers": {
"@path": "/i/api/graphql/GHg0X_FjrJoISwwLPWi1LQ/BlueVerifiedFollowers",
"@method": "GET",
"queryId": "GHg0X_FjrJoISwwLPWi1LQ", "queryId": "GHg0X_FjrJoISwwLPWi1LQ",
"variables": { "variables": {
"userId": "1347135745706708993", "userId": "1347135745706708993",
@ -817,6 +859,8 @@
} }
}, },
"FollowersYouKnow": { "FollowersYouKnow": {
"@path": "/i/api/graphql/Ba2FhuJKy1jPCGz80ouhzg/FollowersYouKnow",
"@method": "GET",
"queryId": "Ba2FhuJKy1jPCGz80ouhzg", "queryId": "Ba2FhuJKy1jPCGz80ouhzg",
"variables": { "variables": {
"userId": "44196397", "userId": "44196397",
@ -859,6 +903,8 @@
} }
}, },
"CreateTweet": { "CreateTweet": {
"@path": "/i/api/graphql/xT36w0XM3A8jDynpkram2A/CreateTweet",
"@method": "POST",
"queryId": "xT36w0XM3A8jDynpkram2A", "queryId": "xT36w0XM3A8jDynpkram2A",
"variables": { "variables": {
"tweet_text": "test", "tweet_text": "test",
@ -911,12 +957,16 @@
} }
}, },
"FavoriteTweet": { "FavoriteTweet": {
"@path": "/i/api/graphql/lI07N6Otwv1PhnEgXILM7A/FavoriteTweet",
"@method": "POST",
"queryId": "lI07N6Otwv1PhnEgXILM7A", "queryId": "lI07N6Otwv1PhnEgXILM7A",
"variables": { "variables": {
"tweet_id": "1349129669258448897" "tweet_id": "1349129669258448897"
} }
}, },
"UnfavoriteTweet": { "UnfavoriteTweet": {
"@path": "/i/api/graphql/ZYKSe-w7KEslx3JhSIk5LA/UnfavoriteTweet",
"@method": "POST",
"queryId": "ZYKSe-w7KEslx3JhSIk5LA", "queryId": "ZYKSe-w7KEslx3JhSIk5LA",
"variables": { "variables": {
"tweet_id": "1349129669258448897", "tweet_id": "1349129669258448897",
@ -924,6 +974,8 @@
} }
}, },
"CreateRetweet": { "CreateRetweet": {
"@path": "/i/api/graphql/ojPdsZsimiJrUGLR1sjUtA/CreateRetweet",
"@method": "POST",
"queryId": "ojPdsZsimiJrUGLR1sjUtA", "queryId": "ojPdsZsimiJrUGLR1sjUtA",
"variables": { "variables": {
"tweet_id": "1349129669258448897", "tweet_id": "1349129669258448897",
@ -931,6 +983,8 @@
} }
}, },
"DeleteRetweet": { "DeleteRetweet": {
"@path": "/i/api/graphql/iQtK4dl5hBmXewYZuEOKVw/DeleteRetweet",
"@method": "POST",
"queryId": "iQtK4dl5hBmXewYZuEOKVw", "queryId": "iQtK4dl5hBmXewYZuEOKVw",
"variables": { "variables": {
"source_tweet_id": "1349129669258448897", "source_tweet_id": "1349129669258448897",
@ -938,6 +992,8 @@
} }
}, },
"DeleteTweet": { "DeleteTweet": {
"@path": "/i/api/graphql/VaenaVgh5q5ih7kvyVjgtg/DeleteTweet",
"@method": "POST",
"queryId": "VaenaVgh5q5ih7kvyVjgtg", "queryId": "VaenaVgh5q5ih7kvyVjgtg",
"variables": { "variables": {
"tweet_id": "1349129669258448897", "tweet_id": "1349129669258448897",
@ -945,12 +1001,16 @@
} }
}, },
"CreateBookmark": { "CreateBookmark": {
"@path": "/i/api/graphql/aoDbu3RHznuiSkQ9aNM67Q/CreateBookmark",
"@method": "POST",
"queryId": "aoDbu3RHznuiSkQ9aNM67Q", "queryId": "aoDbu3RHznuiSkQ9aNM67Q",
"variables": { "variables": {
"tweet_id": "1349129669258448897" "tweet_id": "1349129669258448897"
} }
}, },
"DeleteBookmark": { "DeleteBookmark": {
"@path": "/i/api/graphql/Wlmlj2-xzyS1GN3a6cj-mQ/DeleteBookmark",
"@method": "POST",
"queryId": "Wlmlj2-xzyS1GN3a6cj-mQ", "queryId": "Wlmlj2-xzyS1GN3a6cj-mQ",
"variables": { "variables": {
"tweet_id": "1349129669258448897" "tweet_id": "1349129669258448897"
@ -1062,9 +1122,13 @@
}, },
"#=====NotImplemented====": {}, "#=====NotImplemented====": {},
"DataSaverMode": { "DataSaverMode": {
"@path": "/i/api/graphql/xF6sXnKJfS2AOylzxRjf6A/DataSaverMode",
"@method": "GET",
"queryId": "xF6sXnKJfS2AOylzxRjf6A" "queryId": "xF6sXnKJfS2AOylzxRjf6A"
}, },
"PinnedTimelines": { "PinnedTimelines": {
"@path": "/i/api/graphql/5gi2JbcGqn-TZeacb6CXQg/PinnedTimelines",
"@method": "GET",
"queryId": "5gi2JbcGqn-TZeacb6CXQg", "queryId": "5gi2JbcGqn-TZeacb6CXQg",
"features": { "features": {
"profile_label_improvements_pcf_label_in_post_enabled": true, "profile_label_improvements_pcf_label_in_post_enabled": true,
@ -1076,9 +1140,13 @@
} }
}, },
"getAltTextPromptPreference": { "getAltTextPromptPreference": {
"@path": "/i/api/graphql/PFIxTk8owMoZgiMccP0r4g/getAltTextPromptPreference",
"@method": "GET",
"queryId": "PFIxTk8owMoZgiMccP0r4g" "queryId": "PFIxTk8owMoZgiMccP0r4g"
}, },
"ExploreSidebar": { "ExploreSidebar": {
"@path": "/i/api/graphql/xyCTyu2HffE6YzLmb1-ZVA/ExploreSidebar",
"@method": "GET",
"queryId": "xyCTyu2HffE6YzLmb1-ZVA", "queryId": "xyCTyu2HffE6YzLmb1-ZVA",
"features": { "features": {
"profile_label_improvements_pcf_label_in_post_enabled": true, "profile_label_improvements_pcf_label_in_post_enabled": true,
@ -1115,9 +1183,13 @@
} }
}, },
"useFetchProfileBlocks_profileExistsQuery": { "useFetchProfileBlocks_profileExistsQuery": {
"@path": "/i/api/graphql/Z2BA99jFw6TxaJM5v7Irmg/useFetchProfileBlocks_profileExistsQuery",
"@method": "GET",
"queryId": "Z2BA99jFw6TxaJM5v7Irmg" "queryId": "Z2BA99jFw6TxaJM5v7Irmg"
}, },
"ExplorePage": { "ExplorePage": {
"@path": "/i/api/graphql/Pclwdha3s_tQ5dMomFhRrg/ExplorePage",
"@method": "GET",
"queryId": "Pclwdha3s_tQ5dMomFhRrg", "queryId": "Pclwdha3s_tQ5dMomFhRrg",
"features": { "features": {
"rweb_video_screen_enabled": false, "rweb_video_screen_enabled": false,
@ -1155,12 +1227,18 @@
} }
}, },
"CommunitiesCreateButtonQuery": { "CommunitiesCreateButtonQuery": {
"@path": "/i/api/graphql/ScODPHsG2d28Xr-rDSBThg/CommunitiesCreateButtonQuery",
"@method": "GET",
"queryId": "ScODPHsG2d28Xr-rDSBThg" "queryId": "ScODPHsG2d28Xr-rDSBThg"
}, },
"CarouselQuery": { "CarouselQuery": {
"@path": "/i/api/graphql/xfgycRkhqXy90CmTQZ7Kig/CarouselQuery",
"@method": "GET",
"queryId": "xfgycRkhqXy90CmTQZ7Kig" "queryId": "xfgycRkhqXy90CmTQZ7Kig"
}, },
"CommunitiesRankedTimeline": { "CommunitiesRankedTimeline": {
"@path": "/i/api/graphql/D1b67ecmt-bT3bRpgaCjMQ/CommunitiesRankedTimeline",
"@method": "GET",
"queryId": "D1b67ecmt-bT3bRpgaCjMQ", "queryId": "D1b67ecmt-bT3bRpgaCjMQ",
"features": { "features": {
"rweb_video_screen_enabled": false, "rweb_video_screen_enabled": false,
@ -1202,6 +1280,8 @@
} }
}, },
"BirdwatchFetchGlobalTimeline": { "BirdwatchFetchGlobalTimeline": {
"@path": "/i/api/graphql/6pP3Lh7hO-PRqk8SlwkQhg/BirdwatchFetchGlobalTimeline",
"@method": "GET",
"queryId": "6pP3Lh7hO-PRqk8SlwkQhg", "queryId": "6pP3Lh7hO-PRqk8SlwkQhg",
"features": { "features": {
"rweb_video_screen_enabled": false, "rweb_video_screen_enabled": false,
@ -1239,6 +1319,8 @@
} }
}, },
"BirdwatchFetchAuthenticatedUserProfile": { "BirdwatchFetchAuthenticatedUserProfile": {
"@path": "/i/api/graphql/hkYn13HnxM_eVCEGGl-Fdw/BirdwatchFetchAuthenticatedUserProfile",
"@method": "GET",
"queryId": "hkYn13HnxM_eVCEGGl-Fdw", "queryId": "hkYn13HnxM_eVCEGGl-Fdw",
"features": { "features": {
"responsive_web_birdwatch_top_contributor_enabled": true, "responsive_web_birdwatch_top_contributor_enabled": true,
@ -1247,21 +1329,29 @@
} }
}, },
"useRelayDelegateDataPendingQuery": { "useRelayDelegateDataPendingQuery": {
"@path": "/i/api/graphql/0d3YLrCrAvgiPrMFGc33SA/useRelayDelegateDataPendingQuery",
"@method": "GET",
"queryId": "0d3YLrCrAvgiPrMFGc33SA" "queryId": "0d3YLrCrAvgiPrMFGc33SA"
}, },
"DelegatedAccountListQuery": { "DelegatedAccountListQuery": {
"@path": "/i/api/graphql/R0L__TguknNYVKUvNwmBpA/DelegatedAccountListQuery",
"@method": "GET",
"queryId": "R0L__TguknNYVKUvNwmBpA", "queryId": "R0L__TguknNYVKUvNwmBpA",
"features": { "features": {
"responsive_web_graphql_timeline_navigation_enabled": true "responsive_web_graphql_timeline_navigation_enabled": true
} }
}, },
"UsersVerifiedAvatars": { "UsersVerifiedAvatars": {
"@path": "/i/api/graphql/aLfvAoX6xy2ojqzOnkbrIA/UsersVerifiedAvatars",
"@method": "GET",
"queryId": "aLfvAoX6xy2ojqzOnkbrIA", "queryId": "aLfvAoX6xy2ojqzOnkbrIA",
"features": { "features": {
"responsive_web_graphql_timeline_navigation_enabled": true "responsive_web_graphql_timeline_navigation_enabled": true
} }
}, },
"CreateDraftTweet": { "CreateDraftTweet": {
"@path": "/i/api/graphql/cH9HZWz_EW9gnswvA4ZRiQ/CreateDraftTweet",
"@method": "POST",
"queryId": "cH9HZWz_EW9gnswvA4ZRiQ", "queryId": "cH9HZWz_EW9gnswvA4ZRiQ",
"variables": { "variables": {
"post_tweet_request": { "post_tweet_request": {
@ -1274,25 +1364,37 @@
} }
}, },
"FetchDraftTweets": { "FetchDraftTweets": {
"@path": "/i/api/graphql/fMp3izG_gCZKVk3Aa1vVKw/FetchDraftTweets",
"@method": "GET",
"queryId": "fMp3izG_gCZKVk3Aa1vVKw", "queryId": "fMp3izG_gCZKVk3Aa1vVKw",
"ascending": false "ascending": false
}, },
"useFetchAnalyticsQuery": { "useFetchAnalyticsQuery": {
"@path": "/i/api/graphql/5JkoDLRvQrXv2QV4U5gKFg/useFetchAnalyticsQuery",
"@method": "GET",
"queryId": "5JkoDLRvQrXv2QV4U5gKFg" "queryId": "5JkoDLRvQrXv2QV4U5gKFg"
}, },
"QuickPromoteEligibility": { "QuickPromoteEligibility": {
"@path": "/i/api/graphql/LtpCXh66W-uXh7u7XSRA8Q/QuickPromoteEligibility",
"@method": "GET",
"queryId": "LtpCXh66W-uXh7u7XSRA8Q" "queryId": "LtpCXh66W-uXh7u7XSRA8Q"
}, },
"TweetActivityQuery": { "TweetActivityQuery": {
"@path": "/i/api/graphql/vnwexpl0q33_Bky-SROVww/TweetActivityQuery",
"@method": "GET",
"queryId": "vnwexpl0q33_Bky-SROVww", "queryId": "vnwexpl0q33_Bky-SROVww",
"features": { "features": {
"responsive_web_tweet_analytics_m3_enabled": false "responsive_web_tweet_analytics_m3_enabled": false
} }
}, },
"DMPinnedInboxQuery": { "DMPinnedInboxQuery": {
"@path": "/i/api/graphql/_gBQBgClVuMQb8efxWkbbQ/DMPinnedInboxQuery",
"@method": "GET",
"queryId": "_gBQBgClVuMQb8efxWkbbQ" "queryId": "_gBQBgClVuMQb8efxWkbbQ"
}, },
"GenericTimelineById": { "GenericTimelineById": {
"@path": "/i/api/graphql/AUBQvpgGDhTkrW5h66irTA/GenericTimelineById",
"@method": "GET",
"queryId": "AUBQvpgGDhTkrW5h66irTA", "queryId": "AUBQvpgGDhTkrW5h66irTA",
"features": { "features": {
"rweb_video_screen_enabled": false, "rweb_video_screen_enabled": false,
@ -1330,9 +1432,13 @@
} }
}, },
"BirdwatchFetchAliasSelfSelectStatus": { "BirdwatchFetchAliasSelfSelectStatus": {
"@path": "/i/api/graphql/LUEdtkcpBlGktUtms4BvwA/BirdwatchFetchAliasSelfSelectStatus",
"@method": "GET",
"queryId": "LUEdtkcpBlGktUtms4BvwA" "queryId": "LUEdtkcpBlGktUtms4BvwA"
}, },
"BirdwatchFetchContributorNotesSlice": { "BirdwatchFetchContributorNotesSlice": {
"@path": "/i/api/graphql/VyycAPcXi0XvKoLqdhNpOg/BirdwatchFetchContributorNotesSlice",
"@method": "GET",
"queryId": "VyycAPcXi0XvKoLqdhNpOg", "queryId": "VyycAPcXi0XvKoLqdhNpOg",
"features": { "features": {
"responsive_web_birdwatch_media_notes_enabled": true, "responsive_web_birdwatch_media_notes_enabled": true,
@ -1363,15 +1469,21 @@
} }
}, },
"BirdwatchFetchBirdwatchProfile": { "BirdwatchFetchBirdwatchProfile": {
"@path": "/i/api/graphql/iL_0nGf1nelAd9Kz-pZJlA/BirdwatchFetchBirdwatchProfile",
"@method": "GET",
"queryId": "iL_0nGf1nelAd9Kz-pZJlA", "queryId": "iL_0nGf1nelAd9Kz-pZJlA",
"features": { "features": {
"responsive_web_birdwatch_top_contributor_enabled": true "responsive_web_birdwatch_top_contributor_enabled": true
} }
}, },
"BirdwatchFetchPublicData": { "BirdwatchFetchPublicData": {
"@path": "/i/api/graphql/9bDdJ6AL26RLkcUShEcF-A/BirdwatchFetchPublicData",
"@method": "GET",
"queryId": "9bDdJ6AL26RLkcUShEcF-A" "queryId": "9bDdJ6AL26RLkcUShEcF-A"
}, },
"ListsManagementPageTimeline": { "ListsManagementPageTimeline": {
"@path": "/i/api/graphql/v06PoBzewJgqo_MliVawtg/ListsManagementPageTimeline",
"@method": "GET",
"queryId": "v06PoBzewJgqo_MliVawtg", "queryId": "v06PoBzewJgqo_MliVawtg",
"features": { "features": {
"rweb_video_screen_enabled": false, "rweb_video_screen_enabled": false,
@ -1409,15 +1521,23 @@
} }
}, },
"useFetchProfileSections_canViewExpandedProfileQuery": { "useFetchProfileSections_canViewExpandedProfileQuery": {
"@path": "/i/api/graphql/vqu78dKcEkW-UAYLw5rriA/useFetchProfileSections_canViewExpandedProfileQuery",
"@method": "GET",
"queryId": "vqu78dKcEkW-UAYLw5rriA" "queryId": "vqu78dKcEkW-UAYLw5rriA"
}, },
"affiliatesQuery": { "affiliatesQuery": {
"@path": "/i/api/graphql/lre2gA0kvs0gf4XRNei6Qw/affiliatesQuery",
"@method": "GET",
"queryId": "lre2gA0kvs0gf4XRNei6Qw" "queryId": "lre2gA0kvs0gf4XRNei6Qw"
}, },
"UserPreferences": { "UserPreferences": {
"@path": "/i/api/graphql/xFxU-O8hEYe74ovNVU74jA/UserPreferences",
"@method": "GET",
"queryId": "xFxU-O8hEYe74ovNVU74jA" "queryId": "xFxU-O8hEYe74ovNVU74jA"
}, },
"CommunitiesFetchOneQuery": { "CommunitiesFetchOneQuery": {
"@path": "/i/api/graphql/qoO_JjXzufVpsHld_wO9bw/CommunitiesFetchOneQuery",
"@method": "GET",
"queryId": "qoO_JjXzufVpsHld_wO9bw", "queryId": "qoO_JjXzufVpsHld_wO9bw",
"features": { "features": {
"profile_label_improvements_pcf_label_in_post_enabled": true, "profile_label_improvements_pcf_label_in_post_enabled": true,
@ -1429,6 +1549,8 @@
} }
}, },
"CommunityQuery": { "CommunityQuery": {
"@path": "/i/api/graphql/YDYGxdoPEu0zNC2eWP_0MQ/CommunityQuery",
"@method": "GET",
"queryId": "YDYGxdoPEu0zNC2eWP_0MQ", "queryId": "YDYGxdoPEu0zNC2eWP_0MQ",
"features": { "features": {
"c9s_list_members_action_api_enabled": false, "c9s_list_members_action_api_enabled": false,
@ -1436,6 +1558,8 @@
} }
}, },
"CommunityTweetsTimeline": { "CommunityTweetsTimeline": {
"@path": "/i/api/graphql/9Aek_FuJnKEtOZuUzMb--A/CommunityTweetsTimeline",
"@method": "GET",
"queryId": "9Aek_FuJnKEtOZuUzMb--A", "queryId": "9Aek_FuJnKEtOZuUzMb--A",
"features": { "features": {
"profile_label_improvements_pcf_label_in_post_enabled": true, "profile_label_improvements_pcf_label_in_post_enabled": true,
@ -1472,6 +1596,8 @@
} }
}, },
"CommunityMediaTimeline": { "CommunityMediaTimeline": {
"@path": "/i/api/graphql/HfMuDHto2j3NKUeiLjKWHA",
"@method": "GET",
"queryId": "HfMuDHto2j3NKUeiLjKWHA", "queryId": "HfMuDHto2j3NKUeiLjKWHA",
"features": { "features": {
"rweb_video_screen_enabled": false, "rweb_video_screen_enabled": false,
@ -1509,6 +1635,8 @@
} }
}, },
"CommunityAboutTimeline": { "CommunityAboutTimeline": {
"@path": "/i/api/graphql/Cr3qPw53XABLDuzCFJmnhA",
"@method": "GET",
"queryId": "Cr3qPw53XABLDuzCFJmnhA", "queryId": "Cr3qPw53XABLDuzCFJmnhA",
"features": { "features": {
"profile_label_improvements_pcf_label_in_post_enabled": true, "profile_label_improvements_pcf_label_in_post_enabled": true,
@ -1545,6 +1673,8 @@
} }
}, },
"CommunityHashtagsTimeline": { "CommunityHashtagsTimeline": {
"@path": "/i/api/graphql/zD5okPf_YV2nYIC8MIPBOQ",
"@method": "GET",
"queryId": "zD5okPf_YV2nYIC8MIPBOQ", "queryId": "zD5okPf_YV2nYIC8MIPBOQ",
"features": { "features": {
"profile_label_improvements_pcf_label_in_post_enabled": true, "profile_label_improvements_pcf_label_in_post_enabled": true,
@ -1581,12 +1711,18 @@
} }
}, },
"isEligibleForVoButtonUpsellQuery": { "isEligibleForVoButtonUpsellQuery": {
"@path": "/i/api/graphql/BuWF9hiwmUyFdGo3J4DqbA",
"@method": "GET",
"queryId": "BuWF9hiwmUyFdGo3J4DqbA" "queryId": "BuWF9hiwmUyFdGo3J4DqbA"
}, },
"isEligibleForAnalyticsUpsellQuery": { "isEligibleForAnalyticsUpsellQuery": {
"@path": "/i/api/graphql/I_tJ_DO6WLqG0em8EQsVVg",
"@method": "GET",
"queryId": "I_tJ_DO6WLqG0em8EQsVVg" "queryId": "I_tJ_DO6WLqG0em8EQsVVg"
}, },
"NotificationsTimeline": { "NotificationsTimeline": {
"@path": "/i/api/graphql/WERRji0vXRGrMiQ8LPZ3sw",
"@method": "GET",
"queryId": "WERRji0vXRGrMiQ8LPZ3sw", "queryId": "WERRji0vXRGrMiQ8LPZ3sw",
"features": { "features": {
"rweb_video_screen_enabled": false, "rweb_video_screen_enabled": false,
@ -1624,9 +1760,13 @@
} }
}, },
"TopicCarouselQuery": { "TopicCarouselQuery": {
"@path": "/i/api/graphql/byVjaS0CUtBqAao_lhZFgA",
"@method": "GET",
"queryId": "byVjaS0CUtBqAao_lhZFgA" "queryId": "byVjaS0CUtBqAao_lhZFgA"
}, },
"CommunitiesExploreTimeline": { "CommunitiesExploreTimeline": {
"@path": "/i/api/graphql/WD5si_oxsmp1axMAKeD9YA",
"@method": "GET",
"queryId": "WD5si_oxsmp1axMAKeD9YA", "queryId": "WD5si_oxsmp1axMAKeD9YA",
"features": { "features": {
"rweb_video_screen_enabled": false, "rweb_video_screen_enabled": false,

View file

@ -13,7 +13,10 @@ from pathlib import Path
from typing import Any from typing import Any
import openapi_client as pt import openapi_client as pt
import requests
import urllib3 import urllib3
from x_client_transaction import ClientTransaction
from x_client_transaction.utils import handle_x_migration
warnings.filterwarnings("ignore") warnings.filterwarnings("ignore")
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s") logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s")
@ -58,13 +61,17 @@ def find_name(x):
def get_kwargs(key, additional): def get_kwargs(key, additional):
kwargs = {"path_query_id": placeholder[key]["queryId"]} kwargs = {"path_query_id": placeholder[key]["queryId"], "_headers": {}}
if placeholder[key].get("variables") is not None: if placeholder[key].get("variables") is not None:
kwargs["variables"] = json.dumps(placeholder[key]["variables"] | additional) kwargs["variables"] = json.dumps(placeholder[key]["variables"] | additional)
if placeholder[key].get("features") is not None: if placeholder[key].get("features") is not None:
kwargs["features"] = json.dumps(placeholder[key]["features"]) kwargs["features"] = json.dumps(placeholder[key]["features"])
if placeholder[key].get("fieldToggles") is not None: if placeholder[key].get("fieldToggles") is not None:
kwargs["field_toggles"] = json.dumps(placeholder[key]["fieldToggles"]) kwargs["field_toggles"] = json.dumps(placeholder[key]["fieldToggles"])
if placeholder[key].get("@path") is not None:
kwargs["_headers"]["x-client-transaction-id"] = ct.generate_transaction_id(
method=placeholder[key]["@method"], path=placeholder[key]["@path"]
)
return kwargs return kwargs
@ -267,6 +274,12 @@ if __name__ == "__main__":
api_conf.access_token = access_token api_conf.access_token = access_token
api_client = pt.ApiClient(configuration=api_conf, cookie=cookies_str) api_client = pt.ApiClient(configuration=api_conf, cookie=cookies_str)
api_client.user_agent = get_header(latest_user_agent, "chrome-fetch")["user-agent"] api_client.user_agent = get_header(latest_user_agent, "chrome-fetch")["user-agent"]
session = requests.Session()
session.headers = get_header(latest_user_agent, "chrome")
ct = ClientTransaction(handle_x_migration(session))
error_count = 0 error_count = 0
for x in [pt.DefaultApi, pt.TweetApi, pt.UserApi, pt.UsersApi, pt.UserListApi]: for x in [pt.DefaultApi, pt.TweetApi, pt.UserApi, pt.UsersApi, pt.UserListApi]:
@ -354,7 +367,10 @@ if __name__ == "__main__":
try: try:
logger.info("Try: Self UserTweets Test") logger.info("Try: Self UserTweets Test")
kwargs = get_kwargs("UserTweets", {"userId": id}) kwargs = get_kwargs("UserTweets", {"userId": id})
res = pt.TweetApi(api_client).get_user_tweets_with_http_info(**kwargs) headers = get_header()
res = pt.TweetApi(api_client).get_user_tweets_with_http_info(
_headers=headers, **kwargs
)
data = res.data.to_dict() data = res.data.to_dict()
rate = match_rate( rate = match_rate(
@ -388,7 +404,7 @@ if __name__ == "__main__":
"1875050002046726519", "1875050002046726519",
"1848219562136801480", "1848219562136801480",
"1881993128288399684", "1881993128288399684",
"1899104692577489182" "1899104692577489182",
] ]
for id in ids: for id in ids:
try: try:

View file

@ -3,65 +3,77 @@ import re
from urllib.parse import urlencode, urlparse from urllib.parse import urlencode, urlparse
import openapi_client as pt import openapi_client as pt
import requests
import urllib3 import urllib3
from x_client_transaction import ClientTransaction
from x_client_transaction.utils import handle_x_migration
def get_kwargs(key, additional): def get_kwargs(key, additional):
kwargs = {"path_query_id": placeholder[key]["queryId"]} kwargs = {"path_query_id": placeholder[key]["queryId"], "_headers": {}}
if placeholder[key].get("variables") is not None: if placeholder[key].get("variables") is not None:
kwargs["variables"] = json.dumps(placeholder[key]["variables"] | additional) kwargs["variables"] = json.dumps(placeholder[key]["variables"] | additional)
if placeholder[key].get("features") is not None: if placeholder[key].get("features") is not None:
kwargs["features"] = json.dumps(placeholder[key]["features"]) kwargs["features"] = json.dumps(placeholder[key]["features"])
if placeholder[key].get("fieldToggles") is not None: if placeholder[key].get("fieldToggles") is not None:
kwargs["field_toggles"] = json.dumps(placeholder[key]["fieldToggles"]) kwargs["field_toggles"] = json.dumps(placeholder[key]["fieldToggles"])
if placeholder[key].get("@path") is not None:
kwargs["_headers"]["x-client-transaction-id"] = ct.generate_transaction_id(
method=placeholder[key]["@method"], path=placeholder[key]["@path"]
)
return kwargs return kwargs
class SessionManager: class SessionManager:
def __init__(self) -> None: def __init__(self) -> None:
header = "https://raw.githubusercontent.com/fa0311/latest-user-agent/refs/heads/main/header.json" header = "https://raw.githubusercontent.com/fa0311/latest-user-agent/refs/heads/main/header.json"
self.http = urllib3.PoolManager() self.http = urllib3.PoolManager()
self.chorome_header = json.loads(self.http.request("GET", header).data) self.chorome_header = json.loads(self.http.request("GET", header).data)
def child(self): def child(self):
return SessionManagerChild(self.http,self.chorome_header) return SessionManagerChild(self.http, self.chorome_header)
class SessionManagerChild: class SessionManagerChild:
def __init__(self, http, chorome_header) -> None: def __init__(self, http, chorome_header) -> None:
self.http = http self.http = http
self.chorome_header = chorome_header self.chorome_header = chorome_header
self.session = {} self.session = {}
def cookie_normalize(self, cookie: list[str]) -> dict[str, str]: def cookie_normalize(self, cookie: list[str]) -> dict[str, str]:
value = {x.split("; ")[0].split("=")[0]: x.split("; ")[0].split("=")[1] for x in cookie} value = {
x.split("; ")[0].split("=")[0]: x.split("; ")[0].split("=")[1]
for x in cookie
}
return {key: value[key] for key in value if len(value[key]) > 0} return {key: value[key] for key in value if len(value[key]) > 0}
def cookie_to_str(self, cookie: dict[str, str]) -> str: def cookie_to_str(self, cookie: dict[str, str]) -> str:
return "; ".join([f"{key}={value}" for key, value in cookie.items()]) return "; ".join([f"{key}={value}" for key, value in cookie.items()])
def getHader(self, additionals={}) -> dict[str, str]: def getHader(self, additionals={}) -> dict[str, str]:
ignore = ["host", "connection"] ignore = ["host", "connection"]
base = {key: value for key, value in self.chorome_header["chrome"].items() if key not in ignore} base = {
key: value
for key, value in self.chorome_header["chrome"].items()
if key not in ignore
}
return base | {"cookie": self.cookie_to_str(self.session)} | additionals return base | {"cookie": self.cookie_to_str(self.session)} | additionals
def update_normalize(self, cookie: list[str]): def update_normalize(self, cookie: list[str]):
self.update(self.cookie_normalize(cookie)) self.update(self.cookie_normalize(cookie))
def update(self, cookie: dict[str, str]): def update(self, cookie: dict[str, str]):
self.session.update(cookie) self.session.update(cookie)
def pop(self, key: str): def pop(self, key: str):
self.session.pop(key) self.session.pop(key)
def get(self, key: str): def get(self, key: str):
return self.session.get(key) return self.session.get(key)
def to_str(self): def to_str(self):
return self.cookie_to_str(self.session) return self.cookie_to_str(self.session)
def get_guest_token(): def get_guest_token():
twitter_url = "https://x.com/elonmusk" twitter_url = "https://x.com/elonmusk"
@ -69,9 +81,7 @@ def get_guest_token():
chrome = SessionManager() chrome = SessionManager()
x = chrome.child() x = chrome.child()
twitter = chrome.child() twitter = chrome.child()
def regex(str: str, **kwargs) -> str: def regex(str: str, **kwargs) -> str:
return str.format( return str.format(
quote=r"[\'\"]", quote=r"[\'\"]",
@ -79,21 +89,30 @@ def get_guest_token():
dot=r"\.", dot=r"\.",
any=r".*?", any=r".*?",
target=r"([\s\S]*?)", target=r"([\s\S]*?)",
**kwargs **kwargs,
) )
def redirect(method: str, url: str, body: str = None, headers: dict[str, str] = {}) -> urllib3.HTTPResponse: def redirect(
method: str, url: str, body: str = None, headers: dict[str, str] = {}
) -> urllib3.HTTPResponse:
for _ in range(10): for _ in range(10):
if urlparse(url).netloc == "x.com": if urlparse(url).netloc == "x.com":
res = http.request(method, url, headers=x.getHader(headers), body=body, redirect=False) res = http.request(
method, url, headers=x.getHader(headers), body=body, redirect=False
)
x.update_normalize(res.headers._container["set-cookie"][1:]) x.update_normalize(res.headers._container["set-cookie"][1:])
elif urlparse(url).netloc == "twitter.com": elif urlparse(url).netloc == "twitter.com":
res = http.request(method, url, headers=twitter.getHader(headers), body=body, redirect=False) res = http.request(
method,
url,
headers=twitter.getHader(headers),
body=body,
redirect=False,
)
twitter.update_normalize(res.headers._container["set-cookie"][1:]) twitter.update_normalize(res.headers._container["set-cookie"][1:])
else: else:
raise Exception("Invalid domain") raise Exception("Invalid domain")
method = "GET" method = "GET"
body = None body = None
headers = {} headers = {}
@ -109,7 +128,7 @@ def get_guest_token():
url = f"{domain}{new_path}" url = f"{domain}{new_path}"
else: else:
url = new_path url = new_path
elif re.findall(regex(location), res.data.decode()): elif re.findall(regex(location), res.data.decode()):
url = re.findall(regex(location), res.data.decode())[0] url = re.findall(regex(location), res.data.decode())[0]
elif re.findall(regex(submit), res.data.decode()): elif re.findall(regex(submit), res.data.decode()):
@ -118,7 +137,7 @@ def get_guest_token():
input_html = re.findall(regex(input), form_html[0][1]) input_html = re.findall(regex(input), form_html[0][1])
method = "POST" method = "POST"
url = form_html[0][0] url = form_html[0][0]
body = urlencode({k:v for k,v in input_html}) body = urlencode({k: v for k, v in input_html})
headers = {"content-type": "application/x-www-form-urlencoded"} headers = {"content-type": "application/x-www-form-urlencoded"}
elif res.status == 200: elif res.status == 200:
return res return res
@ -126,21 +145,19 @@ def get_guest_token():
raise Exception("Failed to redirect") raise Exception("Failed to redirect")
else: else:
raise Exception("Failed to redirect") raise Exception("Failed to redirect")
res = redirect("GET", twitter_url) res = redirect("GET", twitter_url)
reg = "document{dot}cookie{space}={space}{quote}{target}{quote}" reg = "document{dot}cookie{space}={space}{quote}{target}{quote}"
if re.findall(regex(reg), res.data.decode()): if re.findall(regex(reg), res.data.decode()):
find = re.findall(regex(reg), res.data.decode()) find = re.findall(regex(reg), res.data.decode())
x.update_normalize(find) x.update_normalize(find)
if x.get("gt") is None: if x.get("gt") is None:
raise Exception("Failed to get guest token") raise Exception("Failed to get guest token")
return x return x
if __name__ == "__main__": if __name__ == "__main__":
cookies = get_guest_token() cookies = get_guest_token()
cookies_str = cookies.to_str() cookies_str = cookies.to_str()
@ -167,15 +184,33 @@ if __name__ == "__main__":
api_client = pt.ApiClient(configuration=api_conf, cookie=cookies_str) api_client = pt.ApiClient(configuration=api_conf, cookie=cookies_str)
api_client.user_agent = latest_user_agent["chrome-fetch"] api_client.user_agent = latest_user_agent["chrome-fetch"]
res = pt.TweetApi(api_client).get_user_tweets_with_http_info( session = requests.Session()
**get_kwargs("UserTweets", {}), session.headers = latest_user_agent["chrome"]
).model_dump_json() ct = ClientTransaction(handle_x_migration(session))
res = pt.TweetApi(api_client).get_user_highlights_tweets_with_http_info(
**get_kwargs("UserHighlightsTweets", {}), res = (
).model_dump_json() pt.TweetApi(api_client)
res = pt.DefaultApi(api_client).get_tweet_result_by_rest_id_with_http_info( .get_user_tweets_with_http_info(
**get_kwargs("TweetResultByRestId", {}), **get_kwargs("UserTweets", {}),
).model_dump_json() )
res = pt.UserApi(api_client).get_user_by_screen_name_with_http_info( .model_dump_json()
**get_kwargs("UserByScreenName", {}) )
).model_dump_json() res = (
pt.TweetApi(api_client)
.get_user_highlights_tweets_with_http_info(
**get_kwargs("UserHighlightsTweets", {}),
)
.model_dump_json()
)
res = (
pt.DefaultApi(api_client)
.get_tweet_result_by_rest_id_with_http_info(
**get_kwargs("TweetResultByRestId", {}),
)
.model_dump_json()
)
res = (
pt.UserApi(api_client)
.get_user_by_screen_name_with_http_info(**get_kwargs("UserByScreenName", {}))
.model_dump_json()
)

View file

@ -143,6 +143,8 @@ def main():
with open("./src/config/placeholder.json", "w") as f: with open("./src/config/placeholder.json", "w") as f:
placeholder[endpoint] = placeholder.get(endpoint, {}) placeholder[endpoint] = placeholder.get(endpoint, {})
placeholder[endpoint]["@path"] = f"/i/api/graphql/{query_id}/{endpoint}"
placeholder[endpoint]["@method"] = method
placeholder[endpoint]["queryId"] = query_id placeholder[endpoint]["queryId"] = query_id
if features: if features:
placeholder[endpoint]["features"] = features placeholder[endpoint]["features"] = features