Closed andrei-polukhin closed 1 year ago
Agreed, this information would be very helpful thank you.
this code may help you to reuse cookie for sure.
from instagram_private_api import Client,ClientCompatPatch
import pickle
import os
def writeSettings(user,pwd,settings_file):
api = Client(user,pwd)
pickle.dump(api.settings,open(settings_file,"wb"))
def readSettings(settings_file):
return pickle.load(open(settings_file,"rb"))
if not os.path.exists("settingObj"):
writeSettings("user","pwd","settingObj")
cache_settings = readSettings("settingObj")
api = Client("user","pwd",settings=cache_settings)
this code may help you to reuse cookie for sure.
from instagram_private_api import Client,ClientCompatPatch import pickle import os def writeSettings(user,pwd,settings_file): api = Client(user,pwd) pickle.dump(api.settings,open(settings_file,"wb")) def readSettings(settings_file): return pickle.load(open(settings_file,"rb")) if not os.path.exists("settingObj"): writeSettings("user","pwd","settingObj") cache_settings = readSettings("settingObj") api = Client("user","pwd",settings=cache_settings)
Thanks!
Please follow the guide below
x
into all the boxes [ ] relevant to your issue (==> [x] no spaces).Before submitting an issue, make sure you have:
Which client are you using?
instagram_private_api/
)instagram_web_api/
)After reading your file on reusing cookies, I did not find clarifying information on how to use this library with cookies. Should you add some more documentation devoted specifically to this problem?