From 00aa2e892f7dd9cc81b83619bc042a6be0ea6bf8 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sat, 4 Mar 2023 15:46:34 -0500 Subject: [PATCH] Fix bug in artist and album lookup --- vrobbler/apps/scrobbles/theaudiodb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vrobbler/apps/scrobbles/theaudiodb.py b/vrobbler/apps/scrobbles/theaudiodb.py index 78a05e2..67c91b5 100644 --- a/vrobbler/apps/scrobbles/theaudiodb.py +++ b/vrobbler/apps/scrobbles/theaudiodb.py @@ -1,3 +1,4 @@ +import urllib import json import logging @@ -13,6 +14,7 @@ logger = logging.getLogger(__name__) def lookup_artist_from_tadb(name: str) -> dict: artist_info = {} + name = urllib.parse.quote(name) response = requests.get(ARTIST_SEARCH_URL + name) if response.status_code != 200: @@ -37,6 +39,8 @@ def lookup_artist_from_tadb(name: str) -> dict: def lookup_album_from_tadb(name: str, artist: str) -> dict: album_info = {} + artist = urllib.parse.quote(artist) + name = urllib.parse.quote(name) response = requests.get(''.join([ALBUM_SEARCH_URL, artist, "&a=", name])) if response.status_code != 200: