mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Account for website changes to several EU stores. Remove "affiliate" from Waterstones, as they no longer pay commissions on ebooks.
This commit is contained in:
parent
7a07df0413
commit
70d0f749e1
@ -1538,7 +1538,7 @@ class StoreWaterstonesUKStore(StoreBase):
|
|||||||
|
|
||||||
headquarters = 'UK'
|
headquarters = 'UK'
|
||||||
formats = ['EPUB', 'PDF']
|
formats = ['EPUB', 'PDF']
|
||||||
affiliate = True
|
affiliate = False
|
||||||
|
|
||||||
class StoreWeightlessBooksStore(StoreBase):
|
class StoreWeightlessBooksStore(StoreBase):
|
||||||
name = 'Weightless Books'
|
name = 'Weightless Books'
|
||||||
|
@ -68,9 +68,9 @@ class AmazonDEKindleStore(StorePlugin):
|
|||||||
cover_url = ''.join(data.xpath(cover_xpath))
|
cover_url = ''.join(data.xpath(cover_xpath))
|
||||||
|
|
||||||
title = ''.join(data.xpath('.//a[@class="title"]/text()'))
|
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 '):
|
if author.startswith('von '):
|
||||||
author = author[4:]
|
author = author[4:]
|
||||||
|
|
||||||
|
@ -64,8 +64,8 @@ class AmazonESKindleStore(StorePlugin):
|
|||||||
cover_url = ''.join(data.xpath(cover_xpath))
|
cover_url = ''.join(data.xpath(cover_xpath))
|
||||||
|
|
||||||
title = ''.join(data.xpath('.//a[@class="title"]/text()'))
|
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 = unicode(''.join(data.xpath('.//div[@class="title"]/span[@class="ptBrand"]/text()')))
|
author = unicode(''.join(data.xpath('.//h3[@class="title"]/span[@class="ptBrand"]/text()')))
|
||||||
if author.startswith('de '):
|
if author.startswith('de '):
|
||||||
author = author[3:]
|
author = author[3:]
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ class AmazonFRKindleStore(StorePlugin):
|
|||||||
cover_url = ''.join(data.xpath(cover_xpath))
|
cover_url = ''.join(data.xpath(cover_xpath))
|
||||||
|
|
||||||
title = ''.join(data.xpath('.//a[@class="title"]/text()'))
|
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 = unicode(''.join(data.xpath('.//div[@class="title"]/span[@class="ptBrand"]/text()')))
|
author = unicode(''.join(data.xpath('.//h3[@class="title"]/span[@class="ptBrand"]/text()')))
|
||||||
if author.startswith('de '):
|
if author.startswith('de '):
|
||||||
author = author[3:]
|
author = author[3:]
|
||||||
|
|
||||||
|
@ -64,8 +64,8 @@ class AmazonITKindleStore(StorePlugin):
|
|||||||
cover_url = ''.join(data.xpath(cover_xpath))
|
cover_url = ''.join(data.xpath(cover_xpath))
|
||||||
|
|
||||||
title = ''.join(data.xpath('.//a[@class="title"]/text()'))
|
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 = unicode(''.join(data.xpath('.//div[@class="title"]/span[@class="ptBrand"]/text()')))
|
author = unicode(''.join(data.xpath('.//h3[@class="title"]/span[@class="ptBrand"]/text()')))
|
||||||
if author.startswith('di '):
|
if author.startswith('di '):
|
||||||
author = author[3:]
|
author = author[3:]
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@ class AmazonUKKindleStore(StorePlugin):
|
|||||||
cover_url = ''.join(data.xpath(cover_xpath))
|
cover_url = ''.join(data.xpath(cover_xpath))
|
||||||
|
|
||||||
title = ''.join(data.xpath('.//a[@class="title"]/text()'))
|
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 '):
|
if author.startswith('by '):
|
||||||
author = author[3:]
|
author = author[3:]
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ class EBookShoppeUKStore(BasicStoreConfig, StorePlugin):
|
|||||||
def search(self, query, max_results=10, timeout=60):
|
def search(self, query, max_results=10, timeout=60):
|
||||||
url = 'http://www.ebookshoppe.com/search.php?search_query=' + urllib2.quote(query)
|
url = 'http://www.ebookshoppe.com/search.php?search_query=' + urllib2.quote(query)
|
||||||
br = browser()
|
br = browser()
|
||||||
|
br.addheaders = [("Referer", "http://www.ebookshoppe.com/")]
|
||||||
|
|
||||||
counter = max_results
|
counter = max_results
|
||||||
with closing(br.open(url, timeout=timeout)) as f:
|
with closing(br.open(url, timeout=timeout)) as f:
|
||||||
|
@ -25,16 +25,15 @@ class FoylesUKStore(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.awin1.com/awclick.php?mid=1414&id=120917'
|
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='
|
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 external or self.config.get('open_external', False):
|
||||||
if detail_item:
|
if detail_item:
|
||||||
url = detail_url + url_redirect + detail_item
|
url = detail_url + detail_item
|
||||||
open_url(QUrl(url_slash_cleaner(url)))
|
open_url(QUrl(url_slash_cleaner(url)))
|
||||||
else:
|
else:
|
||||||
detail_url = None
|
detail_url = None
|
||||||
if detail_item:
|
if detail_item:
|
||||||
detail_url = url + url_redirect + detail_item
|
detail_url = url + detail_item
|
||||||
d = WebStoreDialog(self.gui, url, parent, detail_url)
|
d = WebStoreDialog(self.gui, url, parent, detail_url)
|
||||||
d.setWindowTitle(self.name)
|
d.setWindowTitle(self.name)
|
||||||
d.set_tags(self.config.get('tags', ''))
|
d.set_tags(self.config.get('tags', ''))
|
||||||
|
@ -59,7 +59,7 @@ class LibreDEStore(BasicStoreConfig, StorePlugin):
|
|||||||
id = ''.join(details.xpath('./div[@class="text"]/a/@name')).strip()
|
id = ''.join(details.xpath('./div[@class="text"]/a/@name')).strip()
|
||||||
if not id:
|
if not id:
|
||||||
continue
|
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()
|
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()
|
author = ''.join(details.xpath('./div[@class="text"]/span[@class="author"]/text()')).strip()
|
||||||
pdf = details.xpath(
|
pdf = details.xpath(
|
||||||
@ -68,7 +68,8 @@ class LibreDEStore(BasicStoreConfig, StorePlugin):
|
|||||||
'boolean(.//span[@class="format" and contains(text(), "epub")]/text())')
|
'boolean(.//span[@class="format" and contains(text(), "epub")]/text())')
|
||||||
mobi = details.xpath(
|
mobi = details.xpath(
|
||||||
'boolean(.//span[@class="format" and contains(text(), "mobipocket")]/text())')
|
'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
|
counter -= 1
|
||||||
|
|
||||||
s = SearchResult()
|
s = SearchResult()
|
||||||
|
@ -41,7 +41,7 @@ class WHSmithUKStore(BasicStoreConfig, StorePlugin):
|
|||||||
|
|
||||||
def search(self, query, max_results=10, timeout=60):
|
def search(self, query, max_results=10, timeout=60):
|
||||||
url = ('http://www.whsmith.co.uk/CatalogAndSearch/SearchWithinCategory.aspx'
|
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()
|
br = browser()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user