'How to download files in a moodle course using R?

There is a moodle course with files that I wish to download automatically. I see that there is a python solution for doing so, but I couldn't find an R solution. I am not sure which package and what type of workflow would fit here (I assume some combination of httr and rvest). Any suggestion would be appreciated.

The first problem is how to deal with the authentication of moodle. In my case, I need 3 items (personal id, user name, and password).

From a google search I was able to find the following moodle related packages (non seem to help): SARP.moodle, moodler. Using download.file on the homepage of the course only redirects to the page viewed by people who do not have access to the course. No pop-up window shows for entering passwords (and again, in my case there is a need for 3 items of the password).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source