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

Error on Windows extended path #2373

Closed
LurkerHub opened this issue Mar 7, 2022 · 6 comments
Closed

Error on Windows extended path #2373

LurkerHub opened this issue Mar 7, 2022 · 6 comments

Comments

@LurkerHub
Copy link

[download][warning] OSError: [Errno 22] Invalid argument: '\\\\?\\D:\\Misc\\Comics\\000\\gallery-dl\\kemonoparty\\patreon\\4618037\\25913257_Going to Youtube_01_httpswww.patreon.commedia-uZ0FBQUFBQmdNejB3Q2c5MWtRNlR2bko3R3dPWndPVG00bEpTc3FsbWRrNGZuTXJfRTVIdUxraUtHYlQ0VGtfQ2NwRmxpalFWdUd6ZDA1WFN4azItX1k1RVFTMXV5UF9IYk9sQWNKOVFNaERvb1JyUzJOS01odHdXWGUxV01QYzM4Z2s2cUllUG1RR2E5MWw3VGdOV1RZcTBqOHBXckpkRHl3PT0.part'
[download][error] Failed to download 25913257_Going to Youtube_01_httpswww.patreon.commedia-uZ0FBQUFBQmdNejB3Q2c5MWtRNlR2bko3R3dPWndPVG00bEpTc3FsbWRrNGZuTXJfRTVIdUxraUtHYlQ0VGtfQ2NwRmxpalFWdUd6ZDA1WFN4azItX1k1RVFTMXV5UF9IYk9sQWNKOVFNaERvb1JyUzJOS01odHdXWGUxV01QYzM4Z2s2cUllUG1RR2E5MWw3VGdOV1RZcTBqOHBXckpkRHl3PT0.jpg

I am running on Windows 10, NTFS, long paths enabled in the registry.

@AlttiRi
Copy link

AlttiRi commented Mar 7, 2022

"25913257_Going to Youtube_01_httpswww.patreon.commedia-uZ0FBQUFBQmdNejB3Q2c5MWtRNlR2bko3R3dPWndPVG00bEpTc3FsbWRrNGZuTXJfRTVIdUxraUtHYlQ0VGtfQ2NwRmxpalFWdUd6ZDA1WFN4azItX1k1RVFTMXV5UF9IYk9sQWNKOVFNaERvb1JyUzJOS01odHdXWGUxV01QYzM4Z2s2cUllUG1RR2E5MWw3VGdOV1RZcTBqOHBXckpkRHl3PT0.part".length === 280

NTFS as well as almost all other FS does not allow to a path entry have length more then ~255. While the entire path may have up to ~32k characters length.

You need to limit {filename}.
By default it has no length limitation:

filename_fmt = "{id}_{title}_{num:>02}_{filename}.{extension}"

Use (in your config file), for example: {filename[0:180]} instead of {filename}.

So, the full line (with the default filename pattern) will look like:

"filename": "{id}_{title}_{num:>02}_{filename[0:180]}.{extension}"

@alexolog
Copy link

alexolog commented Mar 7, 2022

Can it be set globally?

@LurkerHub
Copy link
Author

Use (in your config file), for example: {filename[0:180]}.

Thank you, it worked!

@mikf
Copy link
Owner

mikf commented Mar 8, 2022

@alexolog You mean a global limit on filename length? No, that's not possible at the moment. (#814)

@alexolog
Copy link

alexolog commented Mar 8, 2022

I actually meant configuring a filename format to apply globally, which would also (indirectly) fix the length problem

@mikf
Copy link
Owner

mikf commented Mar 8, 2022

That's possible by setting filename directly inside the extractor block, but it is basically impossible to have a filename format string that works for all sites, except maybe {filename}.{extension} or {filename[:250]}.{extension}

{
    "extractor": {
        "filename": "`{filename}.{extension}`"
    }
}

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

No branches or pull requests

4 participants