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

[ex/e-hentai][windows] Download fails if folder name too long #545

Closed
colpocleisis opened this issue Dec 26, 2019 · 3 comments
Closed

[ex/e-hentai][windows] Download fails if folder name too long #545

colpocleisis opened this issue Dec 26, 2019 · 3 comments

Comments

@colpocleisis
Copy link

colpocleisis commented Dec 26, 2019

(ERRO) exhentai: Unable to download data: OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect:
Was trying to download this gallery https://exhentai.org/g/1470216/ccd35b3a22/

Maybe an automatic cutting of folder name if more than x characters?

@colpocleisis colpocleisis changed the title [ex/e-hentai][windows] Download fails if file name too long [ex/e-hentai][windows] Download fails if folder name too long Dec 26, 2019
@Hrxn
Copy link
Contributor

Hrxn commented Dec 27, 2019

You can limit the length of specific fields in folder- and file-names in your config file, like this:

You can restrict the length of individual replacement fields and avoid a "filename too long" error that way: "filename": "{id}_{artist[0:200]}_{filename}.{extension}"

I.E. {artist[0:200]}

Maybe post that part of your config here, or just ask if you have any other questions.

@SumatraPeter
Copy link

SumatraPeter commented Jan 15, 2020

@mikf: Does that OSError still show up if we've enabled the setting in recent Win10 versions to overcome the old 260 char path limit? From what I understand, programs have to specifically use the appropriate API functions that allow long paths, so wondering whether gallery-dl has been updated accordingly?

@mikf
Copy link
Owner

mikf commented Jan 18, 2020

@SumatraPeter On Windows, all paths get prefixed with \\?\ to remove the 260 character path limit (*), but you are still limited to 255 characters per path segment, so this error would still be present in the latest Windows10 version.

(*) https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation

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