Gallery-dl: [ex/e-hentai][windows] Download fails if folder name too long

Created on 26 Dec 2019  路  3Comments  路  Source: mikf/gallery-dl

(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?

Most helpful comment

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.

All 3 comments

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.

@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?

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lyz-code picture lyz-code  路  6Comments

Lin-Buo-Ren picture Lin-Buo-Ren  路  6Comments

kattjevfel picture kattjevfel  路  5Comments

rawesomeawesome picture rawesomeawesome  路  3Comments

jtara1 picture jtara1  路  6Comments