easlice / bandcamp-downloader

Download your bandcamp collection using this python script.
MIT License
281 stars 34 forks source link

WinError 123 while downloading #2

Closed ZinRicky closed 2 years ago

ZinRicky commented 2 years ago

Downloading my collection, I encountered this error

Traceback (most recent call last):
  File "D:\Programmi\BandcampCollectionDownloader\bandcamp-downloader.py", line 235, in <module>
    sys.exit(main())
  File "D:\Programmi\BandcampCollectionDownloader\bandcamp-downloader.py", line 111, in main
    download_album(link)
  File "D:\Programmi\BandcampCollectionDownloader\bandcamp-downloader.py", line 184, in download_album
    download_file(download_url, artist)
  File "D:\Programmi\BandcampCollectionDownloader\bandcamp-downloader.py", line 212, in download_file
    os.makedirs(os.path.dirname(file_path), exist_ok=True)
  File "C:\Users\ricca\AppData\Local\Programs\Python\Python39\lib\os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "C:\Users\ricca\AppData\Local\Programs\Python\Python39\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] La sintassi del nome del file, della directory o del volume non è corretta: 'D:\\Programmi\\BandcampCollectionDownloader\\

I don’t know what causes it, but it should be noted that my collection is full of vaporwave albums (so there’s a lot of Unicode in there)

easlice commented 2 years ago

Interesting. I would expect unicode to be ok (I also have a lot of vaporwave with very weird characters and didn't have any issues).

The error is coming from windows where it is saying that the file path is 'bad syntax'.

Can you run it again with -vvv and post what that says here? The stack trace and the info about where the file is trying to be saved?

easlice commented 2 years ago

Ah, I might have figured it out. Looks like windows can throw a fit about ':'s and such.

I'll see about doing something to make sure paths contain only windows/linux valid characters.

ZinRicky commented 2 years ago

Ah, I might have figured it out. Looks like windows can throw a fit about ':'s and such.

I'll see about doing something to make sure paths contain only windows/linux valid characters.

Thank you for your quick reply!

easlice commented 2 years ago

@ZinRicky Ok, this should be fixed with the new change I just pushed up. Maybe give it a go again and let me know if it works for you now?

Also, thank you for reporting this! If people don't file issues I can't know that they need to be fixed.

ZinRicky commented 2 years ago

Ok, this should be fixed with the new change I just pushed up. Maybe give it a go again and let me know if it works for you now?

The first album that was downloaded appears to have a : swapped with a -, so I think the patch is working as intended. Thanks a lot!

easlice commented 2 years ago

No problem, glad to get it fixed!