Romern / syncMyMoodle

Synchronization client for RWTH Moodle
GNU General Public License v3.0
70 stars 18 forks source link

PDF files damaged #74

Open julkah opened 2 years ago

julkah commented 2 years ago

Some pdf files are damaged when downloaded via syncMyMoodle. Downloading the same file using moodle's web interface doesn't yield this damaged file.

Romern commented 2 years ago

Damaged meaning the downloaded file contains the moodle error page "Die gesuchte Datei wurde nicht gefunden."

septatrix commented 2 years ago

Could you share such a damaged file? I also recently stumbled upon some of those however for me it seemed like the session timed out as the content was just the HTML content of the login page.

septatrix commented 2 years ago

This specific PDF file was reachable under a the url .../mod_page/content/3/foobar.pdf - which for some reason gets modified since ea17a29d741d5fca17f6175aeef5305bf4ce482e. The result is a wrong URL...

septatrix commented 2 years ago

https://github.com/Romern/syncMyMoodle/blob/4bcb51fb19cf041df56979fdbb9c0e84a6675add/syncmymoodle/__main__.py#L43

@julkah Do you mind removing this line as well as the local pdf and re-running smm to check if that fixes it? (The second replace is presumably at fault here though I also cannot think of a reason for the former.)

n0toose commented 1 year ago

Has this issue been resolved?

septatrix commented 1 year ago

Nope, only on v2 branch though it is untested there.