Moodle-DL icon indicating copy to clipboard operation
Moodle-DL copied to clipboard

Do not download large files

Open zeliboba7 opened this issue 1 year ago • 2 comments

Description of the problem

Our moodle site contains a lot of media files, applications for students etc, and sometimes these files are pretty big. If I try to download them all, the total download size can be up to 40Gb. Of course I can exclude some extensions using https://github.com/C0D3D3V/Moodle-DL/wiki/Exclude-file-extensions but some large files have the same extension as submissions (e.g. zip) - I do not want to exclude them.

Solution

It would be nice to have an option to exclude large files from download.

zeliboba7 avatar Jan 01 '24 08:01 zeliboba7

Do you know what kind of file it is? Is it external or is it internal listed directly on the moodle course (so stored on the moodle server). Does it contain the size information, so does Moodle-dl display the total size of the file if it starts downloading or does it guess the file size while downloading (the total size increases while downloading)

C0D3D3V avatar Jan 01 '24 11:01 C0D3D3V

These files are mainly video (mkv, mp4) and archives (zip, rar), and they are internal files (stored on moodle site). The files are listed in the log, although I do not see their size, only percentage remaining to download.

The problem is somewhat similar to https://github.com/C0D3D3V/Moodle-DL/issues/110 and I use the proposed solution to exclude files by extensions, unfortunately I cannot add *.zip to the exclusions since some submissions are actually zip-files. For my personal purposes implementation of https://github.com/C0D3D3V/Moodle-DL/issues/135 would be sufficient, since I mainly interested in submissions also. But in general it would be nice to have an option for exclusion big files explicitly.

zeliboba7 avatar Jan 06 '24 20:01 zeliboba7

With version 2.3.2.4 you can now use the config option max_file_size to define a max size in bytes of internal moodle files. Files bigger than that are completely ignored. This does not affect external files.

See also: https://github.com/C0D3D3V/Moodle-DL/wiki/Example-Config.json-and-Options

C0D3D3V avatar Mar 28 '24 14:03 C0D3D3V