jbh-cloud/spotify_sync

Specific song causes json.decoder.JSONDecodeError:

klunkeh opened this issue · 3 comments

Hi,

I have painstakingly travelled through my 2k+ songs to identify which specific song is causing the MatchService to fail.

Here is the song:
"2sC55P63llXeteDU8tcNZM": { "album": "A State Of Trance Episode 758", "artist": "Cosmic Gate", "explicit": false, "id_": "2sC55P63llXeteDU8tcNZM", "isrc": "NLF711602345", "title": "Exploration Of Space (ASOT 758) - Cosmic Gate's Third Contact Remix", "url": "https://open.spotify.com/track/2sC55P63llXeteDU8tcNZM" },

Removing from the song from the playlist, and then removing spotify cache, resolves the issue.

.\spotify_sync run auto --config .\config.json [2022-10-30 11:20:07,060] INFO SpotifySync : Loading config from file config.json [2022-10-30 11:20:07,061] INFO SpotifySync : Script started with auto command [2022-10-30 11:20:09,533] INFO SpotifyService : Fetching liked songs [2022-10-30 11:20:09,972] INFO SpotifyService : Added 0 new liked song(s) from Spotify (cached:2570) [2022-10-30 11:20:09,972] INFO SpotifyService : Fetching playlist songs [2022-10-30 11:20:35,044] INFO SpotifyService : Adding 0/2672 from playlists [2022-10-30 11:20:50,584] INFO MatchService : Attempting to match 1 Spotify songs to Deezer Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts\spotify_sync.exe\__main__.py", line 7, in <module> File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1055, in main rv = self.invoke(ctx) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 760, in invoke return __callback(*args, **kwargs) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\spotify_sync\__main__.py", line 47, in auto app.auto() File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\spotify_sync\cli.py", line 53, in auto match_svc.process_spotify() File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\spotify_sync\match.py", line 122, in process_spotify self._match_unprocessed() File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\spotify_sync\match.py", line 181, in _match_unprocessed match_futures = [executor.submit(m.search()) for m in matchers] File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\spotify_sync\match.py", line 181, in <listcomp> match_futures = [executor.submit(m.search()) for m in matchers] File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\spotify_sync\match.py", line 72, in search self._match_fuzzy() File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\spotify_sync\match.py", line 53, in _match_fuzzy deezer_search = Deezer.API.advanced_search( File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\deezer\api.py", line 209, in advanced_search return self.search(query, strict, order, index, limit) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\deezer\api.py", line 205, in search return self.api_call('search', args) File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\deezer\api.py", line 34, in api_call result_json = self.session.get( File "C:\Users\Me\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\requests\models.py", line 900, in json return complexjson.loads(self.text, **kwargs) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@klunkeh thanks for debugging so far, looks to be a bug in deezerpy (API wrapper). I will come back to you.

@klunkeh this fix is now part of 1.0.5 release to pypi. Just need to upgrade your instance python3 -m pip install -U spot_sync

@jbh-cloud amazing! Thank you for your prompt action :)