from context import Instagram # pylint: disable=no-name-in-module from time import sleep instagram = Instagram() cookie="/home/fanibi/Downloads/cookies.txt" instagram.set_cookies(cookie) #Search for account accounts = instagram.search_accounts_by_username('3.1415926535897932384626433832') print(accounts[0]) #get media account=accounts[0] account=account.username medias=instagram.get_medias(account,5) media1=medias[0] #like a picture:Does not work not logged in # instagram.like(media1.identifier) #unlike picture:Does not work not logged in # instagram.unlike(media1.identifier) #Try to get stories stories = instagram.get_stories() user_stories = stories[0] print(user_stories.owner) for story in user_stories.stories: print(story)
from context import Instagram # pylint: disable=no-name-in-module instagram = Instagram() instagram.with_credentials('username', 'password', 'path/to/cache/folder') instagram.login() accounts = instagram.search_accounts_by_username('Kevin M') account = accounts[0] # Following fields are available in this request print('Account info:') print('Username', account.username) print('Full name', account.full_name) print('Profile pic url', account.getProfilePicUrlHd())