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

Don't try to download the mailto links #193

Closed
daniarla opened this issue Jun 7, 2023 · 2 comments
Closed

Don't try to download the mailto links #193

daniarla opened this issue Jun 7, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@daniarla
Copy link
Contributor

daniarla commented Jun 7, 2023

Description of the bug

If there is a mailto link in the description of an assignment and moodle-dl is configured to download the description of assignment it tries to download the mailto link (mailto:valid@email.org) and fails. Not a big deal its only an error in the logs.

Technical details

  • OS: Linux
  • Moodle-DL Version 2.3.2.0
@daniarla daniarla added the bug Something isn't working label Jun 7, 2023
@C0D3D3V
Copy link
Owner

C0D3D3V commented Jun 7, 2023

Mh, the idea was that moodle-dl creates URL files for these mailto links. So that you always have a fast access to the professors mail adresse in your files. It also should not create errors for it in the logs, because it should detect that it is not downloadable in firstplace (at least thats how I remember it).
I will have a look at it after vacations.

@daniarla
Copy link
Contributor Author

daniarla commented Jun 7, 2023

This are the logs, this is super low priority so enjoy your vacations!

2023-06-07 11:10:39  DEBUG  {task}  [0] Starting downloading of: [Course]/[Section]/[assignment]/mailto:email.mail@email.com
2023-06-07 11:10:39  DEBUG  {task}  [0] Creating a shortcut
2023-06-07 11:10:39  ERROR  {task}  [0] AttributeError("'NoneType' object has no attribute 'endswith'")
2023-06-07 11:10:39  ERROR  {task}  [0] Error while trying to download file: 'NoneType' object has no attribute 'endswith'
2023-06-07 11:10:39  DEBUG  {task}  [0] file size: 229; downloaded: 0
2023-06-07 11:10:39  DEBUG  {task}  [0] Traceback:
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.11/site-packages/moodle_dl/downloader/task.py", line 727, in real_run
    if self.opts.download_linked_files and not self.is_filtered_external_domain():
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/moodle_dl/downloader/task.py", line 565, in is_filtered_external_domain
    if domain == entry or domain.endswith('.' + entry):
                          ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'endswith'


And then:

mailto:email.mail@email.com
	'NoneType' object has no attribute 'endswith'

Could it be because there are . before the @ and it confuses the downloader?

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