mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
wolnelektury plugin: add download capability
This commit is contained in:
parent
073a00b431
commit
b10dc544bd
@ -60,17 +60,20 @@ class WolneLekturyStore(BasicStoreConfig, StorePlugin):
|
|||||||
title = ''.join(data.xpath('.//div[@class="title"]/a[1]/text()'))
|
title = ''.join(data.xpath('.//div[@class="title"]/a[1]/text()'))
|
||||||
author = ', '.join(data.xpath('.//div[@class="mono author"]/a/text()'))
|
author = ', '.join(data.xpath('.//div[@class="mono author"]/a/text()'))
|
||||||
price = '0,00 zł'
|
price = '0,00 zł'
|
||||||
formats = ', '.join(data.xpath('.//div[@class="book-box-formats mono"]/span/a/text()'))
|
|
||||||
|
|
||||||
counter -= 1
|
counter -= 1
|
||||||
|
|
||||||
s = SearchResult()
|
s = SearchResult()
|
||||||
|
for link in data.xpath('.//div[@class="book-box-formats mono"]/span/a'):
|
||||||
|
ext = ''.join(link.xpath('./text()'))
|
||||||
|
href = 'http://wolnelektury.pl' + link.get('href')
|
||||||
|
s.downloads[ext] = href
|
||||||
s.cover_url = 'http://wolnelektury.pl' + cover_url.strip()
|
s.cover_url = 'http://wolnelektury.pl' + cover_url.strip()
|
||||||
s.title = title.strip()
|
s.title = title.strip()
|
||||||
s.author = author
|
s.author = author
|
||||||
s.price = price
|
s.price = price
|
||||||
s.detail_item = 'http://wolnelektury.pl' + id
|
s.detail_item = 'http://wolnelektury.pl' + id
|
||||||
s.formats = formats.upper().strip()
|
s.formats = ', '.join(s.downloads.keys())
|
||||||
s.drm = SearchResult.DRM_UNLOCKED
|
s.drm = SearchResult.DRM_UNLOCKED
|
||||||
|
|
||||||
yield s
|
yield s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user