mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #791788 (Search in "get books" doesn't work with umlauts)
This commit is contained in:
commit
cec7e74d87
@ -37,7 +37,7 @@ class GandalfStore(BasicStoreConfig, StorePlugin):
|
||||
def search(self, query, max_results=10, timeout=60):
|
||||
url = 'http://www.gandalf.com.pl/s/'
|
||||
values={
|
||||
'search': query.encode('iso8859_2'),
|
||||
'search': query.decode('utf-8').encode('iso8859_2'),
|
||||
'dzialx':'11'
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ __license__ = 'GPL 3'
|
||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import urllib2
|
||||
import urllib
|
||||
from contextlib import closing
|
||||
|
||||
from lxml import html
|
||||
@ -42,7 +42,7 @@ class GutenbergStore(BasicStoreConfig, StorePlugin):
|
||||
def search(self, query, max_results=10, timeout=60):
|
||||
# Gutenberg's website does not allow searching both author and title.
|
||||
# Using a google search so we can search on both fields at once.
|
||||
url = 'http://www.google.com/xhtml?q=site:gutenberg.org+' + urllib2.quote(query)
|
||||
url = 'http://www.google.com/xhtml?q=site:gutenberg.org+' + urllib.quote_plus(query)
|
||||
|
||||
br = browser()
|
||||
|
||||
|
@ -40,7 +40,7 @@ class LegimiStore(BasicStoreConfig, StorePlugin):
|
||||
d.exec_()
|
||||
|
||||
def search(self, query, max_results=10, timeout=60):
|
||||
url = 'http://www.legimi.com/pl/ebooks/?price=any&lang=pl&search=' + urllib.quote_plus(query.encode('utf-8')) + '&sort=relevance'
|
||||
url = 'http://www.legimi.com/pl/ebooks/?price=any&lang=pl&search=' + urllib.quote_plus(query) + '&sort=relevance'
|
||||
|
||||
br = browser()
|
||||
|
||||
|
@ -7,7 +7,7 @@ __copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import re
|
||||
import urllib2
|
||||
import urllib
|
||||
from contextlib import closing
|
||||
|
||||
from lxml import html
|
||||
@ -43,7 +43,7 @@ class ManyBooksStore(BasicStoreConfig, StorePlugin):
|
||||
# It also doesn't do a clear job of references authors and
|
||||
# secondary titles. Google is also faster.
|
||||
# Using a google search so we can search on both fields at once.
|
||||
url = 'http://www.google.com/xhtml?q=site:manybooks.net+' + urllib2.quote(query)
|
||||
url = 'http://www.google.com/xhtml?q=site:manybooks.net+' + urllib.quote_plus(query)
|
||||
|
||||
br = browser()
|
||||
|
||||
|
@ -44,7 +44,7 @@ class NextoStore(BasicStoreConfig, StorePlugin):
|
||||
d.exec_()
|
||||
|
||||
def search(self, query, max_results=10, timeout=60):
|
||||
url = 'http://www.nexto.pl/szukaj.xml?search-clause=' + urllib.quote_plus(query.encode('utf-8')) + '&scid=1015'
|
||||
url = 'http://www.nexto.pl/szukaj.xml?search-clause=' + urllib.quote_plus(query) + '&scid=1015'
|
||||
|
||||
br = browser()
|
||||
|
||||
|
@ -186,7 +186,7 @@ class SearchDialog(QDialog, Ui_Dialog):
|
||||
# Remove excess whitespace.
|
||||
query = re.sub(r'\s{2,}', ' ', query)
|
||||
query = query.strip()
|
||||
return query
|
||||
return query.encode('utf-8')
|
||||
|
||||
def save_state(self):
|
||||
self.config['geometry'] = bytearray(self.saveGeometry())
|
||||
|
@ -35,7 +35,7 @@ class VirtualoStore(BasicStoreConfig, StorePlugin):
|
||||
d.exec_()
|
||||
|
||||
def search(self, query, max_results=10, timeout=60):
|
||||
url = 'http://virtualo.pl/c2/?q=' + urllib.quote(query.encode('utf-8'))
|
||||
url = 'http://virtualo.pl/c2/?q=' + urllib.quote(query)
|
||||
|
||||
br = browser()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user