-
-
Notifications
You must be signed in to change notification settings - Fork 62
Copy a token from the Moodle app
Daniel Vogt edited this page Sep 16, 2021
·
9 revisions
If you are sure that the Moodle app (for Andorid or IOS) works, but none of the automatic and manual methods work to get a token, there is only one way to get a token directly from the Moodle app!
- First you need to have Google Chrome or Chromium installed.
- Because chromium uses a strict same-origin policy since some versions, it must be disabled. To disable this run the following command to start Chromium:
chromium-browser --disable-web-security --user-data-dir="[some directory here]"
. Wherechromium-browser
can be replaced withgoogle-chrome
if this is used instead. And[some directory here]
with a path to a folder e.g../chrome_is
. - Open your Chrome browser and visit https://mobileapp.moodledemo.net/
- Login to your moodle account like you did on your phone
- Open the developer console by pressing [Control+Shift+I]
- Go into the Network tab and reload the page with [Ctr+R]
- Wait till the website is loaded and then scroll down the list of requests till you see requests starting with "
server.php?
" link in this image:
- Select one of these requests that starts with "
server.php?
". On the right side of the window you will now see a lot of information about the request. - Select the
Headers
tab and scroll down till you reach theForm Data
section. - There you see the data that was send from the app to the server, one of the data is the
wstoken
, this is the token we need:
- Finally copy the
wstoken
and create aconfig.json
file in a folder where you want to download the moodle files. In theconfig.json
file paste the following:
{
"token": "06eab0your_copied_token36a492",
"moodle_domain": "moodle.ruhr-uni-bochum.de",
"moodle_path": "/m/"
}
Replace the moodle_domain
with the domain of your moodle server and the moodle_path
with the installation path of the moodle (often it is just /
).
Now you are ready to go! You can start the downloader in the folder where you created the config file.
- Example Config.json and Options
- Change Download Folder
- Download (external) linked files
- Copy a token from the Moodle app
- Telegram Notification
- Additional Youtube-dl Settings
- Use cookies when downloading
- Download public courses
- Set user id and Moodle version number manually
- Exclude file extensions
- Download password protected external links
- Use of external programs to download external links
- Start Moodle dl periodically or via Telegram