mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Final versions of Beam and EPUBBuy.
This commit is contained in:
parent
6ebdda7aa5
commit
c10349c5dd
@ -24,7 +24,8 @@ class BeamEBooksDEStore(BasicStoreConfig, StorePlugin):
|
|||||||
|
|
||||||
def open(self, parent=None, detail_item=None, external=False):
|
def open(self, parent=None, detail_item=None, external=False):
|
||||||
url = 'http://klick.affiliwelt.net/klick.php?bannerid=10072&pid=32307&prid=908'
|
url = 'http://klick.affiliwelt.net/klick.php?bannerid=10072&pid=32307&prid=908'
|
||||||
url_details = 'http://klick.affiliwelt.net/klick.php?bannerid=10730&pid=32307&prid=908&prodid={0}'
|
url_details = ('http://klick.affiliwelt.net/klick.php?'
|
||||||
|
'bannerid=10730&pid=32307&prid=908&prodid={0}')
|
||||||
|
|
||||||
if external or self.config.get('open_external', False):
|
if external or self.config.get('open_external', False):
|
||||||
if detail_item:
|
if detail_item:
|
||||||
@ -54,15 +55,23 @@ class BeamEBooksDEStore(BasicStoreConfig, StorePlugin):
|
|||||||
if not id:
|
if not id:
|
||||||
continue
|
continue
|
||||||
id = id[7:]
|
id = id[7:]
|
||||||
|
print(id)
|
||||||
cover_url = ''.join(data.xpath('./tr/td[1]/a/img/@src'))
|
cover_url = ''.join(data.xpath('./tr/td[1]/a/img/@src'))
|
||||||
if cover_url:
|
if cover_url:
|
||||||
cover_url = 'http://www.beam-ebooks.de' + cover_url
|
cover_url = 'http://www.beam-ebooks.de' + cover_url
|
||||||
title = ''.join(data.xpath('./tr/td/div[@class="stil2"]/a/b/text()'))
|
title = ''.join(data.xpath('./tr/td/div[@class="stil2"]/a/b/text()'))
|
||||||
author = ' '.join(data.xpath('./tr/td/div[@class="stil2"]/child::b/text()|./tr/td/div[@class="stil2"]/child::strong/text()'))
|
author = ' '.join(data.xpath('./tr/td/div[@class="stil2"]/'
|
||||||
|
'child::b/text()'
|
||||||
|
'|'
|
||||||
|
'./tr/td/div[@class="stil2"]/'
|
||||||
|
'child::strong/text()'))
|
||||||
price = ''.join(data.xpath('./tr/td[3]/text()'))
|
price = ''.join(data.xpath('./tr/td[3]/text()'))
|
||||||
pdf = data.xpath('boolean(./tr/td[3]/a/img[contains(@alt, "PDF")]/@alt)')
|
pdf = data.xpath(
|
||||||
epub = data.xpath('boolean(./tr/td[3]/a/img[contains(@alt, "ePub")]/@alt)')
|
'boolean(./tr/td[3]/a/img[contains(@alt, "PDF")]/@alt)')
|
||||||
mobi = data.xpath('boolean(./tr/td[3]/a/img[contains(@alt, "Mobipocket")]/@alt)')
|
epub = data.xpath(
|
||||||
|
'boolean(./tr/td[3]/a/img[contains(@alt, "ePub")]/@alt)')
|
||||||
|
mobi = data.xpath(
|
||||||
|
'boolean(./tr/td[3]/a/img[contains(@alt, "Mobipocket")]/@alt)')
|
||||||
counter -= 1
|
counter -= 1
|
||||||
|
|
||||||
s = SearchResult()
|
s = SearchResult()
|
||||||
|
@ -23,8 +23,9 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog
|
|||||||
class EPubBuyDEStore(BasicStoreConfig, StorePlugin):
|
class EPubBuyDEStore(BasicStoreConfig, StorePlugin):
|
||||||
|
|
||||||
def open(self, parent=None, detail_item=None, external=False):
|
def open(self, parent=None, detail_item=None, external=False):
|
||||||
url = 'http://www.epubbuy.com/'
|
url = 'http://klick.affiliwelt.net/klick.php?bannerid=47653&pid=32307&prid=2627'
|
||||||
url_details = '{0}'
|
url_details = ('http://klick.affiliwelt.net/klick.php?bannerid=47653'
|
||||||
|
'&pid=32307&prid=2627&prodid={0}')
|
||||||
|
|
||||||
if external or self.config.get('open_external', False):
|
if external or self.config.get('open_external', False):
|
||||||
if detail_item:
|
if detail_item:
|
||||||
@ -50,13 +51,19 @@ class EPubBuyDEStore(BasicStoreConfig, StorePlugin):
|
|||||||
if counter <= 0:
|
if counter <= 0:
|
||||||
break
|
break
|
||||||
|
|
||||||
id = ''.join(data.xpath('./div[@class="center_block"]/a[@class="product_img_link"]/@href')).strip()
|
id = ''.join(data.xpath('./div[@class="center_block"]'
|
||||||
|
'/p[contains(text(), "artnr:")]/text()')).strip()
|
||||||
if not id:
|
if not id:
|
||||||
continue
|
continue
|
||||||
cover_url = ''.join(data.xpath('./div[@class="center_block"]/a[@class="product_img_link"]/img/@src'))
|
id = id[6:].strip()
|
||||||
|
if not id:
|
||||||
|
continue
|
||||||
|
cover_url = ''.join(data.xpath('./div[@class="center_block"]'
|
||||||
|
'/a[@class="product_img_link"]/img/@src'))
|
||||||
if cover_url:
|
if cover_url:
|
||||||
cover_url = 'http://www.epubbuy.com' + cover_url
|
cover_url = 'http://www.epubbuy.com' + cover_url
|
||||||
title = ''.join(data.xpath('./div[@class="center_block"]/a[@class="product_img_link"]/@title'))
|
title = ''.join(data.xpath('./div[@class="center_block"]'
|
||||||
|
'/a[@class="product_img_link"]/@title'))
|
||||||
author = ''.join(data.xpath('./div[@class="center_block"]/a[2]/text()'))
|
author = ''.join(data.xpath('./div[@class="center_block"]/a[2]/text()'))
|
||||||
price = ''.join(data.xpath('.//span[@class="price"]/text()'))
|
price = ''.join(data.xpath('.//span[@class="price"]/text()'))
|
||||||
counter -= 1
|
counter -= 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user