Skip to content

Instantly share code, notes, and snippets.

@Romern
Last active June 29, 2021 09:07
Show Gist options
  • Save Romern/f9d4931f2f4aa2cbd4cb685f189397cd to your computer and use it in GitHub Desktop.
Save Romern/f9d4931f2f4aa2cbd4cb685f189397cd to your computer and use it in GitHub Desktop.
Downloads all materials from l2p using curl and wget
#!/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