junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.59k stars 134 forks source link

Logout Method #170

Open sooluh opened 1 year ago

sooluh commented 1 year ago

I noticed that nobody has discussed this yet, so I will open it. I'm not very familiar with your codebase and I have a busy schedule, so I can't make a pull request. However, I will assist by providing the request and response that I obtained from this threads application. Hopefully, it will be helpful. Good luck!

Request

POST /api/v1/accounts/logout/ HTTP/2
Host: i.instagram.com
X-Ig-App-Locale: en_US
X-Ig-Device-Locale: en_US
X-Ig-Mapped-Locale: en_US
X-Pigeon-Session-Id: UFS-e5323fed-6048-4f69-a4e3-fb56789ec874-0
X-Pigeon-Rawclienttime: 1689400026.838
X-Ig-Bandwidth-Speed-Kbps: -1.000
X-Ig-Bandwidth-Totalbytes-B: 0
X-Ig-Bandwidth-Totaltime-Ms: 0
X-Bloks-Version-Id: 5f56efad68e1edec7801f630b5c122704ec5378adbee6609a448f105f34a9c73
X-Ig-Www-Claim: hmac.AR2VbZxaKOEl-Tz1b0wGKk6bWmqR3Wg7_FmUiVFwoOt7-Ivx
X-Bloks-Is-Layout-Rtl: false
X-Ig-Device-Id: d5c68539-e663-4a8c-bb49-c0c031c65e17
X-Ig-Family-Device-Id: 6138f7ef-29a7-4581-baab-682ac87932a6
X-Ig-Android-Id: android-fd4cad711746ba6b
X-Ig-Timezone-Offset: 25200
X-Ig-Nav-Chain: BarcelonaNavigationLogger$logNavigationCompleted$1:ig_text_feed_timeline:1:cold_start:1689400013.263::,BarcelonaNavigationLogger$logNavigationCompleted$1:ig_text_feed_timeline:2:button:1689400013.574::,BarcelonaNavigationLogger$logNavigationCompleted$1:ig_text_feed_profile:3:button:1689400019.337::,BarcelonaNavigationLogger$logNavigationCompleted$1:ig_text_feed_settings:4:button:1689400024.577::
X-Fb-Connection-Type: WIFI
X-Ig-Connection-Type: WIFI
X-Ig-Capabilities: 3brTv10=
X-Ig-App-Id: 3419628305025917
Priority: u=3
User-Agent: Barcelona 289.0.0.77.109 Android (33/13; 560dpi; 1440x3036; Google/google; sdk_gphone_x86_64; emu64xa; ranchu; en_US; 489720161)
Accept-Language: en-US
Authorization: Bearer IGT:2:$TOKEN
X-Mid: ZKre4AABAAEO0y4_43vt3eXHtOeE
Ig-U-Ds-User-Id: 49248544499
Ig-U-Rur: EAG,49248544499,1720936020:01f70beac442495a94b221777364d92f78176510d9710545e1278cdc978be5a5ad4d1e7b
Ig-Intended-User-Id: 49248544499
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 165
Accept-Encoding: gzip, deflate
X-Fb-Http-Engine: Liger
X-Fb-Client-Ip: True
X-Fb-Server-Cluster: True

phone_id=6138f7ef-29a7-4581-baab-682ac87932a6&guid=d5c68539-e663-4a8c-bb49-c0c031c65e17&device_id=android-fd4cad711746ba6b&_uuid=d5c68539-e663-4a8c-bb49-c0c031c65e17

Response

