From 82b97f2b0e12eb80b6b20e7c8e52178d5d84d98a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Feb 2017 14:43:24 +0530 Subject: [PATCH] More http -> https --- src/calibre/gui2/store/stores/archive_org_plugin.py | 11 +++++------ src/calibre/gui2/store/stores/google_books_plugin.py | 7 +++---- src/calibre/gui2/store/stores/smashwords_plugin.py | 9 +++++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/calibre/gui2/store/stores/archive_org_plugin.py b/src/calibre/gui2/store/stores/archive_org_plugin.py index bd425da928..28c677746a 100644 --- a/src/calibre/gui2/store/stores/archive_org_plugin.py +++ b/src/calibre/gui2/store/stores/archive_org_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, John Schember ' @@ -14,15 +14,14 @@ from calibre.gui2.store.search_result import SearchResult class ArchiveOrgStore(BasicStoreConfig, OpenSearchOPDSStore): - open_search_url = 'http://bookserver.archive.org/catalog/opensearch.xml' - web_url = 'http://www.archive.org/details/texts' + open_search_url = 'https://bookserver.archive.org/catalog/opensearch.xml' + web_url = 'https://www.archive.org/details/texts' - # http://bookserver.archive.org/catalog/ + # https://bookserver.archive.org/catalog/ def search(self, query, max_results=10, timeout=60): for s in OpenSearchOPDSStore.search(self, query, max_results, timeout): - s.detail_item = 'http://www.archive.org/details/' + s.detail_item.split(':')[-1] + s.detail_item = 'https://www.archive.org/details/' + s.detail_item.split(':')[-1] s.price = '$0.00' s.drm = SearchResult.DRM_UNLOCKED yield s - diff --git a/src/calibre/gui2/store/stores/google_books_plugin.py b/src/calibre/gui2/store/stores/google_books_plugin.py index 23a1099458..c16fca163f 100644 --- a/src/calibre/gui2/store/stores/google_books_plugin.py +++ b/src/calibre/gui2/store/stores/google_books_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, John Schember ' @@ -25,7 +25,7 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog class GoogleBooksStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): - url = 'http://books.google.com/books' + url = 'https://books.google.com/books' if external or self.config.get('open_external', False): open_url(QUrl(url_slash_cleaner(detail_item if detail_item else url))) else: @@ -35,7 +35,7 @@ class GoogleBooksStore(BasicStoreConfig, StorePlugin): d.exec_() def search(self, query, max_results=10, timeout=60): - url = 'http://www.google.com/search?tbm=bks&q=' + urllib.quote_plus(query) + url = 'https://www.google.com/search?tbm=bks&q=' + urllib.quote_plus(query) br = browser() @@ -90,4 +90,3 @@ class GoogleBooksStore(BasicStoreConfig, StorePlugin): search_result.formats = _('Unknown') return True - diff --git a/src/calibre/gui2/store/stores/smashwords_plugin.py b/src/calibre/gui2/store/stores/smashwords_plugin.py index 7e640248d8..9ccb4c906e 100644 --- a/src/calibre/gui2/store/stores/smashwords_plugin.py +++ b/src/calibre/gui2/store/stores/smashwords_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, John Schember ' @@ -25,7 +25,7 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog def search(query, max_results=10, timeout=60): - url = 'http://www.smashwords.com/books/search?query=' + urllib2.quote(query) + url = 'https://www.smashwords.com/books/search?query=' + urllib2.quote(query) br = browser() @@ -76,7 +76,7 @@ def search(query, max_results=10, timeout=60): class SmashwordsStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): - url = 'http://www.smashwords.com/' + url = 'https://www.smashwords.com/' aff_id = '?ref=usernone' # Use Kovid's affiliate id 30% of the time. @@ -101,7 +101,7 @@ class SmashwordsStore(BasicStoreConfig, StorePlugin): yield a def get_details(self, search_result, timeout): - url = 'http://www.smashwords.com/' + url = 'https://www.smashwords.com/' br = browser() with closing(br.open(url + search_result.detail_item, timeout=timeout)) as nf: @@ -109,6 +109,7 @@ class SmashwordsStore(BasicStoreConfig, StorePlugin): search_result.formats = ', '.join(list(set(idata.xpath('//p//abbr//text()')))) return True + if __name__ == '__main__': import sys for r in search(sys.argv[-1]):