Bleuzen / SpotRec

Spotify desktop client recorder for PulseAudio
MIT License
75 stars 17 forks source link

Coverart error when using --output-directory #17

Closed buster666 closed 2 years ago

buster666 commented 2 years ago

When using -a and -c together the cover will not saved.

Excample command: spotrec -o ./spotify --skip-intro -a --debug

gives this error:

2021-10-27 22:36:33,655 - DEBUG - [FFmpeg] [2075] Successfully renamed .04 - RAINASH - Dark Blue Sky.flac
2021-10-27 22:36:33,656 - DEBUG - [FFmpeg] Cover art is on server for ./spotify/04 - RAINASH - Dark Blue Sky.flac
2021-10-27 22:36:33,658 - DEBUG - Starting new HTTPS connection (1): i.scdn.co:443
2021-10-27 22:36:33,949 - DEBUG - https://i.scdn.co:443 "GET /image/ab67616d0000b2734eeb84104895cc348c822c44 HTTP/1.1" 200 127803
Exception in thread Thread-12:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.parent.add_cover_art()
    self.run()
  File "/usr/bin/spotrec", line 528, in run
  File "/usr/bin/spotrec", line 577, in add_cover_art
    with open(cover_file, "wb") as fd:
FileNotFoundError: [Errno 2] No such file or directory: './spotify/./spotify/04 - RAINASH - Dark Blue Sky.jpeg'

It looks like the script is messing up the path as it adds ./spotify/ , that is provided by the --output-directory, twice.