cwoac / thingy_grabber

Script for archiving thingiverse things
MIT License
39 stars 11 forks source link

Failed to download featured_preview. #11

Closed joebywan closed 4 years ago

joebywan commented 4 years ago

I think this is a different error. Possibly to do with the ridiculously long filename?

Downloading thing 11 - 3704976
Old-style download directory found. Assuming update required.
Old style download dir found at Dominion Crusader MK3 volcano launcher (28mm)
Copying 0 unchanged files.
Downloading 4 new files of 4
Downloading 8 images.
Failed to download featured_preview_DyZSDHIX4AEVw7E_-_%CE%91%CE%BD%CF%84%CE%B9%C
E%B3%CF%81%CE%B1%CF%86%CE%AE_-_%CE%91%CE%BD%CF%84%CE%B9%CE%B3%CF%81%CE%B1%CF%86%
CE%AE.jpg - [Errno 2] No such file or directory: '.\\stls\\dante_pyro designs\\3
704976 - dominion crusader mk3 volcano launcher (28mm)\\images\\featured_preview
_DyZSDHIX4AEVw7E_-_%CE%91%CE%BD%CF%84%CE%B9%CE%B3%CF%81%CE%B1%CF%86%CE%AE_-_%CE%
91%CE%BD%CF%84%CE%B9%CE%B3%CF%81%CE%B1%CF%86%CE%AE.jpg'
Traceback (most recent call last):
  File "D:\waste\thingygrabber\thingy_grabber.py", line 503, in download
    with open(os.path.join(image_dir, filename), 'wb') as handle:
FileNotFoundError: [Errno 2] No such file or directory: '.\\stls\\dante_pyro des
igns\\3704976 - dominion crusader mk3 volcano launcher (28mm)\\images\\featured_
preview_DyZSDHIX4AEVw7E_-_%CE%91%CE%BD%CF%84%CE%B9%CE%B3%CF%81%CE%B1%CF%86%CE%AE
_-_%CE%91%CE%BD%CF%84%CE%B9%CE%B3%CF%81%CE%B1%CF%86%CE%AE.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\waste\thingygrabber\thingy_grabber.py", line 660, in <module>
    main()
  File "D:\waste\thingygrabber\thingy_grabber.py", line 646, in main
    Designs(user, args.directory, args.quick).download()
  File "D:\waste\thingygrabber\thingy_grabber.py", line 240, in download
    RC = Thing(thing).download(self.download_dir)
  File "D:\waste\thingygrabber\thingy_grabber.py", line 507, in download
    os.rename(self.download_dir, "{}_failed".format(self.download_dir))
FileExistsError: [WinError 183] Cannot create a file when that file already exis
ts: '.\\stls\\dante_pyro designs\\3704976 - dominion crusader mk3 volcano launch
er (28mm)' -> '.\\stls\\dante_pyro designs\\3704976 - dominion crusader mk3 volc
ano launcher (28mm)_failed'
cwoac commented 4 years ago

OK, yeah that's trashing windows filename path limits (250 chars). I'll have a think on what to do there.