0
from instapy_cli import client
username = 'username'
password = 'password'
image = 'test.jpg'
text = 'Hello World \n#Python\n#instapy_cli '
with client(username, password) as cli:
    cli.upload(image, text)

Прилетает ошибка [IG] not found cookie/cookie_file >> login as default ClientError checkpoint_challenge_required (Code: 400, Response: {"message": "challenge_required", "challenge": {"url": "https://i.instagram.com/challenge/1407799808/CRMmDt7pdN/", "api_path": "/challenge/1407799808/CRMmDt7pdN/", "hide_webview_header": true, "lock": true, "logout": false, "native_flow": true}, "status": "fail", "error_type": "checkpoint_challenge_required"})

Я делал cli.getcookie(), но ничего не получилось.

1
  • А куки ваши где лежат?
    – Alexsey Kr
    21 окт 2019 в 10:56

1 ответ 1

0
from instapy_cli import client

username = 'USERNAME'
password = 'PASSWORD'
cookie_file = 'COOKIE_FOR_USER.json' # default: `USERNAME_ig.json`

with client(username, password, cookie_file=cookie_file, 
    write_cookie_file=True) as cli:
    # get string cookies
    cookies = cli.get_cookie()
    print(type(cookies)) # == str
    print(cookies)
    # do stuffs with cli
    ig = cli.api()
    me = ig.current_user()
    print(me)

в файле COOKIE_FOR_USER.json должны быть ваши куки

https://github.com/instagrambot/instapy-cli/tree/master/examples

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.