diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index af5590cc53..e8d5c5fc91 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -1538,7 +1538,7 @@ class StoreWaterstonesUKStore(StoreBase): headquarters = 'UK' formats = ['EPUB', 'PDF'] - affiliate = True + affiliate = False class StoreWeightlessBooksStore(StoreBase): name = 'Weightless Books' diff --git a/src/calibre/gui2/store/stores/amazon_de_plugin.py b/src/calibre/gui2/store/stores/amazon_de_plugin.py index c42c7392a1..69e7dcaafc 100644 --- a/src/calibre/gui2/store/stores/amazon_de_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_de_plugin.py @@ -68,9 +68,9 @@ class AmazonDEKindleStore(StorePlugin): cover_url = ''.join(data.xpath(cover_xpath)) title = ''.join(data.xpath('.//a[@class="title"]/text()')) - price = ''.join(data.xpath('.//span[@class="price"]/text()')) + price = ''.join(data.xpath('.//div[@class="newPrice"]/span[contains(@class, "price")]/text()')) - author = ''.join(data.xpath('.//div[@class="title"]/span[@class="ptBrand"]/text()')) + author = ''.join(data.xpath('.//h3[@class="title"]/span[@class="ptBrand"]/text()')) if author.startswith('von '): author = author[4:] diff --git a/src/calibre/gui2/store/stores/amazon_es_plugin.py b/src/calibre/gui2/store/stores/amazon_es_plugin.py index 97abab61ed..094f1e13c9 100644 --- a/src/calibre/gui2/store/stores/amazon_es_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_es_plugin.py @@ -64,8 +64,8 @@ class AmazonESKindleStore(StorePlugin): cover_url = ''.join(data.xpath(cover_xpath)) title = ''.join(data.xpath('.//a[@class="title"]/text()')) - price = ''.join(data.xpath('.//span[@class="price"]/text()')) - author = unicode(''.join(data.xpath('.//div[@class="title"]/span[@class="ptBrand"]/text()'))) + price = ''.join(data.xpath('.//div[@class="newPrice"]/span[contains(@class, "price")]/text()')) + author = unicode(''.join(data.xpath('.//h3[@class="title"]/span[@class="ptBrand"]/text()'))) if author.startswith('de '): author = author[3:] diff --git a/src/calibre/gui2/store/stores/amazon_fr_plugin.py b/src/calibre/gui2/store/stores/amazon_fr_plugin.py index b98ba06117..4e31d69ca5 100644 --- a/src/calibre/gui2/store/stores/amazon_fr_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_fr_plugin.py @@ -65,8 +65,8 @@ class AmazonFRKindleStore(StorePlugin): cover_url = ''.join(data.xpath(cover_xpath)) title = ''.join(data.xpath('.//a[@class="title"]/text()')) - price = ''.join(data.xpath('.//span[@class="price"]/text()')) - author = unicode(''.join(data.xpath('.//div[@class="title"]/span[@class="ptBrand"]/text()'))) + price = ''.join(data.xpath('.//div[@class="newPrice"]/span[contains(@class, "price")]/text()')) + author = unicode(''.join(data.xpath('.//h3[@class="title"]/span[@class="ptBrand"]/text()'))) if author.startswith('de '): author = author[3:] diff --git a/src/calibre/gui2/store/stores/amazon_it_plugin.py b/src/calibre/gui2/store/stores/amazon_it_plugin.py index 23cde51555..39dd1ee0ce 100644 --- a/src/calibre/gui2/store/stores/amazon_it_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_it_plugin.py @@ -64,8 +64,8 @@ class AmazonITKindleStore(StorePlugin): cover_url = ''.join(data.xpath(cover_xpath)) title = ''.join(data.xpath('.//a[@class="title"]/text()')) - price = ''.join(data.xpath('.//span[@class="price"]/text()')) - author = unicode(''.join(data.xpath('.//div[@class="title"]/span[@class="ptBrand"]/text()'))) + price = ''.join(data.xpath('.//div[@class="newPrice"]/span[contains(@class, "price")]/text()')) + author = unicode(''.join(data.xpath('.//h3[@class="title"]/span[@class="ptBrand"]/text()'))) if author.startswith('di '): author = author[3:] diff --git a/src/calibre/gui2/store/stores/amazon_uk_plugin.py b/src/calibre/gui2/store/stores/amazon_uk_plugin.py index 0d063a4a6e..7fb1cec2d3 100644 --- a/src/calibre/gui2/store/stores/amazon_uk_plugin.py +++ b/src/calibre/gui2/store/stores/amazon_uk_plugin.py @@ -64,9 +64,9 @@ class AmazonUKKindleStore(StorePlugin): cover_url = ''.join(data.xpath(cover_xpath)) title = ''.join(data.xpath('.//a[@class="title"]/text()')) - price = ''.join(data.xpath('.//span[@class="price"]/text()')) + price = ''.join(data.xpath('.//div[@class="newPrice"]/span[contains(@class, "price")]/text()')) - author = ''.join(data.xpath('.//div[@class="title"]/span[@class="ptBrand"]/text()')) + author = ''.join(data.xpath('.//h3[@class="title"]/span[@class="ptBrand"]/text()')) if author.startswith('by '): author = author[3:] diff --git a/src/calibre/gui2/store/stores/ebookshoppe_uk_plugin.py b/src/calibre/gui2/store/stores/ebookshoppe_uk_plugin.py index 5db03ab383..804279d3fd 100644 --- a/src/calibre/gui2/store/stores/ebookshoppe_uk_plugin.py +++ b/src/calibre/gui2/store/stores/ebookshoppe_uk_plugin.py @@ -42,6 +42,7 @@ class EBookShoppeUKStore(BasicStoreConfig, StorePlugin): def search(self, query, max_results=10, timeout=60): url = 'http://www.ebookshoppe.com/search.php?search_query=' + urllib2.quote(query) br = browser() + br.addheaders = [("Referer", "http://www.ebookshoppe.com/")] counter = max_results with closing(br.open(url, timeout=timeout)) as f: diff --git a/src/calibre/gui2/store/stores/foyles_uk_plugin.py b/src/calibre/gui2/store/stores/foyles_uk_plugin.py index c7c236d200..906d47b7ea 100644 --- a/src/calibre/gui2/store/stores/foyles_uk_plugin.py +++ b/src/calibre/gui2/store/stores/foyles_uk_plugin.py @@ -25,16 +25,15 @@ class FoylesUKStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): url = 'http://www.awin1.com/awclick.php?mid=1414&id=120917' detail_url = 'http://www.awin1.com/cread.php?awinmid=1414&awinaffid=120917&clickref=&p=' - url_redirect = 'http://www.foyles.co.uk' if external or self.config.get('open_external', False): if detail_item: - url = detail_url + url_redirect + detail_item + url = detail_url + detail_item open_url(QUrl(url_slash_cleaner(url))) else: detail_url = None if detail_item: - detail_url = url + url_redirect + detail_item + detail_url = url + detail_item d = WebStoreDialog(self.gui, url, parent, detail_url) d.setWindowTitle(self.name) d.set_tags(self.config.get('tags', '')) diff --git a/src/calibre/gui2/store/stores/libri_de_plugin.py b/src/calibre/gui2/store/stores/libri_de_plugin.py index a83353523e..643cac3d99 100644 --- a/src/calibre/gui2/store/stores/libri_de_plugin.py +++ b/src/calibre/gui2/store/stores/libri_de_plugin.py @@ -59,7 +59,7 @@ class LibreDEStore(BasicStoreConfig, StorePlugin): id = ''.join(details.xpath('./div[@class="text"]/a/@name')).strip() if not id: continue - cover_url = ''.join(details.xpath('./div[@class="bild"]/a/img/@src')) + cover_url = ''.join(details.xpath('.//div[@class="coverImg"]/a/img/@src')) title = ''.join(details.xpath('./div[@class="text"]/span[@class="titel"]/a/text()')).strip() author = ''.join(details.xpath('./div[@class="text"]/span[@class="author"]/text()')).strip() pdf = details.xpath( @@ -68,7 +68,8 @@ class LibreDEStore(BasicStoreConfig, StorePlugin): 'boolean(.//span[@class="format" and contains(text(), "epub")]/text())') mobi = details.xpath( 'boolean(.//span[@class="format" and contains(text(), "mobipocket")]/text())') - price = (''.join(data.xpath('.//span[@class="preis"]/text()'))).replace('*', '') + price = ''.join(data.xpath('.//span[@class="preis"]/text()')).replace('*', '').strip() + counter -= 1 s = SearchResult() diff --git a/src/calibre/gui2/store/stores/whsmith_uk_plugin.py b/src/calibre/gui2/store/stores/whsmith_uk_plugin.py index 66d81258f7..5d78340517 100644 --- a/src/calibre/gui2/store/stores/whsmith_uk_plugin.py +++ b/src/calibre/gui2/store/stores/whsmith_uk_plugin.py @@ -41,7 +41,7 @@ class WHSmithUKStore(BasicStoreConfig, StorePlugin): def search(self, query, max_results=10, timeout=60): url = ('http://www.whsmith.co.uk/CatalogAndSearch/SearchWithinCategory.aspx' - '?cat=\Books\eb_eBooks&gq=' + urllib2.quote(query)) + '?cat=\eb_eBooks&gq=' + urllib2.quote(query)) br = browser()