Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoneType has no len() - not downloading #207

Closed
aaannndddyyy opened this issue Jan 31, 2024 · 1 comment
Closed

NoneType has no len() - not downloading #207

aaannndddyyy opened this issue Jan 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@aaannndddyyy
Copy link

Description of the bug

I am enrolled in several Moodle courses and wanted to download them. I installed moodle-dl via pip and ran the unit and config.
After that I ran
.local/bin/moodle-dl --path /some/path
And for several minutes got many lines like
[298/307] Loaded course core 1077461 "Spanish I".
Then it stopped with the following error:
The following error occurred during execution:
object of type 'NoneType' has no len()
Exception: object of type 'NoneType' has no len()

In the specified directory no course content can be found , only config.json, MoodleDl.log , Cookies.txt and moodle_state.db

Steps to reproduce the issue

Running the command:
.local/bin/moodle-dl --path /some/path
The following error occurred during execution:
object of type 'NoneType' has no len()
Exception: object of type 'NoneType' has no len()

Expected behavior

I expected the course contents (PDFs, videos) be downloaded.

Possible Fix

Technical details

OS: Linux
Moodle-DL version: 2.3.2.0

@aaannndddyyy aaannndddyyy added the bug Something isn't working label Jan 31, 2024
@aaannndddyyy
Copy link
Author

ERROR {main} Traceback (most recent call last):
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/main.py", line 536, in main
choose_task(config, opts)
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/main.py", line 68, in choose_task
run_main(config, opts)
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/main.py", line 136, in run_main
raise base_err
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/main.py", line 106, in run_main
downloader = DownloadService(changed_courses, config, opts, database)
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/downloader/download_service.py", line 24, in init
self.all_tasks = self.gen_all_tasks()
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/downloader/download_service.py", line 36, in gen_all_tasks
Task(
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/downloader/task.py", line 78, in init
self.filename = PT.to_valid_name(self.file.content_filename, is_file=True)
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/utils.py", line 449, in to_valid_name
name = PathTools.truncate_filename(name, is_file, max_length)
File "/home/zorin/.local/lib/python3.8/site-packages/moodle_dl/utils.py", line 460, in truncate_filename
ext_len = len(ext)
TypeError: object of type 'NoneType' has no len()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants