py3: store plugins always receive bytes query

... and cannot be further encoded. When interpolating into strings,
however, they do need to decode it.
This commit is contained in:
Eli Schwartz 2019-04-18 02:59:22 -04:00
parent 69cf3d345a
commit 1edab4b818
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
3 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ class BNStore(BasicStoreConfig, StorePlugin):
d.exec_()
def search(self, query, max_results=10, timeout=60):
url = 'http://www.barnesandnoble.com/s/%s?keyword=%s&store=ebook&view=list' % (query.replace(' ', '-'), quote_plus(query))
url = 'http://www.barnesandnoble.com/s/%s?keyword=%s&store=ebook&view=list' % (query.decode('utf-8').replace(' ', '-'), quote_plus(query))
br = browser()

View File

@ -36,7 +36,7 @@ def as_base64(data):
def search(query, max_results=10, timeout=60):
url = 'http://woblink.com/publication/ajax?mode=none&query=' + quote_plus(query.encode('utf-8'))
url = 'http://woblink.com/publication/ajax?mode=none&query=' + quote_plus(query)
if max_results > 10:
if max_results > 20:
url += '&limit=30'

View File

@ -44,7 +44,7 @@ class WolneLekturyStore(BasicStoreConfig, StorePlugin):
d.exec_()
def search(self, query, max_results=10, timeout=60):
url = 'http://wolnelektury.pl/szukaj?q=' + quote_plus(query.encode('utf-8'))
url = 'http://wolnelektury.pl/szukaj?q=' + quote_plus(query)
br = browser()