jbh-cloud/spotify_sync

'latin-1' codec can't encode character

Opened this issue · 1 comments

When downloading songs with certain characters in them, the downloader throws the following error and skips that song

user@raspberrypizero2w:~ $ spotify_sync run auto --profile profile
[2023-11-18 22:58:35,983] INFO      SpotifySync      : Loading config from profile: profile
[2023-11-18 22:58:35,985] INFO      SpotifySync      : Script started with auto command
[2023-11-18 22:58:37,193] INFO      SpotifyService   : Fetching liked songs
[2023-11-18 22:58:37,663] INFO      SpotifyService   : Added 0 new liked song(s) from Spotify (cached:0)
[2023-11-18 22:58:37,664] INFO      SpotifyService   : Fetching playlist songs
[2023-11-18 22:58:37,977] INFO      SpotifyService   : Adding 14/14 from playlists
[2023-11-18 22:58:38,176] INFO      MatchService     : Attempting to match 14 Spotify songs to Deezer
[2023-11-18 22:58:40,212] INFO      MatchService     : Matched 14/14 new liked song(s)
[2023-11-18 22:58:40,222] INFO      DownloadService  : Downloading 14 song(s) from Deezer
[2023-11-18 22:58:42,828] INFO      DeemixDownloader : Gathering song information in preparation for download..
[2023-11-18 22:58:43,696] INFO      DeemixDownloader :  1/14 - STARTING [Korn - My Gift to You]
[2023-11-18 22:58:43,698] INFO      DeemixDownloader :  2/14 - STARTING [Korn - Pretty]
[2023-11-18 22:58:43,700] INFO      DeemixDownloader :  3/14 - STARTING [Korn - It's On!]
[2023-11-18 22:58:43,703] INFO      DeemixDownloader :  4/14 - STARTING [Korn - Justin]
Ko\u042fn - My Gift to You 'latin-1' codec can't encode character '\u042f' in position 33: ordinal not in range(256)
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.11/site-packages/deemix/downloader.py", line 651, in downloadWrapper
    result = self.download(extraData, track)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/deemix/downloader.py", line 421, in download
    makedirs(filepath, exist_ok=True)
  File "<frozen os>", line 215, in makedirs
  File "<frozen os>", line 225, in makedirs
UnicodeEncodeError: 'latin-1' codec can't encode character '\u042f' in position 33: ordinal not in range(256)
[2023-11-18 22:58:44,571] WARNING   DeemixDownloader :  1/14 - FINSIHED [Korn - My Gift to You] - Failed, download for DeezerId: 134523802 error: 'latin-1' codec can't encode character '\u042f' in position 33: ordinal not in range(256)

Korn is stylised as KoЯn on Deezer but not on Spotify, figured I would bring this issue up as other artists may be stylised with similar characters and cause this error to appear.

@meltham44 can't replicate this on MacOS, which operating system are you using? Can you replicate this on any other OS's?