Downloading each PDF file from a Moodle course page by hand is long and boring. This script aims to ease this task and allow to batch download each PDF on a moodle course page.
In order to archive material and be able to efficiently work for exams, it's useful to get all the documents uploaded throughout a course semester. Moodle has "protections" to prevent batch downloads. This scripts aims to be a workaround the workaround :)
This script was written for helping the people who are trying to download, once in the end of the semester, all the slides/exercices/corrections of weekly uploaded Moodle material. This is not a "one does all" tool, it's just a little helper for eventual bigger task (self revision session organisation, contributing to material archiving, ...)
First, make sure that you do not have automatic opening of PDF files (this will avoid having 35+ open tabs by the script). For example in Firefox:
You can use the script once in a course's page. For example, you can go to the AICC-II course page via https://moodle.epfl.ch/course/view.php?id=15838
The script uses JavaScript and should be run in the interactive console of your web browser. The choice for this is that using directly you browser remove the need for dealing with Tequila: you are already using the environment you are logged in. For example to open the console in Firefox, you can do:
In the open console, you can paste the script and click on "execute". You will be prompted for the download of each files (you can select "apply same rule to all" and download everything at once) 🥳. See the video tutorial.
If the script does not launch after a dozen of seconds, try to reload the page and restart it!
This script goes through all resources present on the main course page and download these, bypassing the Moodle protection. This could be done by hand and is not forbidden, it's just faster. However be aware that batch sharing the material on public platforms follows other laws, make sure not to break these ;)
This script only downloads PDF files (slides and lecture notes in general). For convenience, we did not include other types of media as these could be large (mp4 video) or redundant (pptx of the PDF).
This script does not download files of type other than PDF nor does it download file present in "folder" or forums. This script does not download multiple courses at once.