This commit is contained in:
Kovid Goyal 2017-07-28 09:20:36 +05:30
parent 076ca1fbb0
commit ef43052004
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
10 changed files with 18 additions and 9 deletions

View File

@ -507,5 +507,6 @@ def main():
keep_elements=options.keep_elements).summary().encode(enc, keep_elements=options.keep_elements).summary().encode(enc,
'replace')) 'replace'))
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -560,7 +560,6 @@ class Quickview(QDialog, Ui_Quickview):
show=True, show=True,
show_copy_button=False) show_copy_button=False)
def select_book(self, row, column): def select_book(self, row, column):
''' '''
row and column both refer the qv table. In particular, column is not row and column both refer the qv table. In particular, column is not

View File

@ -66,7 +66,8 @@ def search_amazon(query, max_results=10, timeout=60,
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src" cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()" title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()' author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()' price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
else: else:
return return

View File

@ -66,7 +66,8 @@ def search_amazon(query, max_results=10, timeout=60,
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src" cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()" title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()' author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()' price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
else: else:
return return

View File

@ -68,7 +68,8 @@ def search_amazon(query, max_results=10, timeout=60,
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src" cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()" title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()' price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
else: else:
return return

View File

@ -68,7 +68,8 @@ def search_amazon(query, max_results=10, timeout=60,
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src" cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()" title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()' price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
else: else:
return return

View File

@ -66,7 +66,8 @@ def search_amazon(query, max_results=10, timeout=60,
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src" cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()" title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()' author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()' price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
else: else:
return return

View File

@ -68,7 +68,8 @@ def search_amazon(query, max_results=10, timeout=60,
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src" cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()" title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY author_xpath = './/span[starts-with(text(), "%s ")]/following-sibling::span//text()' % BY
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()' price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
else: else:
return return

View File

@ -66,7 +66,8 @@ def search_amazon(query, max_results=10, timeout=60,
cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src" cover_xpath = "descendant-or-self::img[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-image ')]/@src"
title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()" title_xpath = "descendant-or-self::h2[@class and contains(concat(' ', normalize-space(@class), ' '), ' s-access-title ')]//text()"
author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()' author_xpath = './/span[starts-with(text(), "by ")]/following-sibling::span//text()'
price_xpath = 'descendant::div[@class="a-row a-spacing-none" and not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()' price_xpath = ('descendant::div[@class="a-row a-spacing-none" and'
' not(span[contains(@class, "kindle-unlimited")])]//span[contains(@class, "s-price")]//text()')
else: else:
return return

View File

@ -87,7 +87,9 @@ class EBookNLStore(BasicStoreConfig, StorePlugin):
formats.append('PDF') formats.append('PDF')
search_result.formats = ', '.join(formats) search_result.formats = ', '.join(formats)
if idata.xpath('.//div[@id="book_detail_body"]/ul/li[strong[contains(., "Type")]]//span[@class="ePubAdobeDRM" or @class="ePubwatermerk" or @class="Pdfwatermark" or @class="PdfAdobeDRM"]'): if idata.xpath('.//div[@id="book_detail_body"]/ul/li[strong[contains(., "Type")]]'
'//span[@class="ePubAdobeDRM" or @class="ePubwatermerk" or'
' @class="Pdfwatermark" or @class="PdfAdobeDRM"]'):
search_result.drm = SearchResult.DRM_LOCKED search_result.drm = SearchResult.DRM_LOCKED
if idata.xpath('.//div[@id="book_detail_body"]/ul/li[strong[contains(., "Type")]]//span[@class="ePubzonderDRM"]'): if idata.xpath('.//div[@id="book_detail_body"]/ul/li[strong[contains(., "Type")]]//span[@class="ePubzonderDRM"]'):
search_result.drm = SearchResult.DRM_UNLOCKED search_result.drm = SearchResult.DRM_UNLOCKED