該存儲庫包含我的筆記和發現,而反向工程線程應用程序。如果您發現新事物或使用此信息構建客戶(使用Credit ofc),請隨時使用PR。
目前僅讀取線程的Web版本,因此關於身份驗證或發布的信息不多。它使用Meta的Relay GraphQl客戶端與後端( threads.net/api/graphql )對話,該cloads.nets.nets.nets.nets.net/graphql)似乎已配置為禁止任意查詢。這使我們僅限於前端來源中發現的現有查詢:
請注意,在查詢GraphQL後端時,請確保設置用戶代理(似乎在這裡有效),並將
x-ig-app-id標頭設置為238260118697367。
文檔ID:
23996318473300828變量:
userID(用戶的ID)
curl --request POST
--url https://www.threads.net/api/graphql
--header ' user-agent: threads-client '
--header ' x-ig-app-id: 238260118697367 '
--header ' content-type: application/x-www-form-urlencoded '
--data ' variables={"userID":"314216"} '
--data doc_id=23996318473300828DOC ID:
6232751443445612變量:
userID(用戶的ID)
curl --request POST
--url https://www.threads.net/api/graphql
--header ' user-agent: threads-client '
--header ' x-ig-app-id: 238260118697367 '
--header ' content-type: application/x-www-form-urlencoded '
--data ' variables={"userID":"314216"} '
--data doc_id=6232751443445612DOC ID:
6307072669391286變量:
userID(用戶的ID)
curl --request POST
--url https://www.threads.net/api/graphql
--header ' user-agent: threads-client '
--header ' x-ig-app-id: 238260118697367 '
--header ' content-type: application/x-www-form-urlencoded '
--data ' variables={"userID":"314216"} '
--data doc_id=6307072669391286DOC ID:
5587632691339264變量:
postID(帖子的ID)
curl --request POST
--url https://www.threads.net/api/graphql
--header ' user-agent: threads-client '
--header ' x-ig-app-id: 238260118697367 '
--header ' content-type: application/x-www-form-urlencoded '
--data ' variables={"postID":"3138977881796614961"} '
--data doc_id=5587632691339264DOC ID:
9360915773983802變量:
mediaID(帖子的ID)
curl --request POST
--url https://www.threads.net/api/graphql
--header ' user-agent: threads-client '
--header ' x-ig-app-id: 238260118697367 '
--header ' content-type: application/x-www-form-urlencoded '
--data ' variables={"mediaID":"3138977881796614961"} '
--data doc_id=9360915773983802警告此端點當前僅適用於未啟用2FA的帳戶。
移動應用程序使用Meta的Bloks框架(最初是為Instagram Lite構建的)進行身份驗證。
線程的Bloks版本控制ID是00ba6fa565c3c707243ad976fa30a071a625f2a3d158d9412091176fe35027d8 。 Bloks還要求您提供設備ID(形狀ios-RANDOM | android-RANDOM , RANDOM是13個字符的隨機集)。
curl --request POST
--url ' https://i.instagram.com/api/v1/bloks/apps/com.bloks.www.bloks.caa.login.async.send_login_request/ '
--header ' user-agent: Barcelona 289.0.0.77.109 Android '
--header ' sec-fetch-site: same-origin '
--header ' content-type: application/x-www-form-urlencoded; charset=UTF-8 '
--data ' params={"client_input_params":{"password":"$PASSWORD","contact_point":"$USERNAME","device_id":"$DEVICE_ID"},"server_params":{"credential_type":"password","device_id":"$DEVICE_ID"}} '
--data ' bloks_versioning_id=00ba6fa565c3c707243ad976fa30a071a625f2a3d158d9412091176fe35027d8 '此請求返回一個很大的JSON有效載荷。您的令牌將立即在字符串Bearer IGT:2:應為160個字符。
curl --request POST
--url ' https://i.instagram.com/api/v1/media/configure_text_only_post/ '
--header ' content-type: application/x-www-form-urlencoded; charset=UTF-8 '
--header ' user-agent: Barcelona 289.0.0.77.109 Android '
--header ' authorization: Bearer IGT:2:$TOKEN '
--header ' sec-fetch-site: same-origin '
--data ' signed_body=SIGNATURE.{"publish_mode":"text_post","text_post_app_info":"{"reply_control":0}","timezone_offset":"0","source_type":"4","_uid":"$USER_ID","device_id":"$DEVICE_ID","caption":"$POST_TEXT","device":{"manufacturer":"OnePlus","model":"ONEPLUS+A3003","android_version":26,"android_release":"8.1.0"}} ' 線程使用Instagram使用的同一ID系統。從用戶名轉換為ID的最佳方法似乎是請求用戶的Instagram頁面( instagram.com/:username )並手動解析響應HTML。有關其他方法,請參閱此stackoverflow問題。