mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
d6c15c3b5c
commit
b47b53bdba
@ -24,20 +24,23 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog
|
|||||||
class KoboStore(BasicStoreConfig, StorePlugin):
|
class KoboStore(BasicStoreConfig, StorePlugin):
|
||||||
|
|
||||||
def open(self, parent=None, detail_item=None, external=False):
|
def open(self, parent=None, detail_item=None, external=False):
|
||||||
m_url = 'http://www.dpbolvw.net/'
|
pub_id = 'sHa5EXvYOwA'
|
||||||
h_click = 'click-4879827-10762497'
|
# Use Kovid's affiliate id 30% of the time.
|
||||||
d_click = 'click-4879827-10772898'
|
if random.randint(1, 10) in (1, 2, 3):
|
||||||
# Use Kovid's affiliate id 30% of the time.
|
pub_id = '0dsO3kDu/AU'
|
||||||
if random.randint(1, 10) in (1, 2, 3):
|
|
||||||
h_click = 'click-4913808-10762497'
|
|
||||||
d_click = 'click-4913808-10772898'
|
|
||||||
|
|
||||||
url = m_url + h_click
|
murl = 'http://click.linksynergy.com/fs-bin/click?id=%s&offerid=268429.4&type=3&subid=0' % pub_id
|
||||||
detail_url = None
|
|
||||||
if detail_item:
|
|
||||||
detail_url = m_url + d_click + detail_item
|
|
||||||
|
|
||||||
if external or self.config.get('open_external', False):
|
if detail_item:
|
||||||
|
purl = 'http://click.linksynergy.com/fs-bin/click?id=%s&subid=&offerid=268429.1&type=10&tmpid=9310&RD_PARM1=%s' % urllib.quote_plus(pub_id, detail_item)
|
||||||
|
url = purl
|
||||||
|
else:
|
||||||
|
purl = None
|
||||||
|
url = murl
|
||||||
|
|
||||||
|
print(url)
|
||||||
|
|
||||||
|
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 url)))
|
||||||
else:
|
else:
|
||||||
d = WebStoreDialog(self.gui, url, parent, detail_url)
|
d = WebStoreDialog(self.gui, url, parent, detail_url)
|
||||||
@ -78,7 +81,7 @@ class KoboStore(BasicStoreConfig, StorePlugin):
|
|||||||
s.title = title.strip()
|
s.title = title.strip()
|
||||||
s.author = author.strip()
|
s.author = author.strip()
|
||||||
s.price = price.strip()
|
s.price = price.strip()
|
||||||
s.detail_item = '?url=http://www.kobobooks.com/' + id.strip()
|
s.detail_item = 'http://www.kobobooks.com/' + id.strip()
|
||||||
s.drm = SearchResult.DRM_LOCKED if drm else SearchResult.DRM_UNLOCKED
|
s.drm = SearchResult.DRM_LOCKED if drm else SearchResult.DRM_UNLOCKED
|
||||||
s.formats = 'EPUB'
|
s.formats = 'EPUB'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user