Jayapraveen / INE-courses-downloader

Python Script to download coures from INE.com website for personal and educational use
GNU General Public License v3.0
37 stars 19 forks source link

Can't get access it says "NameError: name 'access_token' is not defined" #42

Closed Extremalzhez closed 1 year ago

Extremalzhez commented 1 year ago

Hi, could you help me with your script please, i've got an error after trying to run the script, credentials were right but i've got an error:

Warning! Until the script completes execution do not access INE website or mobile app as it might invalidate the session!

Traceback (most recent call last): File "D:\git\INE-courses-downloader\Ine.py", line 652, in access_pass = pass_validator() File "D:\git\INE-courses-downloader\Ine.py", line 189, in pass_validator header = {"Host": host,"Origin": referer,"Authorization": access_token,"User-Agent": user_agent,"Accept": accept,"X-Requested-With": x_requested_with,"Accept-Encoding": accept_encodings,"sec-fetch-mode": sec_fetch_mode,"sec-fetch-dest": sec_fetch_dest,"Referer": referer} NameError: name 'access_token' is not defined

ghost commented 1 year ago

means the pass_validator() is not working

most likely its the removed refresh_token from the json. in previous issues posted there is a fix for this.

ghost commented 1 year ago

https://github.com/Jayapraveen/INE-courses-downloader/issues/34

Extremalzhez commented 1 year ago

I have changed the line: (old) refresh_token = login_data["data"]["tokens"]["data"]["Refresh"] (new) refresh_token = login_data["data"]["tokens"]["data"]["Bearer"]

But it didn't work, i've done all things that you're posted in #34

I'm newbie in python, could you please tell me which line i need to fix, i need this script to be working

Ine2.txt

Extremalzhez commented 1 year ago

the failure in line 187, it says access_token is not defined, so what should i do?

Extremalzhez commented 1 year ago

Ok, i solved the problem, thank you!

ghost commented 1 year ago

hope info given helped ;D