mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 18:42:33 +02:00
Merge pull request #305 from dalf/https_again
[enh] reduce the number of http outgoing connections.
This commit is contained in:
commit
59a65d0bdc
9 changed files with 22 additions and 7 deletions
|
@ -60,6 +60,9 @@ def response(resp):
|
|||
publishedDate = datetime.fromtimestamp(res['created_time'], None)
|
||||
embedded = embedded_url.format(videoid=res['id'])
|
||||
|
||||
# http to https
|
||||
thumbnail = thumbnail.replace("http://", "https://")
|
||||
|
||||
results.append({'template': 'videos.html',
|
||||
'url': url,
|
||||
'title': title,
|
||||
|
|
|
@ -22,7 +22,7 @@ paging = True
|
|||
|
||||
# search-url
|
||||
base_url = 'https://www.deviantart.com/'
|
||||
search_url = base_url+'search?offset={offset}&{query}'
|
||||
search_url = base_url+'browse/all/?offset={offset}&{query}'
|
||||
|
||||
|
||||
# do search-request
|
||||
|
@ -56,6 +56,12 @@ def response(resp):
|
|||
thumbnail_src = link.xpath('.//img')[0].attrib.get('src')
|
||||
img_src = regex.sub('/', thumbnail_src)
|
||||
|
||||
# http to https, remove domain sharding
|
||||
thumbnail_src = re.sub(r"https?://(th|fc)\d+.", "https://th01.", thumbnail_src)
|
||||
thumbnail_src = re.sub(r"http://", "https://", thumbnail_src)
|
||||
|
||||
url = re.sub(r"http://(.*)\.deviantart\.com/", "https://\\1.deviantart.com/", url)
|
||||
|
||||
# append result
|
||||
results.append({'url': url,
|
||||
'title': title,
|
||||
|
|
|
@ -58,6 +58,9 @@ def response(resp):
|
|||
pubdate = result.xpath(pubdate_xpath)[0].attrib.get('datetime')
|
||||
publishedDate = parser.parse(pubdate)
|
||||
|
||||
# http to https
|
||||
thumbnail = thumbnail.replace("http://static.digg.com", "https://static.digg.com")
|
||||
|
||||
# append result
|
||||
results.append({'url': url,
|
||||
'title': title,
|
||||
|
|
|
@ -17,7 +17,7 @@ categories = ['general']
|
|||
paging = True
|
||||
number_of_results = 5
|
||||
|
||||
# search-url
|
||||
# search-url, invalid HTTPS certificate
|
||||
base_url = 'http://gigablast.com/'
|
||||
search_string = 'search?{query}&n={number_of_results}&s={offset}&xml=1&qh=0'
|
||||
|
||||
|
|
|
@ -56,6 +56,9 @@ def response(resp):
|
|||
continue
|
||||
thumbnail_src = result['tbUrl']
|
||||
|
||||
# http to https
|
||||
thumbnail_src = thumbnail_src.replace("http://", "https://")
|
||||
|
||||
# append result
|
||||
results.append({'url': href,
|
||||
'title': title,
|
||||
|
|
|
@ -19,7 +19,7 @@ import re
|
|||
categories = ['images']
|
||||
paging = False
|
||||
|
||||
# search-url
|
||||
# search-url, no HTTPS (there is a valid certificate for https://api2.1x.com/ )
|
||||
base_url = 'http://1x.com'
|
||||
search_url = base_url+'/backend/search.php?{query}'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue