C0D3D3V / Moodle-Downloader

A Moodle Crawler that downloads course content from Moodle (eg. lecture pdfs)
GNU General Public License v3.0
28 stars 4 forks source link

Can login but no download (redirect login) #17

Open Cubytus opened 5 years ago

Cubytus commented 5 years ago

Base URL: https://studium.umontreal.ca It appears to be using a token as Firefox always asks if it needs to update the password as "f5-sso-token"

Error in the terminal:

02:36:11 Moodle Crawler started working.
02:36:11 Try to copy logintoken!
02:36:11 Download has started.
02:36:11 Download complete.                                       
Traceback (most recent call last):
  File "moodleCrawler.py", line 1470, in <module>
    if inputLogintoken is None or inputLogintoken[0] is None:
IndexError: list index out of range

My config.ini is set for only one course:

`[dirs]
root_dir = "/home/usuario/Escritorio/mo"

[auth]
username =  ""   
password = ""
authurl = "https://studium.umontreal.ca/login/index.php"
baseurl = "https://studium.umontreal.ca"
useauthstate = false

uselogintoken = true
reloginonfile = false

[crawl]
allcourses = false
forum = false
wiki = false
history = true
maxdepth = 9
loglevel = 5
externallinks = false
crawlcourseslink = "course/index.php"
findduplicates = true
findallduplicates = true
deleteduplicates = false
informationaboutduplicates = true
downloadcoursepages = true
dontcrawl = "mp4,mkv,mp3"

onlycrawlcourses = "128531"
dontcrawlcourses = ""
antirecrusion = true

[other]
colors = true
notifications = false`
C0D3D3V commented 5 years ago

You login on this page https://studium.umontreal.ca/my.policy right? It doesn't seems like, that they are using a login token.

First try to set authurl = "https://studium.umontreal.ca/my.policy" and uselogintoken = false

If this doesn't work I will add an option to add login parameters.

C0D3D3V commented 5 years ago

I tested a little bit and it seems like you where right. There is some kind of cookie based token for login. I will write tonight an update.

C0D3D3V commented 4 years ago

I created a new downloader, that should fix this issue... check it out here https://github.com/C0D3D3V/Moodle_Downloader_2