Unicode characters in the song or artist name failed favs downloading
Closed this issue · 8 comments
On latest master (b68087c) tried to download my favs.
Process stopped after downloading of 20 songs with error:
Creating m3u8 file: '00 playlists\favorites_USERID.m3u8'
Got an Exception in function download_deezer_favorites with parameters '{'user_id': 'USERID', 'add_to_playlist': False, 'create_zip': False}
[Errno 2] No such file or directory: '<PATH_TO_FOLDER>/playlists\favorites_USERID\00 playlists\favorites_USERID.m3u8''
worker 1 is done with task: {'user_id': 'USERID', 'add_to_playlist': False, 'create_zip': False} (state=failed)
So I created this folder "00 playlists" manually and got a different error:
Creating m3u8 file: '00 playlists\favorites_USERID.m3u8'
Got an Exception in function download_deezer_favorites with parameters '{'user_id': 'USERID', 'add_to_playlist': False, 'create_zip': False}
'charmap' codec can't encode characters in position 0-3: character maps to '
worker 1 is done with task: {'user_id': 'USERID', 'add_to_playlist': False, 'create_zip': False} (state=failed)
You removed the USERID on purpose I guess? Can you send it to me (via email if you want)? Makes reproducing the issue easier.
For userId=3368166784 I got error after 25 songs:
Dowload finished: C:/Users/user/Deezer/playlists\favorites_3368166784\Calvin Harris - This Is What You Came For.mp3
Creating m3u8 file: '00 playlists\favorites_3368166784.m3u8'
Got an Exception in function download_deezer_favorites with parameters '{'user_id': '3368166784', 'add_to_playlist': False, 'create_zip': False}
[Errno 2] No such file or directory: 'C:/Users/user/Deezer/playlists\favorites_3368166784\00 playlists\favorites_3368166784.m3u8''
worker 1 is done with task: {'user_id': '3368166784', 'add_to_playlist': False, 'create_zip': False} (state=failed)
Worker 1 is waiting for a task
After that I created folder "00 playlists" manually:
Creating m3u8 file: '00 playlists\favorites_3368166784.m3u8'
Got an Exception in function download_deezer_favorites with parameters '{'user_id': '3368166784', 'add_to_playlist': False, 'create_zip': False}
'charmap' codec can't encode character '\u011f' in position 1: character maps to '
worker 0 is done with task: {'user_id': '3368166784', 'add_to_playlist': False, 'create_zip': False} (state=failed)
Worker 0 is waiting for a task
\u011f stands for LATIN SMALL LETTER G WITH BREVE = ğ
It's from the name of the third song artist (Oğuzhan Koç) in that playlist.
https://api.deezer.com/user/3368166784/tracks
Part of the API response:
"artist": {
"id": 5184050,
"name": "O\u011fuzhan Ko\u00e7",
"tracklist": "https://api.deezer.com/artist/5184050/top?limit=50",
"type": "artist"
},
From log:
Skipping song 'C:/Users/user/Deezer/playlists\favorites_3368166784\Oğuzhan Koç - Kendime Sardım.mp3'. Already exists.
This playlist file:
Aya Nakamura - Djadja.mp3
Marshmello - FRIENDS.mp3
So it looks like error handling Unicode characters in the song or artist names.
There's also another issue that probably related to this one.
For userId=1958192542 error occured after 9 songs:
Got an Exception in function download_deezer_favorites with parameters '{'user_id': '1958192542', 'add_to_playlist': False, 'create_zip': False}
[Errno 22] Invalid argument: 'C:/Users/user/Deezer/playlists\favorites_1958192542\Neon Hitch - F**k U Betta.mp3''
worker 0 is done with task: {'user_id': '1958192542', 'add_to_playlist': False, 'create_zip': False} (state=failed)
Maybe it caused by asterisk character in the song name.
I think the whole process should continue after singe song failure. Log it and go on.
In the end it could be shown in the Queue section of the UI as 'partially success'.
Hey,
I found another bug #46. (it only downloads the first 25 songs). But unfortunately I can't reproduce your issue. For userId=3368166784 I don't get any errors. I'm not sure if this is a unicode problem or that a file does not exist. Can you try to isolate the problem?
Can you download other favorite songs?
Can you download songs with unicode in the title/artist?
Are you running it in a Docker container?
Also please git pull
and test with the current master.
UPDATE: 1958192542 works for me, too.
#46 looks unrelated.
For userId=3368166784 I don't get any errors.
Are you running on Windows? Cause I am. (I should say about it in the first time, yep).
I'm not sure if this is a unicode problem or that a file does not exist.
I think it's two separate issues.
C:/Users/user/Deezer/playlists\favorites_3368166784\00 playlists\favorites_3368166784.m3u8
There's two types of slashes: '/' and '\', it could cause the 'file not found' problem.
Can you try to isolate the problem?
I'll try.
Can you download other favorite songs?
Can you download songs with unicode in the title/artist?
Yes, but in that cases we are not writing them to the playlist, only download directrly to file.
Are you running it in a Docker container?
No, I'm running on Windows 10 x64.
Also please git pull and test with the current master.
OK.
I've figured it out.
For the unicode part of the issue user should set python to use UTF-8: https://docs.python.org/3/using/windows.html#utf-8-mode.
Another part is dealing with Windows/Unix paths. I'll make a PR to fix it.