summaryrefslogtreecommitdiff
path: root/searx/engines/deviantart.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-05-02 13:36:00 -0400
committerAdam Tauber <asciimoo@gmail.com>2015-05-02 13:36:00 -0400
commit59a65d0bdc98a76f03235055f214747f699923a9 (patch)
treed40cd40f1c2f96e44027b619171a0e78cf256a45 /searx/engines/deviantart.py
parent01de1c6f7808f45698c2207ae1f1b73c1132b088 (diff)
parent59ee040424ccdef51f3616ed6487522bdaa44f3f (diff)
Merge pull request #305 from dalf/https_again
[enh] reduce the number of http outgoing connections.
Diffstat (limited to 'searx/engines/deviantart.py')
-rw-r--r--searx/engines/deviantart.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py
index 4198e8c76..43cd8bbce 100644
--- a/searx/engines/deviantart.py
+++ b/searx/engines/deviantart.py
@@ -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,