Urlencode search query

This commit is contained in:
0x29a 2023-02-02 21:02:57 +01:00
parent 006ff697b9
commit 22eeee7368

View file

@ -1,5 +1,6 @@
""" functionality outline for a book data connector """
from abc import ABC, abstractmethod
from urllib.parse import quote_plus
import imghdr
import logging
import re
@ -48,7 +49,7 @@ class AbstractMinimalConnector(ABC):
return f"{self.isbn_search_url}{normalized_query}"
# NOTE: previously, we tried searching isbn and if that produces no results,
# searched as free text. This, instead, only searches isbn if it's isbn-y
return f"{self.search_url}{query}"
return f"{self.search_url}{quote_plus(query)}"
def process_search_response(self, query, data, min_confidence):
"""Format the search results based on the formt of the query"""