py3 compat

This commit is contained in:
Kovid Goyal 2019-08-20 21:09:20 +05:30
parent 06755d5eba
commit 60d4bbf57d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -26,7 +26,7 @@ def parse_html(raw):
class GoogleImages(Source): class GoogleImages(Source):
name = 'Google Images' name = 'Google Images'
version = (1, 0, 0) version = (1, 0, 1)
minimum_calibre_version = (2, 80, 0) minimum_calibre_version = (2, 80, 0)
description = _('Downloads covers from a Google Image search. Useful to find larger/alternate covers.') description = _('Downloads covers from a Google Image search. Useful to find larger/alternate covers.')
capabilities = frozenset(['cover']) capabilities = frozenset(['cover'])
@ -72,7 +72,9 @@ class GoogleImages(Source):
from collections import OrderedDict from collections import OrderedDict
ans = OrderedDict() ans = OrderedDict()
br = self.browser br = self.browser
q = urlencode({'as_q': ('%s %s'%(title, author)).encode('utf-8')}).decode('utf-8') q = urlencode({'as_q': ('%s %s'%(title, author)).encode('utf-8')})
if isinstance(q, bytes):
q = q.decode('utf-8')
sz = self.prefs['size'] sz = self.prefs['size']
if sz == 'any': if sz == 'any':
sz = '' sz = ''