OlegYurchik / pyInstagram

This is a simple and easy-to-use library for interacting with the Instagram. The library works through the web interface of the Instagram and does not depend on the official API
MIT License
232 stars 49 forks source link

Не отображаются подписчики аккаунта #61

Closed dalukyanov closed 5 years ago

dalukyanov commented 5 years ago

Добрый день,

Не могу получить список подписчиков аккаунта. Как через WebAgent, так и через WebAgentAccount. Всегда выдаёт пустой список set()

Возможно, я что-то делаю не так?

import argparse
from instagram import WebAgentAccount, WebAgent, Account
import pickle

# Parsing instagram login and password command line arguments
parser = argparse.ArgumentParser()
parser.add_argument('--instagram_login', action='store', help='Your instagram login', required=True)
parser.add_argument('--instagram_password', action='store', help='Your instagram password', required=True)
args = parser.parse_args()

instagram_login = args.instagram_login
instagram_password = args.instagram_password

instagram_cookies = None

with open('instagram_cookies.pickle', 'rb') as f:
    instagram_cookies = pickle.load(f)

#agent = WebAgent()
agent = WebAgentAccount(instagram_login, instagram_cookies)
agent.auth(instagram_password)
account = Account("same_account_as_instagram_login")

#cookie_dict = requests.utils.dict_from_cookiejar(agent.session.cookies)
#with open('instagram_cookies.pickle', 'wb') as f:
#    pickle.dump(cookie_dict, f)

print(account.followers)
OlegYurchik commented 5 years ago

Недостаточно создать объект аккаунта, его ещё нужно обновить. В примерах в документации это есть.

agent.update(account)