A fast and customizable music and podcast downloader.
zlib License
1.2k
stars
91
forks
source link
[Bug] Next song fails with "FAILED TO QUERY METADATA" when previous downloaded track has unicode chars in name or author ("incomplete escape \U at position 3") #211
Description:
Given a playlist with at least 1 song with foreign unicode chars in song title and/or album name and/or author, when the playlist is downloaded via zotify, the physical song with unicode chars will download, however the metadata wil fail to download and this will cause the next song to fail to download and return
SKIPPING SONG - FAILED TO QUERY METADATA
...Followed by
incomplete escape \U at position 3
Note that with some song names with unicode chars, the next 3 songs (which do not have unicode) will fail for download, but for some others it's only the next single song (also without unicode) - (possibly due to variable byte-length of specific chars). Then after these 1-3 track failures, download recovers and succeeds on the next track(s) - unless other songs in the playlist also have unicode. I have repeated this with many playlists (with 1 or more unicode chars in track names) and I get the same result.
### SKIPPING: Myrkur - Två Konungabarn (Single) (SONG ALREADY EXISTS) ###
### SKIPPING SONG - FAILED TO QUERY METADATA ###
Track_ID: 5ErGc51SWCg6C6pvSJxzNg
playlist: D&D-Lyric (Ctrl+Shift+L)
playlist_num: 05
incomplete escape \U at position 3
Traceback (most recent call last):
File "C:\Users\xymok\pipx\venvs\zotify\Lib\site-packages\zotify\track.py", line 190, in download_track
c = len([file for file in Path(filedir).iterdir() if re.search(f'^{filename}_', str(file))]) + 1
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\__init__.py", line 177, in search
return _compile(pattern, flags).search(string)
~~~~~~~~^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\__init__.py", line 350, in _compile
p = _compiler.compile(pattern, flags)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_compiler.py", line 743, in compile
p = _parser.parse(p, flags)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 980, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 459, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
not nested and not items))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 543, in _parse
code = _escape(source, this, state)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 397, in _escape
raise source.error("incomplete escape %s" % escape, len(escape))
re.PatternError: incomplete escape \U at position 3
### SKIPPING SONG - FAILED TO QUERY METADATA ###
Track_ID: 01pGPwb1OkC5JflWmcqeYQ
playlist: D&D-Lyric (Ctrl+Shift+L)
playlist_num: 06
incomplete escape \U at position 3
Traceback (most recent call last):
File "C:\Users\xymok\pipx\venvs\zotify\Lib\site-packages\zotify\track.py", line 190, in download_track
c = len([file for file in Path(filedir).iterdir() if re.search(f'^{filename}_', str(file))]) + 1
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\__init__.py", line 177, in search
return _compile(pattern, flags).search(string)
~~~~~~~~^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\__init__.py", line 350, in _compile
p = _compiler.compile(pattern, flags)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_compiler.py", line 743, in compile
p = _parser.parse(p, flags)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 980, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 459, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
not nested and not items))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 543, in _parse
code = _escape(source, this, state)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 397, in _escape
raise source.error("incomplete escape %s" % escape, len(escape))
re.PatternError: incomplete escape \U at position 3
### SKIPPING SONG - FAILED TO QUERY METADATA ###
Track_ID: 667Zhsq8Zcs9iPhb5jJVeo
playlist: D&D-Lyric (Ctrl+Shift+L)
playlist_num: 07
incomplete escape \U at position 3
Traceback (most recent call last):
File "C:\Users\xymok\pipx\venvs\zotify\Lib\site-packages\zotify\track.py", line 190, in download_track
c = len([file for file in Path(filedir).iterdir() if re.search(f'^{filename}_', str(file))]) + 1
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\__init__.py", line 177, in search
return _compile(pattern, flags).search(string)
~~~~~~~~^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\__init__.py", line 350, in _compile
p = _compiler.compile(pattern, flags)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_compiler.py", line 743, in compile
p = _parser.parse(p, flags)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 980, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 459, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
not nested and not items))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 543, in _parse
code = _escape(source, this, state)
File "C:\Users\xymok\scoop\apps\python\current\Lib\re\_parser.py", line 397, in _escape
raise source.error("incomplete escape %s" % escape, len(escape))
re.PatternError: incomplete escape \U at position 3
### Downloaded "Heilung - Fylgija Ear" to "D&D-Lyric (Ctrl+Shift+L)\Heilung - Fylgija Ear.mp3" in 08:34 (plus 11s converting) ###
Fylgija Ear: 100%|████████████████████████████████████████████████████████████████| 8.00/8.00 [08:53<00:00, 66.7s/song]
**All playlists have been downloaded**
Description: Given a playlist with at least 1 song with foreign unicode chars in song title and/or album name and/or author, when the playlist is downloaded via zotify, the physical song with unicode chars will download, however the metadata wil fail to download and this will cause the next song to fail to download and return
SKIPPING SONG - FAILED TO QUERY METADATA
...Followed by incomplete escape \U at position 3
Note that with some song names with unicode chars, the next 3 songs (which do not have unicode) will fail for download, but for some others it's only the next single song (also without unicode) - (possibly due to variable byte-length of specific chars). Then after these 1-3 track failures, download recovers and succeeds on the next track(s) - unless other songs in the playlist also have unicode. I have repeated this with many playlists (with 1 or more unicode chars in track names) and I get the same result.
e.g.: This playlist: https://open.spotify.com/playlist/3cMXTkP11GBDoNitE7jtJk?si=963050a5ecf946b3 Containing this artist/song at track #04: "Myrkur - Två Konungabarn (Single)"
Originally posted by @mkorning in https://github.com/zotify-dev/zotify/discussions/210