The InstaClient
classο
- InstaTweet.instaclient.USER_AGENTο
Hardcoded user agent proven to work with the
get_user()
endpoint introduced in v2.0.0b13
- InstaClient.DOWNLOAD_DIRο
[Optional] β Directory to temporarily download media to
- class InstaTweet.instaclient.InstaClient(session_id, user_agent=USER_AGENT, proxies=None)[source]View on GitHubο
Bases:
object
Minimalistic class for scraping/downloading Instagram user/media data
- __init__(session_id, user_agent=USER_AGENT, proxies=None)[source]View on GitHubο
Initialize an
InstaClient
with an Instagram sessionid cookie (at minimum)Note
As of v2.0.0b13, the endpoint used by
get_user()
seems to require a specificUSER_AGENT
You can override the hardcoded one if youβd like, but youβll likely get a"useragent mismatch"
response
- request(url)[source]View on GitHubο
Sends a request using the
cookies
,headers
, andproxies
- Parameters
url (str) β the Instagram URL to send the request to
- Return type
Response
- get_user(username)[source]View on GitHubο
Scrapes an Instagram userβs profile and wraps the response
- download_post(post, filepath=None)[source]View on GitHubο
Downloads the media from an Instagram post