From 5f8a7c04f775ed0f0c49c9a5a58d4dc57537a96b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 8 Feb 2017 16:38:00 +0530 Subject: [PATCH] Some more http->https --- src/calibre/ebooks/metadata/sources/douban.py | 10 +++++----- src/calibre/ebooks/metadata/sources/edelweiss.py | 5 +++-- src/calibre/ebooks/metadata/sources/identify.py | 12 ++++++------ src/calibre/ebooks/metadata/sources/isbndb.py | 6 +++--- src/calibre/ebooks/metadata/sources/openlibrary.py | 3 +-- src/calibre/ebooks/metadata/sources/overdrive.py | 12 ++++++------ src/calibre/ebooks/metadata/sources/ozon.py | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/douban.py b/src/calibre/ebooks/metadata/sources/douban.py index 546c0216ea..52fc678d16 100644 --- a/src/calibre/ebooks/metadata/sources/douban.py +++ b/src/calibre/ebooks/metadata/sources/douban.py @@ -165,7 +165,7 @@ class Douban(Source): cached_cover_url_is_reliable = True DOUBAN_API_KEY = '0bd1672394eb1ebf2374356abec15c3d' - DOUBAN_BOOK_URL = 'http://book.douban.com/subject/%s/' + DOUBAN_BOOK_URL = 'https://book.douban.com/subject/%s/' def get_book_url(self, identifiers): # {{{ db = identifiers.get('douban', None) @@ -175,9 +175,9 @@ class Douban(Source): def create_query(self, log, title=None, authors=None, identifiers={}): # {{{ from urllib import urlencode - SEARCH_URL = 'http://api.douban.com/book/subjects?' - ISBN_URL = 'http://api.douban.com/book/subject/isbn/' - SUBJECT_URL = 'http://api.douban.com/book/subject/' + SEARCH_URL = 'https://api.douban.com/book/subjects?' + ISBN_URL = 'https://api.douban.com/book/subject/isbn/' + SUBJECT_URL = 'https://api.douban.com/book/subject/' q = '' t = None @@ -339,6 +339,7 @@ class Douban(Source): return None # }}} + if __name__ == '__main__': # tests {{{ # To run these test use: calibre-debug -e src/calibre/ebooks/metadata/sources/douban.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, @@ -360,4 +361,3 @@ if __name__ == '__main__': # tests {{{ ), ]) # }}} - diff --git a/src/calibre/ebooks/metadata/sources/edelweiss.py b/src/calibre/ebooks/metadata/sources/edelweiss.py index a856aea61a..62af266e78 100644 --- a/src/calibre/ebooks/metadata/sources/edelweiss.py +++ b/src/calibre/ebooks/metadata/sources/edelweiss.py @@ -182,7 +182,7 @@ class Edelweiss(Source): def _get_book_url(self, sku): if sku: - return 'http://edelweiss.abovethetreeline.com/ProductDetailPage.aspx?sku=%s'%sku + return 'https://edelweiss.abovethetreeline.com/ProductDetailPage.aspx?sku=%s'%sku def get_book_url(self, identifiers): # {{{ sku = identifiers.get('edelweiss', None) @@ -202,7 +202,7 @@ class Edelweiss(Source): def create_query(self, log, title=None, authors=None, identifiers={}): from urllib import urlencode - BASE_URL = 'http://edelweiss.abovethetreeline.com/Browse.aspx?source=catalog&rg=4187&group=browse&pg=0&' + BASE_URL = 'https://edelweiss.abovethetreeline.com/Browse.aspx?source=catalog&rg=4187&group=browse&pg=0&' params = { 'browseType':'title', 'startIndex':0, 'savecook':1, 'sord':20, 'secSord':20, 'tertSord':20, } @@ -359,6 +359,7 @@ class Edelweiss(Source): log.exception('Failed to download cover from:', cached_url) # }}} + if __name__ == '__main__': from calibre.ebooks.metadata.sources.test import ( test_identify_plugin, title_test, authors_test, comments_test, pubdate_test) diff --git a/src/calibre/ebooks/metadata/sources/identify.py b/src/calibre/ebooks/metadata/sources/identify.py index f787d7d0c5..f0246b012c 100644 --- a/src/calibre/ebooks/metadata/sources/identify.py +++ b/src/calibre/ebooks/metadata/sources/identify.py @@ -555,23 +555,23 @@ def urls_from_identifiers(identifiers): # {{{ isbn = identifiers.get('isbn', None) if isbn: ans.append((isbn, 'isbn', isbn, - 'http://www.worldcat.org/isbn/'+isbn)) + 'https://www.worldcat.org/isbn/'+isbn)) doi = identifiers.get('doi', None) if doi: ans.append(('DOI', 'doi', doi, - 'http://dx.doi.org/'+doi)) + 'https://dx.doi.org/'+doi)) arxiv = identifiers.get('arxiv', None) if arxiv: ans.append(('arXiv', 'arxiv', arxiv, - 'http://arxiv.org/abs/'+arxiv)) + 'https://arxiv.org/abs/'+arxiv)) oclc = identifiers.get('oclc', None) if oclc: ans.append(('OCLC', 'oclc', oclc, - 'http://www.worldcat.org/oclc/'+oclc)) + 'https://www.worldcat.org/oclc/'+oclc)) issn = check_issn(identifiers.get('issn', None)) if issn: ans.append((issn, 'issn', issn, - 'http://www.worldcat.org/issn/'+issn)) + 'https://www.worldcat.org/issn/'+issn)) for k, url in identifiers.iteritems(): if url and re.match(r'ur[il]\d*$', k) is not None: url = url[:8].replace('|', ':') + url[8:].replace('|', ',') @@ -582,6 +582,7 @@ def urls_from_identifiers(identifiers): # {{{ return ans # }}} + if __name__ == '__main__': # tests {{{ # To run these test use: calibre-debug -e # src/calibre/ebooks/metadata/sources/identify.py @@ -628,4 +629,3 @@ if __name__ == '__main__': # tests {{{ # test_identify(tests[1:2]) test_identify(tests) # }}} - diff --git a/src/calibre/ebooks/metadata/sources/isbndb.py b/src/calibre/ebooks/metadata/sources/isbndb.py index d1c5ccc6a8..6a94eecc71 100644 --- a/src/calibre/ebooks/metadata/sources/isbndb.py +++ b/src/calibre/ebooks/metadata/sources/isbndb.py @@ -13,7 +13,7 @@ from calibre.ebooks.metadata.sources.base import Source, Option from calibre.utils.icu import lower from calibre.ebooks.metadata.book.base import Metadata -BASE_URL = 'http://isbndb.com/api/books.xml?access_key=%s&page_number=1&results=subjects,authors,texts&' +BASE_URL = 'https://isbndb.com/api/books.xml?access_key=%s&page_number=1&results=subjects,authors,texts&' class ISBNDB(Source): @@ -37,7 +37,7 @@ class ISBNDB(Source): config_help_message = ('

