diff --git a/src/calibre/gui2/store/bn_plugin.py b/src/calibre/gui2/store/bn_plugin.py index 872397f5f8..77b982af4a 100644 --- a/src/calibre/gui2/store/bn_plugin.py +++ b/src/calibre/gui2/store/bn_plugin.py @@ -6,6 +6,7 @@ __license__ = 'GPL 3' __copyright__ = '2011, John Schember ' __docformat__ = 'restructuredtext en' +import re import urllib2 from contextlib import closing @@ -24,7 +25,13 @@ class BNStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): settings = self.get_settings() - url = 'http://www.barnesandnoble.com/ebooks/index.asp' + url = 'http://gan.doubleclick.net/gan_click?lid=41000000028437369&pubid=21000000000352219' + + if detail_item: + mo = re.search(r'(?<=/)(?P\d+)(?=/|$)', detail_item) + if mo: + isbn = mo.group('isbn') + detail_item = 'http://gan.doubleclick.net/gan_click?lid=41000000012871747&pid=' + isbn + '&adurl=' + detail_item + '&pubid=21000000000352219' if external or settings.get(self.name + '_open_external', False): open_url(QUrl(url_slash_cleaner(detail_item if detail_item else url)))