mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3 porting
This commit is contained in:
parent
2742bd7e29
commit
eb37632940
@ -58,7 +58,7 @@ class EmpikStore(BasicStoreConfig, StorePlugin):
|
||||
d.exec_()
|
||||
|
||||
def search(self, query, max_results=10, timeout=60):
|
||||
url = 'http://www.empik.com/ebooki/ebooki,3501,s?resultsPP=' + str(max_results) + '&q=' + quote(query)
|
||||
url = 'http://www.empik.com/ebooki/ebooki,3501,s?resultsPP={}&q={}'.format(max_results, quote(query))
|
||||
|
||||
br = browser()
|
||||
|
||||
|
@ -57,7 +57,7 @@ class NextoStore(BasicStoreConfig, StorePlugin):
|
||||
counter = max_results
|
||||
|
||||
while counter:
|
||||
with closing(br.open(url + '&_offset=' + str(offset), timeout=timeout)) as f:
|
||||
with closing(br.open(url + '&_offset={}'.format(offset), timeout=timeout)) as f:
|
||||
doc = html.fromstring(f.read())
|
||||
for data in doc.xpath('//ul[@class="productslist"]/li'):
|
||||
if counter <= 0:
|
||||
@ -76,7 +76,7 @@ class NextoStore(BasicStoreConfig, StorePlugin):
|
||||
title = re.sub(r' – ebook', '', title)
|
||||
author = ', '.join(data.xpath('.//div[@class="col-7"]//h4//a/text()'))
|
||||
formats = ', '.join(data.xpath('.//ul[@class="formats"]/li//b/text()'))
|
||||
DrmFree = re.search(r'znak', str(data.xpath('.//ul[@class="formats"]/li//b/@title')))
|
||||
DrmFree = re.search(r'znak', type('')(data.xpath('.//ul[@class="formats"]/li//b/@title')))
|
||||
|
||||
counter -= 1
|
||||
|
||||
|
@ -62,7 +62,7 @@ class PublioStore(BasicStoreConfig, StorePlugin):
|
||||
counter = max_results
|
||||
page = 1
|
||||
while counter:
|
||||
with closing(br.open('http://www.publio.pl/e-booki,strona' + str(page) + '.html?q=' + quote(query), timeout=timeout)) as f: # noqa
|
||||
with closing(br.open('http://www.publio.pl/e-booki,strona{}.html?q={}'.format(page, quote(query)), timeout=timeout)) as f: # noqa
|
||||
doc = html.fromstring(f.read())
|
||||
for data in doc.xpath('//div[@class="products-list"]//div[@class="product-tile"]'):
|
||||
if counter <= 0:
|
||||
|
@ -63,7 +63,7 @@ class SwiatEbookowStore(BasicStoreConfig, StorePlugin):
|
||||
|
||||
counter = max_results
|
||||
while counter:
|
||||
with closing(br.open('https://www.swiatebookow.pl/ebooki/?q=' + quote(query) + '&page=' + str(page), timeout=timeout)) as f:
|
||||
with closing(br.open('https://www.swiatebookow.pl/ebooki/?q=' + quote(query) + '&page={}'.format(page), timeout=timeout)) as f:
|
||||
doc = html.fromstring(f.read().decode('utf-8'))
|
||||
for data in doc.xpath('//div[@class="category-item-container"]//div[@class="book-large"]'):
|
||||
if counter <= 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user