Closed Extremalzhez closed 2 years ago
no delete the token.txt file in the folder
fixed by deleting "ine_tokens.txt" Thank you!
here's the easy fix so not having ot delete it every time start script. add os.remove in main like so
`
if name == 'main': if not (sys.version_info.major == 3 and sys.version_info.minor >= 6): print("This script requires Python 3.6 or higher!") exit("You are using Python {}.{}".format(sys.version_info.major, sys.version_info.minor)) os.system('cls') if os.name == 'nt' else os.system('clear') print("INE Courses Downloader\n")
if os. path. exists(token_path):
os. remove(token_path)
if(os.path.isfile(token_path)):
with open(token_path,'r') as fp:
try:
fp = json.loads(fp.read())
access_token = fp["access_token"]
refresh_token = fp["refresh_token"]
access_token = "Bearer "+ access_token
except:
print("Please check the data in token file and correct for errors")
if(len(access_token) == 0):
print("Please refer to readme.md in github and set the access_token")
exit()
if(len(access_token) != 1009):
print("Access token entered is faulty. Check for and correct errors!")
exit()
if(len(refresh_token) == 0):
print("Please refer to readme.md in github and set the refresh_token")
exit()
if(len(refresh_token) != 1784):
print("Refresh token entered is faulty. Check and correct errors!")
exit()
auth_check()
else:
login()
`
this will remove the file and recreate it each run
do i need create a new scrpit and put this on new file? or should i add it to current ine.py file?
best to make a copy and add it to the copy
can you explain little bit where should i put this lines? at existitng script or should create a new one?
send dm please
HI, again, after I've changed line refresh_token = login_data["data"]["tokens"]["data"]["Bearer"] I've got access, but after choosing 2 it just freeze, i have closed the window and reopened again and now i'm hitting this error:
access token entered is faulty. Check for and correct errors!
Should i wait for 4hrs to refresh the token or?