rakuri255/UltraSinger

Failing because of special characters in filename?

Opened this issue · 1 comments

I suspect that the filenames are not sanitized enough?

Running with following parameters
['--force_cpu','True', '-i' ,'https://www.youtube.com/watch?v=k1BneeJTDcU,k1BneeJTDcU', '--disable_karaoke', 'True']
results in following traceback:


Traceback (most recent call last):
  File "d:\\Other Games\\Ultrastar\\Python\\UltraSinger\\src\\Ultrasinger.py", line 984, in <module>
    main(sys.argv[1:])
  File "d:\\Other Games\\Ultrastar\\Python\\UltraSinger\\src\\Ultrasinger.py", line 883, in main
    run()
  File "d:\\Other Games\\Ultrastar\\Python\\UltraSinger\\src\\Ultrasinger.py", line 326, in run
    ) = download_from_youtube()
  File "d:\\Other Games\\Ultrastar\\Python\\UltraSinger\\src\\Ultrasinger.py", line 769, in download_from_youtube
    download_youtube_thumbnail(
  File "d:\\Other Games\\Ultrastar\\Python\\UltraSinger\\src\\modules\\Audio\\youtube.py", line 52, in download_youtube_thumbnail
    download_and_convert_thumbnail(ydl_opts, url, clear_filename, output_path)
  File "d:\\Other Games\\Ultrastar\\Python\\UltraSinger\\src\\modules\\Audio\\youtube.py", line 66, in download_and_convert_thumbnail
    image.save(image_path, "JPEG")
  File "d:\\Other Games\\Ultrastar\\Python\\UltraSinger\\.venv\\lib\\site-packages\\PIL\\Image.py", line 2410, in save
    fp = builtins.open(filename, "w+b")
FileNotFoundError: [Errno 2] No such file or directory: \'D:\\\\Other Games\\\\Ultrastar\\\\Python\\\\UltraSinger\\\\output\\\\Welcome to the Internet  -  Bo Burnham (from Inside \\\\Welcome to the Internet  -  Bo Burnham (from Inside  [CO].jpg\

The log looks a little bit different, because I catch it from subprocesses.run() and put it straight into the logger (binary mode). So \\ equals \
In future I will decode it correctly....maybe :)

Other Songs work just fine.

Have a nice new years eve!

Are you in windows?
Windows has problems if the path is too long. Please try this again if you make the output direct on C://