HTTP/2 200 OK
Content-Type: application/json; charset=utf-8
Date: Sat, 15 Jul 2023 05:47:08 GMT
Vary: Accept-Language
Content-Language: en
Strict-Transport-Security: max-age=31536000
Cache-Control: private, no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: Sat, 01 Jan 2000 00:00:00 GMT
X-Frame-Options: SAMEORIGIN
Content-Security-Policy: report-uri https://www.instagram.com/security/csp_report/; default-src 'self' https://www.instagram.com; img-src data: blob: https://*.fbcdn.net https://*.instagram.com https://*.cdninstagram.com https://*.facebook.com https://*.fbsbx.com https://*.giphy.com; font-src data: https://*.fbcdn.net https://*.instagram.com https://*.cdninstagram.com; media-src 'self' blob: https://www.instagram.com https://*.cdninstagram.com https://*.fbcdn.net; manifest-src 'self' https://www.instagram.com; script-src 'self' https://instagram.com https://www.instagram.com https://*.www.instagram.com https://*.cdninstagram.com wss://www.instagram.com https://*.facebook.com https://*.fbcdn.net https://*.facebook.net 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' https://*.www.instagram.com https://www.instagram.com 'unsafe-inline'; connect-src 'self' https://instagram.com https://www.instagram.com https://*.www.instagram.com https://graph.instagram.com https://*.graph.instagram.com https://i.instagram.com/graphql_www https://graphql.instagram.com https://*.cdninstagram.com https://api.instagram.com https://i.instagram.com https://*.i.instagram.com https://*.od.instagram.com wss://www.instagram.com wss://edge-chat.instagram.com https://*.facebook.com https://*.fbcdn.net https://*.facebook.net chrome-extension://boadgeojelhgndaghljhdicfkmllpafd blob:; worker-src 'self' blob: https://www.instagram.com; frame-src 'self' https://instagram.com https://www.instagram.com https://*.instagram.com https://staticxx.facebook.com https://www.facebook.com https://web.facebook.com https://connect.facebook.net https://m.facebook.com https://*.fbsbx.com; object-src 'none'; upgrade-insecure-requests
Cross-Origin-Embedder-Policy-Report-Only: require-corp;report-to="coep"
Report-To: {"group": "coep", "max_age": 86400, "endpoints": [{"url": "/security/coep_report/"}]},{"group": "coop", "max_age": 86400, "endpoints": [{"url": "/security/coop_report/"}]}
Origin-Trial: AuqWincgAuXeuu3KypEMnrrFEJHySaesyJS3EaIH40zvafzrU0Irhb7+5QwZpOqMZrPTjgvFl7Z5jJgy1dNAcQMAAAB6eyJvcmlnaW4iOiJodHRwczovL2luc3RhZ3JhbS5jb206NDQzIiwiZmVhdHVyZSI6IkNyb3NzT3JpZ2luT3BlbmVyUG9saWN5UmVwb3J0aW5nIiwiZXhwaXJ5IjoxNjEzNDExNjYyLCJpc1N1YmRvbWFpbiI6dHJ1ZX0=
Cross-Origin-Opener-Policy: same-origin-allow-popups;report-to="coop"
X-Content-Type-Options: nosniff
X-Xss-Protection: 0
X-Ig-Push-State: c2
X-Ig-Cache-Control: cache
X-Aed: 111
X-Ig-Set-Www-Claim: hmac.AR2VbZxaKOEl-Tz1b0wGKk6bWmqR3Wg7_FmUiVFwoOt7-Ivx
Access-Control-Expose-Headers: X-IG-Set-WWW-Claim
X-Ig-Request-Elapsed-Time-Ms: 1222
X-Ig-Peak-Time: 1
Retry-After: 1
Ig-Set-Authorization: Bearer IGT:2:
Ig-Set-Ig-U-Ig-Direct-Region-Hint: 
Ig-Set-Ig-U-Shbid: 
Ig-Set-Ig-U-Shbts: 
Ig-Set-Ig-U-Rur: EAG,49248544499,1720936020:01f70beac442495a94b221777364d92f78176510d9710545e1278cdc978be5a5ad4d1e7b
Ig-Set-Ig-U-Ds-User-Id: 49248544499
Content-Length: 15
X-Ig-Origin-Region: eag
X-Fb-Client-Ip-Forwarded: 182.253.127.233
X-Fb-Server-Cluster-Forwarded: cgk1c02
Alt-Svc: h3=":443"; ma=86400

{"status":"ok"}