Last active
June 29, 2021 09:07
-
-
Save Romern/f9d4931f2f4aa2cbd4cb685f189397cd to your computer and use it in GitHub Desktop.
Downloads all materials from l2p using curl and wget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER="AB12345" | |
PASS="hunter2" | |
echo "Getting courses..." | |
COURSES=$(curl -s --ntlm -u "${USER}:${PASS}" https://www3.elearning.rwth-aachen.de/l2p/foyer/SitePages/PastCourses.aspx | grep -oE "https://www[0-9].elearning.rwth-aachen.de/(ws|ss)[0-9]{2}/[0-9]{2}(ws|ss)-[0-9]*") | |
echo "Recursively download all courses using wget..." | |
while IFS= read -r c | |
do | |
echo "Downloding ${c}..." | |
wget -r -nc -np -nH --user=${USER} --password=${PASS} "${c}/Lists/StructuredMaterials/" | |
done <<< "${COURSES}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment