From b0d36402c2f313f4bf521221b1c3646bd88a0f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Mon, 26 Aug 2013 21:57:13 +0200 Subject: [PATCH 1/2] use ads4books in ebookpoint plugin --- .../gui2/store/stores/ebookpoint_plugin.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/calibre/gui2/store/stores/ebookpoint_plugin.py b/src/calibre/gui2/store/stores/ebookpoint_plugin.py index dd8f45d4ae..427cde6217 100644 --- a/src/calibre/gui2/store/stores/ebookpoint_plugin.py +++ b/src/calibre/gui2/store/stores/ebookpoint_plugin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) -store_version = 2 # Needed for dynamic plugin loading +store_version = 3 # Needed for dynamic plugin loading __license__ = 'GPL 3' __copyright__ = '2011-2013, Tomasz Długosz ' @@ -9,6 +9,7 @@ __docformat__ = 'restructuredtext en' import re import urllib +from base64 import b64encode from contextlib import closing from lxml import html @@ -25,20 +26,20 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog class EbookpointStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): - pid = '5557Y' + aff_root = 'https://www.a4b-tracking.com/pl/stat-click-text-link/32/58/' + + url = 'http://ebookpoint.pl/' + + aff_url = aff_root + str(b64encode(url)) - url = 'http://ebookpoint.pl/view/' + pid detail_url = None - if detail_item: - book_id = re.sub(r'http://ebookpoint.pl/ksiazki', '', detail_item) - if book_id: - detail_url = url + book_id + detail_url = aff_root + str(b64encode(detail_item)) if external or self.config.get('open_external', False): - open_url(QUrl(url_slash_cleaner(detail_url if detail_url else url))) + open_url(QUrl(url_slash_cleaner(detail_url if detail_url else aff_url))) else: - d = WebStoreDialog(self.gui, url, parent, detail_url) + d = WebStoreDialog(self.gui, url, parent, detail_url if detail_url else aff_url) d.setWindowTitle(self.name) d.set_tags(self.config.get('tags', '')) d.exec_() From efc4ac3446d1091f7ddf0e2d1cf3910b7054e71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Mon, 26 Aug 2013 22:04:44 +0200 Subject: [PATCH 2/2] use ads4books in legimi plugin --- src/calibre/gui2/store/stores/legimi_plugin.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/calibre/gui2/store/stores/legimi_plugin.py b/src/calibre/gui2/store/stores/legimi_plugin.py index 0af9220f75..f72abe5758 100644 --- a/src/calibre/gui2/store/stores/legimi_plugin.py +++ b/src/calibre/gui2/store/stores/legimi_plugin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) -store_version = 3 # Needed for dynamic plugin loading +store_version = 4 # Needed for dynamic plugin loading __license__ = 'GPL 3' __copyright__ = '2011-2013, Tomasz Długosz ' @@ -9,6 +9,7 @@ __docformat__ = 'restructuredtext en' import re import urllib +from base64 import b64encode from contextlib import closing from lxml import html @@ -25,18 +26,20 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog class LegimiStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): + aff_root = 'https://www.a4b-tracking.com/pl/stat-click-text-link/9/58/' + + url = 'http://www.legimi.com/pl/ebooki/' + + aff_url = aff_root + str(b64encode(url)) - plain_url = 'http://www.legimi.com/pl/ebooki/' - url = 'https://ssl.afiliant.com/affskrypt,,2f9de2,,11483,,,?u=(' + plain_url + ')' detail_url = None - if detail_item: - detail_url = 'https://ssl.afiliant.com/affskrypt,,2f9de2,,11483,,,?u=(' + detail_item + ')' + detail_url = aff_root + str(b64encode(detail_item)) if external or self.config.get('open_external', False): - open_url(QUrl(url_slash_cleaner(detail_url if detail_url else url))) + open_url(QUrl(url_slash_cleaner(detail_url if detail_url else aff_url))) else: - d = WebStoreDialog(self.gui, url, parent, detail_url) + d = WebStoreDialog(self.gui, url, parent, detail_url if detail_url else aff_url) d.setWindowTitle(self.name) d.set_tags(self.config.get('tags', '')) d.exec_()