Closed davepivonka closed 7 months ago
I have the same (or a very similar) problem. It ran fine on version 2.1.2.6 last year. My school updated moodle for this school year and it didn't work. I updated the configuration (with moodle-dl -c) and tried again. I got the same error. Then I updated moodle-dl to version 2.3.2.0 and tried again. I got the same error (differently formatted, but the same message) this time. I updated the config file again and the error stayed.
Here the (imho) relevant part of the error message (with the -v flag)
2023-09-01 16:02:48 DEBUG {request_helper} Details about the failed request:
URL: https://censored.example.com/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_get_contents
Body: {'moodlewssettingfilter': 'true', 'moodlewssettingfileurl': 'true', 'courseid': 2951, 'wsfunction': 'core_course_get_contents', 'wstoken': 'censored'}
The following error occurred during execution:
The Moodle System rejected the Request. Details: moodle_exception (Error code: cannotgetcoursecontents, Message: Kursinhalte können nicht geladen werden.)
2023-09-01 16:02:48 DEBUG {mail_service} Mail-Notifications not configured, skipping.
2023-09-01 16:02:48 INFO {telegram_service} Sending Notification via Telegram...
2023-09-01 16:02:48 DEBUG {connectionpool} Starting new HTTPS connection (1): api.telegram.org:443
2023-09-01 16:02:48 DEBUG {connectionpool} https://api.telegram.org:443 "POST /CENSORED/sendMessage HTTP/1.1" 200 467
2023-09-01 16:02:48 DEBUG {xmpp_service} XMPP-Notifications not configured, skipping.
2023-09-01 16:02:48 ERROR {main} Traceback (most recent call last):
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/main.py", line 536, in main
choose_task(config, opts)
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/main.py", line 68, in choose_task
run_main(config, opts)
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/main.py", line 136, in run_main
raise base_err
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/main.py", line 95, in run_main
changed_courses = asyncio.run(moodle.fetch_state(database))
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/moodle_service.py", line 117, in fetch_state
course_cores = await core_handler.async_load_course_cores(courses)
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/core_handler.py", line 157, in async_load_course_cores
cores = await asyncio.gather(*async_features)
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/utils.py", line 64, in run_with_final_message
result = await load_function(entry)
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/core_handler.py", line 166, in async_load_course_core
return await self.client.async_post('core_course_get_contents', data)
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/request_helper.py", line 141, in async_post
self.check_json_for_moodle_error(resp_json, url, data)
File "/home/moodle-dl/.local/lib/python3.7/site-packages/moodle_dl/moodle/request_helper.py", line 328, in check_json_for_moodle_error
+ f" Message: {resp_json.get('message', '')})"
moodle_dl.moodle.request_helper.RequestRejectedError: The Moodle System rejected the Request. Details: moodle_exception (Error code: cannotgetcoursecontents, Message: Kursinhalte können nicht geladen werden.)
2023-09-01 16:02:48 DEBUG {main} Exception-Handling completed. Exiting...
The current moodle version according to /lib/upgrade.txt is 4.1.5, I don't know the previous version. If you need more information, I would be happy to provide it Thank you for the amazing project btw., it saved me a lot of hassle for the last three years.
@Aunib That is a completly different issue. Please move it into an own issue.
Looks like a misconfiguration of your moodle instance, see https://moodle.org/mod/forum/discuss.php?d=343122 or https://moodle.org/mod/forum/discuss.php?d=355334
My guess is that for one of your lessons there is an error on the server. Currentlly moodle-dl has no option to deactivate loading of top level entries like lesson names. We should implement it.
Explanation
Hello, I have been trying to get the downloader to work for the past hour, but despite trying to change different settings (e.g. disabling or enabling the cookie files or ignoring ytdl errors) and tried both normal and SSO logins, I have not been able to get it to work and the error is always the same. Is there anything I can do about this? :)
Output without verbose
Verbose output: