subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.38k stars 685 forks source link

insightAccount #173

Closed rhatami7495 closed 3 years ago

rhatami7495 commented 3 years ago

hi.how to get doc_id and set for api ads/graphql/?

adw0rd commented 3 years ago

For example, you can dump requests through ProxyMan or Charles

But why do you need it? Everything is already implemented in https://adw0rd.github.io/instagrapi/usage-guide/insight.html

rhatami7495 commented 3 years ago

error When I use Charles , it gets a binary result for Instagram api. What do you think I should do?

adw0rd commented 3 years ago

@rhatami7495 have you turned on Whitehat Settings? image

adw0rd commented 3 years ago

Does instagram give you response headers? If only body is binary, then is there any mention of zstd compression in the headers?

image

image

adw0rd commented 3 years ago

And install zstd tool. For macos:

brew install zstd

$ cat ~/response.bin
eDʔ�I��mWv��̤C'wV�z'$(�|�s�ߜ�is6@.*vC{v |�w3���

$ zstdcat ~/response.bin
{"friendship_status":{"following":false,"followed_by":false,"blocking":false,"muting":false,"is_private":false,"incoming_request":false,"outgoing_request":false,"is_bestie":false,"is_restricted":false},"status":"ok"}

For linux or any other system, you can use my utility:

pip install zstdcat

https://github.com/adw0rd/zstdcat https://pypi.org/project/zstdcat/

adw0rd commented 3 years ago

Or install python package pip install zstd

import zstd, json
json.loads(zstd.decompress(open('/tmp/response.bin', 'rb').read()).decode())
rhatami7495 commented 3 years ago

Or install python package pip install zstd

import zstd, json
json.loads(zstd.decompress(open('/tmp/response.bin', 'rb').read()).decode())
adw0rd commented 3 years ago

@rhatami7495 just created for this https://github.com/adw0rd/zstdcat