This commit is contained in:
Cyberes 2023-10-27 18:06:32 -06:00
parent a27aa18f40
commit fe96f19eca
3 changed files with 4 additions and 8 deletions

View File

@ -9,7 +9,7 @@ Major changes:
- Added progress bars.
- Use threading where possible.
- Save assignment attachements.
- Download all user files (as seen in the file manager at `/files` on your Canvas platform.)
- Save all user files.
---
@ -26,7 +26,7 @@ The tool exports all of the following data for each course:
- Modules
- Single file webpage of the Canvas page for assignments, announcements, discussions, and modules
Your data in will be exported in JSON format and organized into folders per term.
Additionally, all your files stored on Canvas (such as historic submissions and attachments) will be downloaded.
## Install

View File

@ -217,6 +217,6 @@ def download_course_module_pages(api_url, course_view, cookies_path):
for module in tqdm(list(course_view.modules), desc='Downloading Module Pages'):
bar = tqdm(list(module.items), leave=False, desc=module.name)
futures = [executor.submit(download_module_item, module, item, modules_dir, cookies_path) for item in module.items]
for future in as_completed(futures):
for _ in as_completed(futures):
bar.update()
bar.close()

View File

@ -31,9 +31,5 @@ def download_user_files(canvas: canvasapi.Canvas, base_path: str):
with ThreadPoolExecutor(max_workers=10) as executor:
bar = tqdm(files, desc='Downloading User Files')
futures = [executor.submit(do_download, task) for task in files]
for future in as_completed(futures):
for _ in as_completed(futures):
bar.update()
# for file, out_path in tqdm(files, desc='Downloading User Files'):
# if not out_path.exists():
# file.download(out_path)