浏览代码

[mod] https in deezer engine - closes #262

Adam Tauber 10 年前
父节点
当前提交
6379595e1f
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6
    2
      searx/engines/deezer.py

+ 6
- 2
searx/engines/deezer.py 查看文件

@@ -16,11 +16,11 @@ categories = ['music']
16 16
 paging = True
17 17
 
18 18
 # search-url
19
-url = 'http://api.deezer.com/'
19
+url = 'https://api.deezer.com/'
20 20
 search_url = url + 'search?{query}&index={offset}'
21 21
 
22 22
 embedded_url = '<iframe scrolling="no" frameborder="0" allowTransparency="true" ' +\
23
-    'data-src="http://www.deezer.com/plugins/player?type=tracks&id={audioid}" ' +\
23
+    'data-src="https://www.deezer.com/plugins/player?type=tracks&id={audioid}" ' +\
24 24
     'width="540" height="80"></iframe>'
25 25
 
26 26
 
@@ -45,6 +45,10 @@ def response(resp):
45 45
         if result['type'] == 'track':
46 46
             title = result['title']
47 47
             url = result['link']
48
+
49
+            if url.startswith('http://'):
50
+                url = 'https' + url[4:]
51
+
48 52
             content = result['artist']['name'] +\
49 53
                 " &bull; " +\
50 54
                 result['album']['title'] +\