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

url option is not working if there are no url available #5859

Closed
wankio opened this issue Jul 16, 2024 · 4 comments
Closed

url option is not working if there are no url available #5859

wankio opened this issue Jul 16, 2024 · 4 comments

Comments

@wankio
Copy link
Contributor

wankio commented Jul 16, 2024

"url": "{sample_url}", it work well if there are sample_url, but it will :
gelbooru: An unexpected error occurred: IndexError - string index out of range. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
if sample_url is not found, which i think it can fallback to second or third url option available if the first one is not found, to prevent this error

mikf added a commit that referenced this issue Jul 17, 2024
- catch all exceptions, including IndexError,  and not just a select few
- change logging message level to  warning
@mikf
Copy link
Owner

mikf commented Jul 17, 2024

IndexError is fixed (bf44add) and you can now have more than one url field to have a fallback in case the first one doesn't work (6940ad0).

@mikf mikf closed this as completed Jul 17, 2024
@wankio
Copy link
Contributor Author

wankio commented Aug 12, 2024

oh i noticed it only affected booru, not included sankaku

@mikf mikf reopened this Aug 12, 2024
@mikf
Copy link
Owner

mikf commented Aug 12, 2024

This works for sankaku as well. What makes you think it doesn't?

@mikf mikf closed this as completed Aug 14, 2024
@wankio
Copy link
Contributor Author

wankio commented Aug 15, 2024

because i just tested and it won't work, booru.py have change but sankaku.py is not, it still fixed file_url

                for post in posts:
                    if not expires:
                        url = post["file_url"]

currently i just hard code it into sample_url > preview_url > file_url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants