Skip to content

Instantly share code, notes, and snippets.

@ohld
Created March 3, 2019 00:36
Show Gist options
  • Save ohld/2a164c92e16914ed403bfd0123b7520f to your computer and use it in GitHub Desktop.
Save ohld/2a164c92e16914ed403bfd0123b7520f to your computer and use it in GitHub Desktop.
USERNAME, PASSWORD = 'your_instagram_login', 'your_instagram_password'
LOGIN_URL = 'https://i.instagram.com/api/v1/accounts/login/'
REQUEST_HEADERS = { 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8' }
IG_SIG_KEY = '99e16edcca71d7c1f3fd74d447f6281bd5253a623000a55ed0b60014467a53b1'
# I have more devices here:
# https://github.com/instagrambot/instabot/blob/72d10447986db39ac95f3d0980936d9c08428b02/instabot/api/devices.py
# idk which to use, let's for now use this one, because it is just works
DEVICE = {
'instagram_version': '26.0.0.10.86',
'android_version': 24,
'android_release': '7.0',
'dpi': '640dpi',
'resolution': '1440x2560',
'manufacturer': 'HUAWEI',
'device': 'LON-L29',
'model': 'HWLON',
'cpu': 'hi3660'
}
USER_AGENT_BASE = (
'Instagram {instagram_version} '
'Android ({android_version}/{android_release}; '
'{dpi}; {resolution}; {manufacturer}; '
'{device}; {model}; {cpu}; en_US)'
)
user_agent = USER_AGENT_BASE.format(**DEVICE) # just insert params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment