regosen/gallery_get

Reddit users with extremely long thread names throw exceptions

Opened this issue · 2 comments

Possibly a windows issue. Users with extremely long thread names throw OSError: [WinError 123] for directories and OSError: [Errno 22] exceptions for files. Is there a way to disable the generation of folder names based upon thread name and simply use the image name from imgur instead of threadname.jpg ?

Note:
I have noticed that you do have a section in the code limiting the characters
fileName = os.path.abspath(fileNameFull)[:255] + fileExtension # full path must be 260 characters or lower

The script is trying to create a directory which is 299 characters long and a filename of 302 characters, while trying to create the same directory with explorer the most characters I could use were 226 characters. So it would appear that the dir names and filenames are not being shortened.

Obviously 299 and 302 characters are a bit...excessive.

Sounds reasonable. Though if given the choice , I'd prefer dirs and files being formated as [date + time] + imgur album url (eg: D5vU4) and files simply [date + time] + url filename + ext .

I have absolutely no knowledge of python, so sadly I can't offer any help. I am gradually learning now by using google on the error codes and looking at the code though.