mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.42k stars 934 forks source link

OSError: [Errno 22] Invalid argument #4205

Open OdinShiva opened 1 year ago

OdinShiva commented 1 year ago

gallery-dl -d ./gallery-dl/wallhaven/tag -f "{category}{id}{resolution}_{tags!S}.{extension}" https://wallhaven.cc/search?ratios=16x9"&"sorting=favorites"&"order=desc"&"ai_art_filter=0

it shows like this: [download][warning] OSError: [Errno 22] Invalid argument: '\\?\C:\Users\***\gallery-dl\wallhaven\tag\people-sketchy\wallhaven_dpp9qo_3840x2160_Asian, women, office girl, spread legs, M legs, pantyhose, Han Jing An, black pantyhose, black heels, heels, on table, women indoors, indoors, black hair, looking at viewer, red lipstick, makeup, cleavage, black panties, black lace, lace, necklace, Chinese, Chinese model, Chinese Women, upskirt.jpg.part' [download][error] Failed to download wallhaven_dpp9qo_3840x2160_Asian, women, office girl, spread legs, M legs, pantyhose, Han Jing An, black pantyhose, black heels, heels, on table, women indoors, indoors, black hair, looking at viewer, red lipstick, makeup, cleavage, black panties, black lace, lace, necklace, Chinese, Chinese model, Chinese Women, upskirt.jpg

how to save long name file,or save the tags in exif?

mikf commented 1 year ago

Filenames can only be 255 characters long, nothing that can be done about that.

You could trim any excess characters with {tags!S:[:240]} (reduce 240 if necessary). Writing tags to EXIF would need external programs and using an exec post processor in gallery-dl. Another option would be --write-tags to store tags in extra files.