anilshanbhag/Moodle-Sync — pull request #3 by Manishearth (2012-09-06 03:30:07+00:00)
Title: Add PDF (/etc) downloader

Sometimes (usually happens with pdfs), instead of linking to the file itself, Moodle links to an html page which _then_ links to the pdf. This is ignored by Moodle-Sync, which just downloads the html pages. This populates the course folders with useless html files like `File D1Lecture3(July29) File.php?id=1348`.

I've added a check for this, in the case of such html files it extracts the link and downloads it.

It works, though this is the first time I'm using python (just dove into the code), so you may want to look a bit more closely for mistakes ;-)

-Manish