'+_('To use metadata from isbndb.com you must sign' ' up for a free account and get an isbndb key and enter it below.' ' Instructions to get the key are ' - 'here.')) % 'http://isbndb.com/api/v1/docs/keys' + 'here.')) % 'https://isbndb.com/api/v1/docs/keys' def __init__(self, *args, **kwargs): Source.__init__(self, *args, **kwargs) @@ -221,6 +221,7 @@ class ISBNDB(Source): return candidates # }}} + if __name__ == '__main__': # To run these test use: # calibre-debug -e src/calibre/ebooks/metadata/sources/isbndb.py @@ -242,4 +243,3 @@ if __name__ == '__main__': [title_test('Flatland', exact=False)] ), ]) - diff --git a/src/calibre/ebooks/metadata/sources/openlibrary.py b/src/calibre/ebooks/metadata/sources/openlibrary.py index 66c6089170..9390390e5e 100644 --- a/src/calibre/ebooks/metadata/sources/openlibrary.py +++ b/src/calibre/ebooks/metadata/sources/openlibrary.py @@ -17,7 +17,7 @@ class OpenLibrary(Source): capabilities = frozenset(['cover']) - OPENLIBRARY = 'http://covers.openlibrary.org/b/isbn/%s-L.jpg?default=false' + OPENLIBRARY = 'https://covers.openlibrary.org/b/isbn/%s-L.jpg?default=false' def download_cover(self, log, result_queue, abort, title=None, authors=None, identifiers={}, timeout=30, get_best_cover=False): @@ -33,4 +33,3 @@ class OpenLibrary(Source): log.error('No cover for ISBN: %r found'%isbn) else: log.exception('Failed to download cover for ISBN:', isbn) - diff --git a/src/calibre/ebooks/metadata/sources/overdrive.py b/src/calibre/ebooks/metadata/sources/overdrive.py index a7e788ba2e..86b7b020f2 100755 --- a/src/calibre/ebooks/metadata/sources/overdrive.py +++ b/src/calibre/ebooks/metadata/sources/overdrive.py @@ -20,7 +20,7 @@ from calibre.ebooks.metadata.book.base import Metadata ovrdrv_data_cache = {} cache_lock = RLock() -base_url = 'http://search.overdrive.com/' +base_url = 'https://search.overdrive.com/' class OverDrive(Source): @@ -134,11 +134,11 @@ class OverDrive(Source): def get_base_referer(self): # to be used for passing referrer headers to cover download choices = [ - 'http://overdrive.chipublib.org/82DC601D-7DDE-4212-B43A-09D821935B01/10/375/en/', - 'http://emedia.clevnet.org/9D321DAD-EC0D-490D-BFD8-64AE2C96ECA8/10/241/en/', - 'http://singapore.lib.overdrive.com/F11D55BE-A917-4D63-8111-318E88B29740/10/382/en/', - 'http://ebooks.nypl.org/20E48048-A377-4520-BC43-F8729A42A424/10/257/en/', - 'http://spl.lib.overdrive.com/5875E082-4CB2-4689-9426-8509F354AFEF/10/335/en/' + 'https://overdrive.chipublib.org/82DC601D-7DDE-4212-B43A-09D821935B01/10/375/en/', + 'https://emedia.clevnet.org/9D321DAD-EC0D-490D-BFD8-64AE2C96ECA8/10/241/en/', + 'https://singapore.lib.overdrive.com/F11D55BE-A917-4D63-8111-318E88B29740/10/382/en/', + 'https://ebooks.nypl.org/20E48048-A377-4520-BC43-F8729A42A424/10/257/en/', + 'https://spl.lib.overdrive.com/5875E082-4CB2-4689-9426-8509F354AFEF/10/335/en/' ] return choices[random.randint(0, len(choices)-1)] diff --git a/src/calibre/ebooks/metadata/sources/ozon.py b/src/calibre/ebooks/metadata/sources/ozon.py index 5a42f5aa40..051f3da709 100644 --- a/src/calibre/ebooks/metadata/sources/ozon.py +++ b/src/calibre/ebooks/metadata/sources/ozon.py @@ -35,7 +35,7 @@ class Ozon(Source): supports_gzip_transfer_encoding = True has_html_comments = True - ozon_url = 'http://www.ozon.ru' + ozon_url = 'https://www.ozon.ru' # match any ISBN10/13. From "Regular Expressions Cookbook" isbnPattern = r'(?:ISBN(?:-1[03])?:? )?(?=[-0-9 ]{17}|' \