skyzh / canvas_grab

🌐 One-click script to synchronize files from Canvas LMS.
https://git.sjtu.edu.cn/iskyzh/canvas_grab
MIT License
209 stars 28 forks source link

Resource Does Not Exist #164

Closed jbxiaoyu closed 2 years ago

jbxiaoyu commented 2 years ago

One of my courses does NOT have files tab. When synchronizing, it pops up this error. I don't know how to fix it.

Traceback (most recent call last):
  File "D:\Google Drive\Year 2 Sem 2\Z_CANVAS_GRAB\canvas_grab\__main__.py", line 53, in main
    canvas_snapshot = canvas_snapshot_obj.take_snapshot()
  File "D:\Google Drive\Year 2 Sem 2\Z_CANVAS_GRAB\canvas_grab\snapshot\canvas_file_snapshot.py", line 51, in take_snapshot
    for _ in self.yield_take_snapshot():
  File "D:\Google Drive\Year 2 Sem 2\Z_CANVAS_GRAB\canvas_grab\snapshot\canvas_file_snapshot.py", line 62, in yield_take_snapshot
    raise ResourceDoesNotExist("File tab is not supported.")
canvasapi.exceptions.ResourceDoesNotExist: File tab is not supported.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Google Drive\Year 2 Sem 2\Z_CANVAS_GRAB\main.py", line 6, in <module>
    canvas_grab.__main__.main()
  File "D:\Google Drive\Year 2 Sem 2\Z_CANVAS_GRAB\canvas_grab\__main__.py", line 56, in main
    colored(f'{mode} not supported, falling back to alternative mode', 'yellow'))
NameError: name 'mode' is not defined
jbxiaoyu commented 2 years ago

main.main()加上: mode = config.organize_mode.mode