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't login anymore #15

Closed fishcakedev closed 5 years ago

fishcakedev commented 5 years ago

problem persists for a while now. didn't tamper with the config file or anything. it just stopped working over night.

terminal output: 18:53:58 Cannot connect to moodle or Moodle has changed. Crawler is not logged in. Check your login data.

C0D3D3V commented 5 years ago

Is the Moodle you use public? Could you share a link to the Moodle? Maybe something has changed on the Moodle, I could check if it is still compatible with the downloader.

It would also be helpful if you set "loglevel" to 5 in the configuration and then upload the log e.g. to pastebin.

fishcakedev commented 5 years ago

01:02:24 Moodle Crawler started working. 01:02:24 Try to login... 01:02:24 Download has started. 01:02:24 No Content-Length available. 01:02:24 Downloaded 34007 bytes 01:02:24 Download complete. 01:02:24 Cannot connect to moodle or Moodle has changed. Crawler is not logged in. Check your login data.

moodle link: https://moodle.uni-wuppertal.de/

C0D3D3V commented 5 years ago

Do you use https://moodle.uni-wuppertal.de/login/index.php in the configuration as 'authurl'? And https://moodle.uni-wuppertal.de as 'baseurl'? And did you set 'useauthstate' to false?

Edit: And try to set 'reloginonfile' to false. If that is not working, maybe you could post your configuration, with the exception of your login data.

fishcakedev commented 5 years ago

yeah exactly that configuration you're mentioning

here's my .ini

` [dirs] root_dir = "path/to/mydirectory"

[auth] username = ""
password = "" authurl = "https://moodle.uni-wuppertal.de/login/index.php" baseurl = "https://moodle.uni-wuppertal.de/" useauthstate = false

reloginonfile = false

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

onlycrawlcourses = "123,4122"

onlycrawlcourses = "" dontcrawlcourses = "" antirecrusion = true

[other] colors = true notifications = false `

fishcakedev commented 5 years ago

hey happy new year!

wanted to check back and see if you have any ideas on how to resolve this problem

C0D3D3V commented 5 years ago

Hey, I also wish you a super great year.

At first view it looked as if this Moodle is using an additional "logintoken". I've already done some tests. Just because of the holidays and because I was on the 35c3, I didn't manage to write the update. I'm trying to write the update tonight, then you can test it.

C0D3D3V commented 5 years ago

Maybe 4ed6dab2a027158ebb87ed0711224509f6ddc954 fix this. I could only test the login not crawling.

Set 'uselogintoken' in the settings to 'true'!

fishcakedev commented 5 years ago

now I get

➜ #1 moodle git:(master) ✗ python moodleCrawler.py Traceback (most recent call last): File "moodleCrawler.py", line 46, in <module> gi.require_version('Notify', '0.7') File "/usr/local/lib/python2.7/site-packages/gi/__init__.py", line 129, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Notify not available

C0D3D3V commented 5 years ago

:D Then you probably used a relatively old version before. Actually, I've had the module in it for 2 years already, because someone once requested it. But I personally don't use it either. I'll just remove the feature. I don't think it's useful. Maybe I'll add an email notification later.

C0D3D3V commented 5 years ago

For now I made the library optional, so the bug should be fixed with d1d6aad4f772e130e9e458f05c1f7554d2cfb1d7. As long as you have the option notifications set to false.

fishcakedev commented 5 years ago

oh yeah I just deleted those 3 or 4 lines and it worked :) but your method is way more convenient.

thank you for your help. finally I can go back to being lazy!