Merge pull request #301 from dalf/https

engines: use https when possible
This commit is contained in:
Adam Tauber 2015-04-26 13:37:11 -04:00
commit ad8611c755
8 changed files with 9 additions and 9 deletions

View file

@ -26,7 +26,7 @@ safesearch = True
# search-url # search-url
base_url = 'https://www.bing.com/' base_url = 'https://www.bing.com/'
search_string = 'images/search?{query}&count=10&first={offset}' search_string = 'images/search?{query}&count=10&first={offset}'
thumb_url = "http://ts1.mm.bing.net/th?id={ihk}" thumb_url = "http://ts1.mm.bing.net/th?id={ihk}" # no https, bad certificate
# safesearch definitions # safesearch definitions
safesearch_types = {2: 'STRICT', safesearch_types = {2: 'STRICT',

View file

@ -2,7 +2,7 @@ from datetime import datetime
import re import re
categories = [] categories = []
url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s={query}=X' url = 'https://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s={query}=X'
weight = 100 weight = 100
parser_re = re.compile(r'^\W*(\d+(?:\.\d+)?)\W*([a-z]{3})\W*(?:in)?\W*([a-z]{3})\W*$', re.I) # noqa parser_re = re.compile(r'^\W*(\d+(?:\.\d+)?)\W*([a-z]{3})\W*(?:in)?\W*([a-z]{3})\W*$', re.I) # noqa
@ -44,7 +44,7 @@ def response(resp):
) )
now_date = datetime.now().strftime('%Y%m%d') now_date = datetime.now().strftime('%Y%m%d')
url = 'http://finance.yahoo.com/currency/converter-results/{0}/{1}-{2}-to-{3}.html' # noqa url = 'https://finance.yahoo.com/currency/converter-results/{0}/{1}-{2}-to-{3}.html' # noqa
url = url.format( url = url.format(
now_date, now_date,
resp.search_params['ammount'], resp.search_params['ammount'],

View file

@ -17,7 +17,7 @@ categories = ['music']
paging = True paging = True
# search-url # search-url
url = 'http://api.mixcloud.com/' url = 'https://api.mixcloud.com/'
search_url = url + 'search/?{query}&type=cloudcast&limit=10&offset={offset}' search_url = url + 'search/?{query}&type=cloudcast&limit=10&offset={offset}'
embedded_url = '<iframe scrolling="no" frameborder="0" allowTransparency="true" ' +\ embedded_url = '<iframe scrolling="no" frameborder="0" allowTransparency="true" ' +\

View file

@ -19,7 +19,7 @@ categories = ['it']
paging = True paging = True
# search-url # search-url
url = 'http://stackoverflow.com/' url = 'https://stackoverflow.com/'
search_url = url+'search?{query}&page={pageno}' search_url = url+'search?{query}&page={pageno}'
# specific xpath variables # specific xpath variables

View file

@ -23,7 +23,7 @@ categories = ['videos']
paging = True paging = True
# search-url # search-url
base_url = 'http://vimeo.com' base_url = 'https://vimeo.com'
search_url = base_url + '/search/page:{pageno}?{query}' search_url = base_url + '/search/page:{pageno}?{query}'
# specific xpath variables # specific xpath variables

View file

@ -40,5 +40,5 @@ class TestCurrencyConvertEngine(SearxTestCase):
self.assertEqual(len(results), 1) self.assertEqual(len(results), 1)
self.assertEqual(results[0]['answer'], '10 EUR = 5.0 USD (1 EUR = 0.5 USD)') self.assertEqual(results[0]['answer'], '10 EUR = 5.0 USD (1 EUR = 0.5 USD)')
now_date = datetime.now().strftime('%Y%m%d') now_date = datetime.now().strftime('%Y%m%d')
self.assertEqual(results[0]['url'], 'http://finance.yahoo.com/currency/converter-results/' + self.assertEqual(results[0]['url'], 'https://finance.yahoo.com/currency/converter-results/' +
now_date + '/10-eur-to-usd.html') now_date + '/10-eur-to-usd.html')

View file

@ -64,7 +64,7 @@ class TestStackoverflowEngine(SearxTestCase):
self.assertEqual(type(results), list) self.assertEqual(type(results), list)
self.assertEqual(len(results), 1) self.assertEqual(len(results), 1)
self.assertEqual(results[0]['title'], 'This is the title') self.assertEqual(results[0]['title'], 'This is the title')
self.assertEqual(results[0]['url'], 'http://stackoverflow.com/questions/this.is.the.url') self.assertEqual(results[0]['url'], 'https://stackoverflow.com/questions/this.is.the.url')
self.assertEqual(results[0]['content'], 'This is the content') self.assertEqual(results[0]['content'], 'This is the content')
html = """ html = """

View file

@ -52,7 +52,7 @@ class TestVimeoEngine(SearxTestCase):
self.assertEqual(type(results), list) self.assertEqual(type(results), list)
self.assertEqual(len(results), 1) self.assertEqual(len(results), 1)
self.assertEqual(results[0]['title'], 'This is the title') self.assertEqual(results[0]['title'], 'This is the title')
self.assertEqual(results[0]['url'], 'http://vimeo.com/videoid') self.assertEqual(results[0]['url'], 'https://vimeo.com/videoid')
self.assertEqual(results[0]['content'], '') self.assertEqual(results[0]['content'], '')
self.assertEqual(results[0]['thumbnail'], 'http://image.url.webp') self.assertEqual(results[0]['thumbnail'], 'http://image.url.webp')
self.assertIn('/videoid', results[0]['embedded']) self.assertIn('/videoid', results[0]['embedded'])