Bläddra i källkod

Merge https://github.com/asciimoo/searx into template_oscar

Conflicts:
	searx/translations/de/LC_MESSAGES/messages.po
	searx/translations/en/LC_MESSAGES/messages.po
	searx/translations/es/LC_MESSAGES/messages.po
	searx/translations/fr/LC_MESSAGES/messages.po
	searx/translations/hu/LC_MESSAGES/messages.po
	searx/translations/it/LC_MESSAGES/messages.po
	searx/translations/nl/LC_MESSAGES/messages.po
	searx/webapp.py
Thomas Pointhuber 10 år sedan
förälder
incheckning
0e1035eac1
70 ändrade filer med 5607 tillägg och 329 borttagningar
  1. 1
    0
      AUTHORS.rst
  2. 12
    1
      searx/__init__.py
  3. 6
    5
      searx/engines/__init__.py
  4. 17
    10
      searx/engines/duckduckgo_definitions.py
  5. 108
    0
      searx/engines/faroo.py
  6. 42
    19
      searx/engines/wikidata.py
  7. 7
    6
      searx/engines/yahoo_news.py
  8. 1
    1
      searx/engines/youtube.py
  9. 139
    8
      searx/https_rewrite.py
  10. 17
    0
      searx/https_rules/00README
  11. 56
    0
      searx/https_rules/Bing.xml
  12. 69
    0
      searx/https_rules/Dailymotion.xml
  13. 53
    0
      searx/https_rules/Deviantart.xml
  14. 38
    0
      searx/https_rules/DuckDuckGo.xml
  15. 44
    0
      searx/https_rules/Flickr.xml
  16. 11
    0
      searx/https_rules/Github-Pages.xml
  17. 94
    0
      searx/https_rules/Github.xml
  18. 26
    0
      searx/https_rules/Google-mismatches.xml
  19. 14
    0
      searx/https_rules/Google.org.xml
  20. 143
    0
      searx/https_rules/GoogleAPIs.xml
  21. 6
    0
      searx/https_rules/GoogleCanada.xml
  22. 65
    0
      searx/https_rules/GoogleImages.xml
  23. 78
    0
      searx/https_rules/GoogleMainSearch.xml
  24. 67
    0
      searx/https_rules/GoogleMaps.xml
  25. 6
    0
      searx/https_rules/GoogleMelange.xml
  26. 135
    0
      searx/https_rules/GoogleSearch.xml
  27. 345
    0
      searx/https_rules/GoogleServices.xml
  28. 28
    0
      searx/https_rules/GoogleShopping.xml
  29. 7
    0
      searx/https_rules/GoogleSorry.xml
  30. 8
    0
      searx/https_rules/GoogleTranslate.xml
  31. 83
    0
      searx/https_rules/GoogleVideos.xml
  32. 17
    0
      searx/https_rules/GoogleWatchBlog.xml
  33. 21
    0
      searx/https_rules/Google_App_Engine.xml
  34. 16
    0
      searx/https_rules/Googleplex.com.xml
  35. 15
    0
      searx/https_rules/OpenStreetMap.xml
  36. 14
    0
      searx/https_rules/Rawgithub.com.xml
  37. 101
    0
      searx/https_rules/Soundcloud.xml
  38. 36
    0
      searx/https_rules/ThePirateBay.xml
  39. 18
    0
      searx/https_rules/Torproject.xml
  40. 169
    0
      searx/https_rules/Twitter.xml
  41. 75
    0
      searx/https_rules/Vimeo.xml
  42. 13
    0
      searx/https_rules/WikiLeaks.xml
  43. 107
    0
      searx/https_rules/Wikimedia.xml
  44. 2450
    0
      searx/https_rules/Yahoo.xml
  45. 46
    0
      searx/https_rules/YouTube.xml
  46. 23
    20
      searx/query.py
  47. 72
    42
      searx/search.py
  48. 7
    0
      searx/settings.yml
  49. 3
    0
      searx/settings_robot.yml
  50. 1
    1
      searx/static/default/css/style.css
  51. 8
    7
      searx/static/default/less/style.less
  52. Binär
      searx/translations/de/LC_MESSAGES/messages.mo
  53. 37
    33
      searx/translations/de/LC_MESSAGES/messages.po
  54. Binär
      searx/translations/en/LC_MESSAGES/messages.mo
  55. 22
    18
      searx/translations/en/LC_MESSAGES/messages.po
  56. Binär
      searx/translations/es/LC_MESSAGES/messages.mo
  57. 32
    29
      searx/translations/es/LC_MESSAGES/messages.po
  58. Binär
      searx/translations/fr/LC_MESSAGES/messages.mo
  59. 32
    29
      searx/translations/fr/LC_MESSAGES/messages.po
  60. Binär
      searx/translations/hu/LC_MESSAGES/messages.mo
  61. 37
    31
      searx/translations/hu/LC_MESSAGES/messages.po
  62. Binär
      searx/translations/it/LC_MESSAGES/messages.mo
  63. 30
    27
      searx/translations/it/LC_MESSAGES/messages.po
  64. Binär
      searx/translations/ja/LC_MESSAGES/messages.mo
  65. 377
    0
      searx/translations/ja/LC_MESSAGES/messages.po
  66. Binär
      searx/translations/nl/LC_MESSAGES/messages.mo
  67. 29
    26
      searx/translations/nl/LC_MESSAGES/messages.po
  68. 7
    3
      searx/utils.py
  69. 64
    12
      searx/webapp.py
  70. 2
    1
      setup.py

+ 1
- 0
AUTHORS.rst Visa fil

@@ -26,3 +26,4 @@ generally made searx better:
26 26
 - dp
27 27
 - Martin Zimmermann
28 28
 - @courgette
29
+- @kernc

+ 12
- 1
searx/__init__.py Visa fil

@@ -17,6 +17,7 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
17 17
 
18 18
 from os import environ
19 19
 from os.path import realpath, dirname, join, abspath
20
+from searx.https_rewrite import load_https_rules
20 21
 try:
21 22
     from yaml import load
22 23
 except:
@@ -27,14 +28,24 @@ except:
27 28
 searx_dir = abspath(dirname(__file__))
28 29
 engine_dir = dirname(realpath(__file__))
29 30
 
30
-# if possible set path to settings using the enviroment variable SEARX_SETTINGS_PATH
31
+# if possible set path to settings using the
32
+# enviroment variable SEARX_SETTINGS_PATH
31 33
 if 'SEARX_SETTINGS_PATH' in environ:
32 34
     settings_path = environ['SEARX_SETTINGS_PATH']
33 35
 # otherwise using default path
34 36
 else:
35 37
     settings_path = join(searx_dir, 'settings.yml')
36 38
 
39
+if 'SEARX_HTTPS_REWRITE_PATH' in environ:
40
+    https_rewrite_path = environ['SEARX_HTTPS_REWRITE_PATH']
41
+else:
42
+    https_rewrite_path = join(searx_dir, 'https_rules')
37 43
 
38 44
 # load settings
39 45
 with open(settings_path) as settings_yaml:
40 46
     settings = load(settings_yaml)
47
+
48
+# load https rules only if https rewrite is enabled
49
+if settings.get('server', {}).get('https_rewrite'):
50
+    # loade https rules
51
+    load_https_rules(https_rewrite_path)

+ 6
- 5
searx/engines/__init__.py Visa fil

@@ -41,7 +41,7 @@ def load_module(filename):
41 41
     module.name = modname
42 42
     return module
43 43
 
44
-if not 'engines' in settings or not settings['engines']:
44
+if 'engines' not in settings or not settings['engines']:
45 45
     print '[E] Error no engines found. Edit your settings.yml'
46 46
     exit(2)
47 47
 
@@ -68,15 +68,15 @@ for engine_data in settings['engines']:
68 68
         engine.categories = ['general']
69 69
 
70 70
     if not hasattr(engine, 'language_support'):
71
-        #engine.language_support = False
71
+        # engine.language_support = False
72 72
         engine.language_support = True
73 73
 
74 74
     if not hasattr(engine, 'timeout'):
75
-        #engine.language_support = False
75
+        # engine.language_support = False
76 76
         engine.timeout = settings['server']['request_timeout']
77 77
 
78 78
     if not hasattr(engine, 'shortcut'):
79
-        #engine.shortcut = '''
79
+        # engine.shortcut = '''
80 80
         engine.shortcut = ''
81 81
 
82 82
     # checking required variables
@@ -161,7 +161,8 @@ def get_engines_stats():
161 161
 
162 162
     for engine in scores_per_result:
163 163
         if max_score_per_result:
164
-            engine['percentage'] = int(engine['avg'] / max_score_per_result * 100)
164
+            engine['percentage'] = int(engine['avg']
165
+                                       / max_score_per_result * 100)
165 166
         else:
166 167
             engine['percentage'] = 0
167 168
 

+ 17
- 10
searx/engines/duckduckgo_definitions.py Visa fil

@@ -116,15 +116,22 @@ def response(resp):
116 116
 
117 117
     if len(heading)>0:
118 118
         # TODO get infobox.meta.value where .label='article_title'
119
-        results.append({
120
-               'infobox': heading,
121
-               'id': infobox_id,
122
-               'entity': entity,
123
-               'content': content,
124
-               'img_src' : image,
125
-               'attributes': attributes,
126
-               'urls': urls,
127
-               'relatedTopics': relatedTopics
128
-               })
119
+        if image==None and len(attributes)==0 and len(urls)==1 and len(relatedTopics)==0 and len(content)==0:
120
+            results.append({
121
+                    'url': urls[0]['url'],
122
+                    'title': heading,
123
+                    'content': content
124
+                    })
125
+        else:
126
+            results.append({
127
+                    'infobox': heading,
128
+                    'id': infobox_id,
129
+                    'entity': entity,
130
+                    'content': content,
131
+                    'img_src' : image,
132
+                    'attributes': attributes,
133
+                    'urls': urls,
134
+                    'relatedTopics': relatedTopics
135
+                    })
129 136
 
130 137
     return results

+ 108
- 0
searx/engines/faroo.py Visa fil

@@ -0,0 +1,108 @@
1
+## Faroo (Web, News)
2
+# 
3
+# @website     http://www.faroo.com
4
+# @provide-api yes (http://www.faroo.com/hp/api/api.html), require API-key
5
+# 
6
+# @using-api   yes
7
+# @results     JSON
8
+# @stable      yes
9
+# @parse       url, title, content, publishedDate, img_src
10
+
11
+from urllib import urlencode
12
+from json import loads
13
+import datetime
14
+from searx.utils import searx_useragent
15
+
16
+# engine dependent config
17
+categories = ['general', 'news']
18
+paging = True
19
+language_support = True
20
+number_of_results = 10
21
+api_key = None
22
+
23
+# search-url
24
+url = 'http://www.faroo.com/'
25
+search_url = url + 'api?{query}&start={offset}&length={number_of_results}&l={language}&src={categorie}&i=false&f=json&key={api_key}'
26
+
27
+search_category = {'general': 'web',                
28
+                'news': 'news'}
29
+
30
+# do search-request
31
+def request(query, params):
32
+    offset = (params['pageno']-1) * number_of_results + 1
33
+    categorie = search_category.get(params['category'], 'web')
34
+
35
+    if params['language'] == 'all':
36
+        language = 'en'
37
+    else:
38
+        language = params['language'].split('_')[0]
39
+
40
+    # skip, if language is not supported
41
+    if language != 'en' and\
42
+       language != 'de' and\
43
+       language != 'zh':
44
+        return params
45
+
46
+    params['url'] = search_url.format(offset=offset,
47
+                                      number_of_results=number_of_results,
48
+                                      query=urlencode({'q': query}),
49
+                                      language=language,
50
+                                      categorie=categorie,
51
+                                      api_key=api_key )
52
+
53
+    # using searx User-Agent
54
+    params['headers']['User-Agent'] = searx_useragent()
55
+
56
+    return params
57
+
58
+
59
+# get response from search-request
60
+def response(resp):
61
+    # HTTP-Code 401: api-key is not valide
62
+    if resp.status_code == 401:
63
+        raise Exception("API key is not valide")
64
+        return []
65
+
66
+    # HTTP-Code 429: rate limit exceeded
67
+    if resp.status_code == 429:
68
+        raise Exception("rate limit has been exceeded!")
69
+        return []
70
+
71
+    results = []
72
+
73
+    search_res = loads(resp.text)
74
+
75
+    # return empty array if there are no results
76
+    if not search_res.get('results', {}):
77
+        return []
78
+
79
+    # parse results
80
+    for result in search_res['results']:
81
+        if result['news']:
82
+            # timestamp (how many milliseconds have passed between now and the beginning of 1970)
83
+            publishedDate = datetime.datetime.fromtimestamp(result['date']/1000.0)
84
+
85
+            # append news result
86
+            results.append({'url': result['url'],
87
+                            'title': result['title'],
88
+                            'publishedDate': publishedDate,
89
+                            'content': result['kwic']})
90
+
91
+        else:
92
+            # append general result
93
+            # TODO, publishedDate correct?
94
+            results.append({'url': result['url'],
95
+                            'title': result['title'],
96
+                            'content': result['kwic']})
97
+
98
+        # append image result if image url is set
99
+        # TODO, show results with an image like in faroo
100
+        if result['iurl']:
101
+            results.append({'template': 'images.html',
102
+                            'url': result['url'],
103
+                            'title': result['title'],
104
+                            'content': result['kwic'],  
105
+                            'img_src': result['iurl']})
106
+
107
+    # return results
108
+    return results

+ 42
- 19
searx/engines/wikidata.py Visa fil

@@ -2,7 +2,7 @@ import json
2 2
 from requests import get
3 3
 from urllib import urlencode
4 4
 
5
-resultCount=2
5
+resultCount=1
6 6
 urlSearch = 'https://www.wikidata.org/w/api.php?action=query&list=search&format=json&srnamespace=0&srprop=sectiontitle&{query}'
7 7
 urlDetail = 'https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&props=labels%7Cinfo%7Csitelinks%7Csitelinks%2Furls%7Cdescriptions%7Cclaims&{query}'
8 8
 urlMap = 'https://www.openstreetmap.org/?lat={latitude}&lon={longitude}&zoom={zoom}&layers=M'
@@ -33,17 +33,20 @@ def response(resp):
33 33
     return results
34 34
 
35 35
 def getDetail(jsonresponse, wikidata_id, language):
36
+    results = []
37
+    urls = []
38
+    attributes = []
39
+
36 40
     result = jsonresponse.get('entities', {}).get(wikidata_id, {})
37 41
 
38 42
     title = result.get('labels', {}).get(language, {}).get('value', None)
39 43
     if title == None:
40
-        title = result.get('labels', {}).get('en', {}).get('value', wikidata_id)
41
-    results = []
42
-    urls = []
43
-    attributes = []
44
+        title = result.get('labels', {}).get('en', {}).get('value', None)
45
+    if title == None:
46
+        return results
44 47
 
45
-    description = result.get('descriptions', {}).get(language, {}).get('value', '')
46
-    if description == '':
48
+    description = result.get('descriptions', {}).get(language, {}).get('value', None)
49
+    if description == None:
47 50
         description = result.get('descriptions', {}).get('en', {}).get('value', '')
48 51
 
49 52
     claims = result.get('claims', {})
@@ -52,10 +55,15 @@ def getDetail(jsonresponse, wikidata_id, language):
52 55
         urls.append({ 'title' : 'Official site', 'url': official_website })
53 56
         results.append({ 'title': title, 'url' : official_website })
54 57
 
58
+    wikipedia_link_count = 0
55 59
     if language != 'en':
56
-        add_url(urls, 'Wikipedia (' + language + ')', get_wikilink(result, language + 'wiki'))
60
+        wikipedia_link_count += add_url(urls, 'Wikipedia (' + language + ')', get_wikilink(result, language + 'wiki'))
57 61
     wikipedia_en_link = get_wikilink(result, 'enwiki')
58
-    add_url(urls, 'Wikipedia (en)', wikipedia_en_link)
62
+    wikipedia_link_count += add_url(urls, 'Wikipedia (en)', wikipedia_en_link)
63
+    if wikipedia_link_count == 0:
64
+        misc_language = get_wiki_firstlanguage(result, 'wiki')
65
+        if misc_language != None:
66
+            add_url(urls, 'Wikipedia (' + misc_language + ')', get_wikilink(result, misc_language + 'wiki'))
59 67
 
60 68
     if language != 'en':
61 69
         add_url(urls, 'Wiki voyage (' + language + ')', get_wikilink(result, language + 'wikivoyage'))
@@ -105,14 +113,20 @@ def getDetail(jsonresponse, wikidata_id, language):
105 113
     if date_of_death != None:
106 114
         attributes.append({'label' : 'Date of death', 'value' : date_of_death})
107 115
 
108
-
109
-    results.append({
110
-            'infobox' : title,
111
-            'id' : wikipedia_en_link,
112
-            'content' : description,
113
-            'attributes' : attributes,
114
-            'urls' : urls
115
-            })
116
+    if len(attributes)==0 and len(urls)==2 and len(description)==0:
117
+        results.append({
118
+                'url': urls[0]['url'],
119
+                'title': title,
120
+                'content': description
121
+                })
122
+    else:
123
+        results.append({
124
+                'infobox' : title,
125
+                'id' : wikipedia_en_link,
126
+                'content' : description,
127
+                'attributes' : attributes,
128
+                'urls' : urls
129
+                })
116 130
 
117 131
     return results
118 132
 
@@ -120,7 +134,9 @@ def getDetail(jsonresponse, wikidata_id, language):
120 134
 def add_url(urls, title, url):
121 135
     if url != None:
122 136
         urls.append({'title' : title, 'url' : url})
123
-
137
+        return 1
138
+    else:
139
+        return 0
124 140
 
125 141
 def get_mainsnak(claims, propertyName):
126 142
     propValue = claims.get(propertyName, {})
@@ -147,7 +163,8 @@ def get_string(claims, propertyName, defaultValue=None):
147 163
     if len(result) == 0:
148 164
         return defaultValue
149 165
     else:
150
-        return ', '.join(result)
166
+        #TODO handle multiple urls
167
+        return result[0]
151 168
 
152 169
 
153 170
 def get_time(claims, propertyName, defaultValue=None):
@@ -213,3 +230,9 @@ def get_wikilink(result, wikiid):
213 230
     elif url.startswith('//'):
214 231
         url = 'https:' + url
215 232
     return url
233
+
234
+def get_wiki_firstlanguage(result, wikipatternid):
235
+    for k in result.get('sitelinks', {}).keys():
236
+        if k.endswith(wikipatternid) and len(k)==(2+len(wikipatternid)):
237
+            return k[0:2]
238
+    return None

+ 7
- 6
searx/engines/yahoo_news.py Visa fil

@@ -1,8 +1,9 @@
1
-## Yahoo (News)
2
-# 
1
+# Yahoo (News)
2
+#
3 3
 # @website     https://news.yahoo.com
4
-# @provide-api yes (https://developer.yahoo.com/boss/search/), $0.80/1000 queries
5
-# 
4
+# @provide-api yes (https://developer.yahoo.com/boss/search/)
5
+#              $0.80/1000 queries
6
+#
6 7
 # @using-api   no (because pricing)
7 8
 # @results     HTML (using search portal)
8 9
 # @stable      no (HTML can change)
@@ -22,7 +23,7 @@ paging = True
22 23
 language_support = True
23 24
 
24 25
 # search-url
25
-search_url = 'https://news.search.yahoo.com/search?{query}&b={offset}&fl=1&vl=lang_{lang}'
26
+search_url = 'https://news.search.yahoo.com/search?{query}&b={offset}&fl=1&vl=lang_{lang}'  # noqa
26 27
 
27 28
 # specific xpath variables
28 29
 results_xpath = '//div[@class="res"]'
@@ -41,7 +42,7 @@ def request(query, params):
41 42
         language = 'en'
42 43
     else:
43 44
         language = params['language'].split('_')[0]
44
-    
45
+
45 46
     params['url'] = search_url.format(offset=offset,
46 47
                                       query=urlencode({'p': query}),
47 48
                                       lang=language)

+ 1
- 1
searx/engines/youtube.py Visa fil

@@ -13,7 +13,7 @@ from urllib import urlencode
13 13
 from dateutil import parser
14 14
 
15 15
 # engine dependent config
16
-categories = ['videos']
16
+categories = ['videos', 'music']
17 17
 paging = True
18 18
 language_support = True
19 19
 

+ 139
- 8
searx/https_rewrite.py Visa fil

@@ -1,14 +1,145 @@
1
+'''
2
+searx is free software: you can redistribute it and/or modify
3
+it under the terms of the GNU Affero General Public License as published by
4
+the Free Software Foundation, either version 3 of the License, or
5
+(at your option) any later version.
6
+
7
+searx is distributed in the hope that it will be useful,
8
+but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
+GNU Affero General Public License for more details.
11
+
12
+You should have received a copy of the GNU Affero General Public License
13
+along with searx. If not, see < http://www.gnu.org/licenses/ >.
14
+
15
+(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
16
+'''
17
+
1 18
 import re
19
+from lxml import etree
20
+from os import listdir
21
+from os.path import isfile, isdir, join
22
+
2 23
 
3 24
 # https://gitweb.torproject.org/\
4 25
 # pde/https-everywhere.git/tree/4.0:/src/chrome/content/rules
5 26
 
6 27
 # HTTPS rewrite rules
7
-https_rules = (
8
-    # from
9
-    (re.compile(r'^http://(www\.|m\.|)?xkcd\.(?:com|org)/', re.I | re.U),
10
-     # to
11
-     r'https://\1xkcd.com/'),
12
-    (re.compile(r'^https?://(?:ssl)?imgs\.xkcd\.com/', re.I | re.U),
13
-     r'https://sslimgs.xkcd.com/'),
14
-)
28
+https_rules = []
29
+
30
+
31
+# load single ruleset from a xml file
32
+def load_single_https_ruleset(filepath):
33
+    ruleset = ()
34
+
35
+    # init parser
36
+    parser = etree.XMLParser()
37
+
38
+    # load and parse xml-file
39
+    try:
40
+        tree = etree.parse(filepath, parser)
41
+    except:
42
+        # TODO, error message
43
+        return ()
44
+
45
+    # get root node
46
+    root = tree.getroot()
47
+
48
+    # check if root is a node with the name ruleset
49
+    # TODO improve parsing
50
+    if root.tag != 'ruleset':
51
+        return ()
52
+
53
+    # check if rule is deactivated by default
54
+    if root.attrib.get('default_off'):
55
+        return ()
56
+
57
+    # check if rule does only work for specific platforms
58
+    if root.attrib.get('platform'):
59
+        return ()
60
+
61
+    hosts = []
62
+    rules = []
63
+    exclusions = []
64
+
65
+    # parse childs from ruleset
66
+    for ruleset in root:
67
+        # this child define a target
68
+        if ruleset.tag == 'target':
69
+            # check if required tags available
70
+            if not ruleset.attrib.get('host'):
71
+                continue
72
+
73
+            # convert host-rule to valid regex
74
+            host = ruleset.attrib.get('host')\
75
+                .replace('.', '\.').replace('*', '.*')
76
+
77
+            # append to host list
78
+            hosts.append(host)
79
+
80
+        # this child define a rule
81
+        elif ruleset.tag == 'rule':
82
+            # check if required tags available
83
+            if not ruleset.attrib.get('from')\
84
+               or not ruleset.attrib.get('to'):
85
+                continue
86
+
87
+            # TODO hack, which convert a javascript regex group
88
+            # into a valid python regex group
89
+            rule_from = ruleset.attrib.get('from').replace('$', '\\')
90
+            rule_to = ruleset.attrib.get('to').replace('$', '\\')
91
+
92
+            # TODO, not working yet because of the hack above,
93
+            # currently doing that in webapp.py
94
+            # rule_from_rgx = re.compile(rule_from, re.I)
95
+
96
+            # append rule
97
+            rules.append((rule_from, rule_to))
98
+
99
+        # this child define an exclusion
100
+        elif ruleset.tag == 'exclusion':
101
+            # check if required tags available
102
+            if not ruleset.attrib.get('pattern'):
103
+                continue
104
+
105
+            exclusion_rgx = re.compile(ruleset.attrib.get('pattern'))
106
+
107
+            # append exclusion
108
+            exclusions.append(exclusion_rgx)
109
+
110
+    # convert list of possible hosts to a simple regex
111
+    # TODO compress regex to improve performance
112
+    try:
113
+        target_hosts = re.compile('^(' + '|'.join(hosts) + ')', re.I | re.U)
114
+    except:
115
+        return ()
116
+
117
+    # return ruleset
118
+    return (target_hosts, rules, exclusions)
119
+
120
+
121
+# load all https rewrite rules
122
+def load_https_rules(rules_path):
123
+    # check if directory exists
124
+    if not isdir(rules_path):
125
+        print("[E] directory not found: '" + rules_path + "'")
126
+        return
127
+
128
+    # search all xml files which are stored in the https rule directory
129
+    xml_files = [join(rules_path, f)
130
+                 for f in listdir(rules_path)
131
+                 if isfile(join(rules_path, f)) and f[-4:] == '.xml']
132
+
133
+    # load xml-files
134
+    for ruleset_file in xml_files:
135
+        # calculate rewrite-rules
136
+        ruleset = load_single_https_ruleset(ruleset_file)
137
+
138
+        # skip if no ruleset returned
139
+        if not ruleset:
140
+            continue
141
+
142
+        # append ruleset
143
+        https_rules.append(ruleset)
144
+
145
+    print(' * {n} https-rules loaded'.format(n=len(https_rules)))

+ 17
- 0
searx/https_rules/00README Visa fil

@@ -0,0 +1,17 @@
1
+<!-- 
2
+This directory contains web site rewriting rules for the
3
+HTTPS Everywhere software, available from
4
+https://www.eff.org/https-everywhere
5
+
6
+These rules were contributed to the project by users and aim to
7
+enable routine secure access to as many different web sites as
8
+possible.  They are automatically installed together with the
9
+HTTPS Everywhere software.  The presence of these rules does not
10
+mean that an HTTPS Everywhere user accessed, or intended to
11
+access, any particular web site.
12
+
13
+For information about how to create additional HTTPS Everywhere
14
+rewriting rules to add support for new sites, please see
15
+
16
+https://www.eff.org/https-everywhere/rulesets
17
+-->

+ 56
- 0
searx/https_rules/Bing.xml Visa fil

@@ -0,0 +1,56 @@
1
+<!--
2
+	For other Microsoft coverage, see Microsoft.xml.
3
+
4
+
5
+	CDN buckets:
6
+
7
+		- a134.lm.akamai.net
8
+
9
+			- akam.bing.com
10
+			- *.mm.bing.net
11
+
12
+
13
+	Nonfunctional domains:
14
+
15
+		- m2.cn.bing.com
16
+		- origin.bj1.bing.com
17
+		- blogs.bing.com
18
+
19
+
20
+	Fully covered domains:
21
+
22
+		- bing.com subdomains:
23
+
24
+			- (www.)
25
+			- c.bing		(tracking beacons)
26
+			- cn.bing
27
+			- h.bing
28
+			- ssl
29
+			- testfamilysafety.bing
30
+			- udc.bing
31
+			- (www.)bing
32
+
33
+		- *.mm.bing.net
34
+		- api.bing.com
35
+
36
+-->
37
+<ruleset name="Bing">
38
+
39
+	<target host="bing.com" />
40
+	<target host="*.bing.com" />
41
+	<target host="*.mm.bing.net" />
42
+
43
+
44
+	<securecookie host=".*\.bing\.com$" name=".+" />
45
+
46
+
47
+	<rule from="^http://((?:c|cn|h|ssl|testfamilysafety|udc|www)\.)?bing\.com/"
48
+		to="https://$1bing.com/" />
49
+
50
+	<rule from="^http://([^/:@]*)\.mm\.bing\.net/"
51
+		to="https://$1.mm.bing.com/"/>
52
+
53
+	<rule from="^http://([^/:@]*)\.api\.bing\.net/"
54
+		to="https://$1.api.bing.com/"/>
55
+
56
+</ruleset>

+ 69
- 0
searx/https_rules/Dailymotion.xml Visa fil

@@ -0,0 +1,69 @@
1
+<!--
2
+	Nonfunctional domains:
3
+
4
+		- blog.dailymotion.com
5
+		- press.dailymotion.com		(shows steaw.com, CN: www.steaw.com)
6
+		- proxy-46.dailymotion.com
7
+		- publicite.dailymotion.com
8
+		- publisher.dailymotion.com	(reset)
9
+		- vid.ak.dmcdn.net		(403, Akamai)
10
+		- vid2.ak.dmcdn.net		(504, akamai)
11
+
12
+
13
+	Problematic domains:
14
+
15
+		- ak2.static.dailymotion.com	(mismatched, CN: *.dmcdn.net)
16
+		- support.dmcloud.net		(mismatched, CN: *.zendesk.com)
17
+
18
+
19
+	Partially covered domains:
20
+
21
+		- (www.)dailymotion.com
22
+
23
+			- cdn/manifest/video/\w+.mnft 403s
24
+			- crossdomain.xml breaks videos
25
+
26
+-->
27
+<ruleset name="Dailymotion (default off)" default_off="breaks some embedded videos">
28
+
29
+	<target host="dailymotion.com" />
30
+	<!--
31
+		* for cross-domain cookie.
32
+					-->
33
+	<target host="*.dailymotion.com" />
34
+		<!--
35
+			https://mail1.eff.org/pipermail/https-everywhere-rules/2012-July/001241.html
36
+													-->
37
+		<exclusion pattern="^http://(?:www\.)?dailymotion\.com/(?:cdn/[\w-]+/video/|crossdomain\.xml$)" />
38
+	<target host="ak2.static.dailymotion.com" />
39
+	<target host="*.dmcdn.net" />
40
+	<target host="dmcloud.net" />
41
+	<target host="*.dmcloud.net" />
42
+
43
+
44
+	<!--	Testing wrt embedded breakage.
45
+
46
+		securecookie host="^.*\.dailymotion\.com$" name=".+" /-->
47
+	<!--
48
+		Omniture tracking cookies:
49
+						-->
50
+	<securecookie host="^\.dailymotion\.com$" name="^s_\w+$" />
51
+	<securecookie host="^www\.dailymotion\.com$" name=".+" />
52
+
53
+
54
+	<rule from="^http://(erroracct\.|www\.)?dailymotion\.com/"
55
+		to="https://$1dailymotion.com/" />
56
+
57
+	<rule from="^http://(s\d|static(?:\d|s\d-ssl))\.dmcdn\.net/"
58
+		to="https://$1.dmcdn.net/" />
59
+
60
+	<rule from="^https?://ak2\.static\.dailymotion\.com/"
61
+		to="https://static1-ssl.dmcdn.net/" />
62
+
63
+	<rule from="^http://(s\.|www\.)?dmcloud\.net/"
64
+		to="https://$1dmcloud.net/" />
65
+
66
+	<rule from="^https?://support\.dmcloud\.net/"
67
+		to="https://dmcloud.zendesk.com/" />
68
+
69
+</ruleset>

+ 53
- 0
searx/https_rules/Deviantart.xml Visa fil

@@ -0,0 +1,53 @@
1
+<!--
2
+	For problematic rules, see Deviantart-mismatches.xml.
3
+
4
+
5
+	Other deviantArt rulesets:
6
+
7
+		- Sta.sh.xml
8
+
9
+
10
+	ToDo: Find edgecast URL for /(fc|th)\d+.
11
+
12
+
13
+	Mixed content:
14
+
15
+		- Images on *.....com from e.deviantart.net *
16
+
17
+	* Secured by us
18
+
19
+-->
20
+<ruleset name="DeviantArt (pending)" default_off="site operator says not ready yet">
21
+
22
+	<target host="deviantart.com" />
23
+	<target host="*.deviantart.com" />
24
+	<target host="deviantart.net" />
25
+	<target host="*.deviantart.net" />
26
+
27
+
28
+	<!--	Not secured by server:
29
+					-->
30
+	<!--securecookie host="^\.deviantart\.com$" name="^userinfo$" /-->
31
+
32
+	<securecookie host="^\.deviantart\.com$" name=".*" />
33
+
34
+
35
+	<!--	Redirects from com to net, but does so successfully by itself.
36
+										-->
37
+	<rule from="^http://([aei]|fc\d\d|s[ht]|th\d\d)\.deviantart\.(com|net)/"
38
+		to="https://$1.deviantart.$2/" />
39
+
40
+	<!--	This handles everything that isn't in the first rule.
41
+		Namely, usernames, backend, fc, th, and (www.).
42
+			These domains present a cert that is only
43
+		valid for .com.
44
+			Note that .net isn't used on DA, but.net does
45
+		redirect to .com, and we shouldn't break what would
46
+		otherwise work.
47
+			Mustn't rewrite from https here, as doing so
48
+		would conflict with the first rule.
49
+								-->
50
+	<rule from="^http://([^/:@\.]+\.)?deviantart\.(?:com|net)/"
51
+		to="https://$1deviantart.com/" />
52
+
53
+</ruleset>

+ 38
- 0
searx/https_rules/DuckDuckGo.xml Visa fil

@@ -0,0 +1,38 @@
1
+<!--
2
+	Problematic domains:
3
+
4
+		- www.dukgo.com		(mismatched, CN: dukgo.com)
5
+
6
+
7
+	Fully covered domains:
8
+
9
+		- (www.)dukgo.com	(www → ^)
10
+
11
+-->
12
+<ruleset name="DuckDuckGo">
13
+  <target host="duckduckgo.com" />
14
+  <target host="*.duckduckgo.com" />
15
+  <target host="ddg.gg" />
16
+  <target host="duck.co" />
17
+  <target host="i.duck.co" />
18
+	<target host="dukgo.com" />
19
+	<target host="www.dukgo.com" />
20
+
21
+  <exclusion pattern="^http://(help|meme)\.duckduckgo\.com/" />
22
+
23
+	<securecookie host="^duck\.co$" name=".*"/>
24
+
25
+  <rule from="^http://duckduckgo\.com/" to="https://duckduckgo.com/"/>
26
+  <rule from="^http://([^/:@\.]+)\.duckduckgo\.com/" to="https://$1.duckduckgo.com/"/>
27
+	<!-- TODO: What does ddg.gg/foo do? Runs query foo, redirects to homepage, or error? -->
28
+    <rule from="^http://ddg\.gg/$" to="https://duckduckgo.com/" />
29
+	
30
+    <rule from="^http://duck\.co/" to="https://duck.co/" />
31
+
32
+	<rule from="^http://i\.duck\.co/"
33
+		to="https://duckduckgo.com/"/>
34
+
35
+	<rule from="^http://(?:www\.)?dukgo\.com/"
36
+		to="https://dukgo.com/" />
37
+
38
+</ruleset>

+ 44
- 0
searx/https_rules/Flickr.xml Visa fil

@@ -0,0 +1,44 @@
1
+<!--
2
+	For other Yahoo coverage, see Yahoo.xml.
3
+
4
+
5
+	These altnames don't exist:
6
+
7
+		- www.blog.flickr.net
8
+		- www.code.flickr.net
9
+
10
+-->
11
+<ruleset name="Flickr">
12
+
13
+	<target host="flic.kr" />
14
+	<target host="*.flic.kr" />
15
+	<target host="flickr.com" />
16
+	<target host="*.flickr.com" />
17
+	<target host="*.flickr.net" />
18
+	<target host="*.staticflickr.com" />
19
+
20
+
21
+	<!--	Not secured by server:
22
+					-->
23
+	<!--securecookie host="^\.flic\.kr$" name="^BX$" /-->
24
+
25
+	<securecookie host="^\.flic\.kr$" name=".+" />
26
+	<securecookie host=".*\.flickr\.com$" name=".+" />
27
+
28
+
29
+	<rule from="^http://flic\.kr/"
30
+		to="https://flic.kr/" />
31
+
32
+	<rule from="^http://(api\.|www\.)?flickr\.com/"
33
+		to="https://$1flickr.com/" />
34
+
35
+	<rule from="^http://s(ecure|tatic)\.flickr\.com/"
36
+		to="https://s$1.flickr.com/" />
37
+
38
+	<rule from="^http://(c2|farm\d+)\.static(\.)?flickr\.com/"
39
+		to="https://$1.static$2flickr.com/" />
40
+
41
+	<rule from="^http://(blog|code)\.flickr\.net/"
42
+		to="https://$1.flickr.net/" />
43
+
44
+</ruleset>

+ 11
- 0
searx/https_rules/Github-Pages.xml Visa fil

@@ -0,0 +1,11 @@
1
+<!--
2
+	For other GitHub coverage, see Github.xml.
3
+-->
4
+<ruleset name="GitHub Pages">
5
+
6
+	<target host="*.github.io" />
7
+
8
+	<rule from="^http://([^/@:\.]+)\.github\.io/"
9
+		to="https://$1.github.io/" />
10
+
11
+</ruleset>

+ 94
- 0
searx/https_rules/Github.xml Visa fil

@@ -0,0 +1,94 @@
1
+<!--
2
+	Other GitHub rulesets:
3
+
4
+		- Github-Pages.xml
5
+		- Guag.es.xml
6
+		- Speaker_Deck.com.xml
7
+
8
+
9
+	CDN buckets:
10
+
11
+		- github-images.s3.amazonaws.com
12
+		- github.global.ssl.fastly.net
13
+		- a248.e.akamai.net/assets.github.com/
14
+		- a248.e.akamai.net/camo.github.com/
15
+		- s3.amazonaws.com/github/ | d24z2fz21y4fag.cloudfront.net
16
+		- github.myshopify.com
17
+
18
+
19
+	Fully covered domains:
20
+
21
+		- github.com subdomains:
22
+
23
+			- (www.)
24
+			- assets\d+
25
+			- assets-cdn
26
+			- bounty
27
+			- cloud
28
+			- f.cloud
29
+			- codeload
30
+			- developer
31
+			- eclipse
32
+			- enterprise
33
+			- gist
34
+			- gist-assets
35
+			- help
36
+			- identicons
37
+			- jobs
38
+			- mac
39
+			- mobile
40
+			- nodeload
41
+			- octodex
42
+			- pages
43
+			- raw
44
+			- rg3
45
+			- shop
46
+			- status
47
+			- support
48
+			- training
49
+			- try
50
+			- wiki
51
+			- windows
52
+
53
+		- collector.githubapp.com
54
+
55
+		- githubusercontent.com
56
+
57
+-->
58
+<ruleset name="GitHub">
59
+
60
+	<target host="github.com" />
61
+	<target host="*.github.com" />
62
+	<target host="github.io" />
63
+	<target host="*.githubusercontent.com" />
64
+	<target host="collector.githubapp.com" />
65
+
66
+
67
+	<!--	Secured by server:
68
+					-->
69
+	<!--securecookie host="^github\.com$" name="^(_gh_sess|tz|user_session)$" /-->
70
+	<!--securecookie host="^\.github\.com$" name="^(dotcom_user|logged_in)$" /-->
71
+	<!--securecookie host="^enterprise\.github\.com$" name="^(_enterprise_web|request_method)$" /-->
72
+	<!--securecookie host="^gist\.github\.com$" name="^_gist_session$" /-->
73
+	<!--securecookie host="^help\.github\.com$" name="^_help_session$" /-->
74
+	<!--
75
+		Not secured by server:
76
+					-->
77
+	<!--securecookie host="^status\.github\.com$" name="^rack\.session$" /-->
78
+
79
+	<securecookie host="^(?:.*\.)?github\.com$" name=".+" />
80
+
81
+
82
+	<rule from="^http://((?:assets\d+|assets-cdn|bounty|cloud|f\.cloud|codeload|developer|eclipse|enterprise|gist|gist-assets|help|identicons|jobs|mac|mobile|nodeload|octodex|pages|raw|rg3|shop|status|support|training|try|wiki|windows|www)\.)?github\.com/"
83
+		to="https://$1github.com/" />
84
+
85
+	<rule from="^http://collector\.githubapp\.com/"
86
+		to="https://collector.githubapp.com/" />
87
+
88
+	<rule from="^https?://github\.io/"
89
+		to="https://pages.github.com/" />
90
+
91
+	<rule from="^http://([^/@:\.]+)\.githubusercontent\.com/"
92
+		to="https://$1.githubusercontent.com/" />
93
+
94
+</ruleset>

+ 26
- 0
searx/https_rules/Google-mismatches.xml Visa fil

@@ -0,0 +1,26 @@
1
+<!--
2
+
3
+	Problematic domains:
4
+
5
+		- (www.)apture.com	(works, mismatched, CN: *.google.com)
6
+
7
+-->
8
+<ruleset name="Google (mismatches)" default_off="mismatches">
9
+
10
+	<!--	Akamai	-->
11
+	<target host="js.admeld.com"/>
12
+	<target host="apture.com" />
13
+	<target host="www.apture.com" />
14
+	<target host="googleartproject.com"/>
15
+	<target host="www.googleartproject.com"/>
16
+
17
+	<rule from="^http://js\.admeld\.com/"
18
+		to="https://js.admeld.com/"/>
19
+
20
+	<rule from="^https?://(?:www\.)?apture\.com/"
21
+		to="https://apture.com/" />
22
+
23
+	<rule from="^http://(?:www\.)?googleartproject\.com/"
24
+		to="https://www.googleartproject.com/"/>
25
+
26
+</ruleset>

+ 14
- 0
searx/https_rules/Google.org.xml Visa fil

@@ -0,0 +1,14 @@
1
+<!--
2
+	For other Google coverage, see GoogleServices.xml.
3
+
4
+-->
5
+<ruleset name="Google.org">
6
+
7
+	<target host="google.org" />
8
+	<target host="www.google.org" />
9
+
10
+
11
+	<rule from="^http://(www\.)?google\.org/"
12
+		to="https://$1google.org/" />
13
+
14
+</ruleset>

+ 143
- 0
searx/https_rules/GoogleAPIs.xml Visa fil

@@ -0,0 +1,143 @@
1
+<!--
2
+	For other Google coverage, see GoogleServices.xml.
3
+
4
+
5
+	Nonfunctional domains:
6
+
7
+		- hosted.gmodules.com *
8
+		- img0.gmodules.com *
9
+		- p.gmodules.com *
10
+
11
+	* 404; mismatched, CN: *.googleusercontent.com
12
+
13
+
14
+	Problematic domains:
15
+
16
+		- gmodules.com			(503, CN: www.google.com)
17
+		- www.gmodules.com		(503, CN: *.googleusercontent.com)
18
+		- gstatic.com			(404, valid cert)
19
+		- api.recaptcha.net		(works; mismatched, CN: google.com)
20
+
21
+
22
+	Partially covered domains:
23
+
24
+		- (www.)gmodules.com		(→ www.google.com)
25
+		- (www.)google.com
26
+		- chart.apis.google.com		(→ chart.googleapis.com)
27
+
28
+
29
+	Fully covered domains:
30
+
31
+		- api.google.com
32
+
33
+		- *.clients.google.com:
34
+
35
+			- linkhelp
36
+
37
+		- ssl.google-analytics.com
38
+		- www.google-analytics.com
39
+
40
+		- googleapis.com subdomains:
41
+
42
+			- ajax
43
+			- chart
44
+			- *.commondatastorage
45
+			- fonts
46
+			- *.storage
47
+			- www
48
+
49
+		- gstatic.com subdomains:
50
+
51
+			- (www.)	(^ → www)
52
+			- csi
53
+			- encrypted-tbn\d
54
+			- g0
55
+			- *.metric
56
+			- ssl
57
+			- t\d
58
+
59
+		- api.recaptcha.net	(→ www.google.com)
60
+		- api-secure.recaptcha.net
61
+		- gdata.youtube.com
62
+
63
+
64
+	ssl.google-analytics.com/ga.js sets __utm\w wildcard
65
+	cookies on whichever domain it is loaded from.
66
+
67
+-->
68
+<ruleset name="Google APIs">
69
+
70
+	<target host="gmodules.com" />
71
+	<target host="www.gmodules.com" />
72
+	<target host="google.com" />
73
+	<target host="apis.google.com" />
74
+	<target host="*.apis.google.com" />
75
+	<target host="*.clients.google.com" />
76
+	<target host="www.google.com" />
77
+	<target host="*.google-analytics.com" />
78
+	<target host="*.googleapis.com" />
79
+	<target host="gstatic.com" />
80
+	<target host="*.gstatic.com" />
81
+	<!--	Captive portal detection redirects to this URL, and many captive
82
+		portals break TLS, so exempt this redirect URL.
83
+		See GitHub bug #368
84
+							-->
85
+		<exclusion pattern="^http://www\.gstatic\.com/generate_204" />
86
+	<target host="*.recaptcha.net" />
87
+	<target host="gdata.youtube.com" />
88
+		<exclusion pattern="^http://gdata\.youtube\.com/crossdomain\.xml" />
89
+
90
+
91
+	<securecookie host="^ssl\.google-analytics\.com$" name=".+" />
92
+
93
+
94
+	<rule from="^http://(?:www\.)?gmodules\.com/ig/images/"
95
+		to="https://www.google.com/ig/images/" />
96
+
97
+	<!--	jsapi was causing problems on some sites that embed google maps:
98
+		https://trac.torproject.org/projects/tor/ticket/2335
99
+		Apparently now fixed; thanks, Google!
100
+							-->
101
+	<rule from="^http://(?:www\.)?google\.com/(afsonline/|chart|jsapi|recaptcha/|uds)"
102
+		to="https://www.google.com/$1" />
103
+
104
+	<rule from="^http://(api|[\w-]+\.client)s\.google\.com/"
105
+		to="https://$1s.google.com/" />
106
+
107
+	<rule from="^http://chart\.apis\.google\.com/chart"
108
+		to="https://chart.googleapis.com/chart" />
109
+
110
+	<rule from="^http://(ssl|www)\.google-analytics\.com/"
111
+		to="https://$1.google-analytics.com/" />
112
+
113
+	<rule from="^http://(ajax|chart|fonts|www)\.googleapis\.com/"
114
+		to="https://$1.googleapis.com/" />
115
+
116
+	<rule from="^http://([^@:\./]+\.)?(commondata)?storage\.googleapis\.com/"
117
+		to="https://$1$2storage.googleapis.com/" />
118
+
119
+	<!--	There is an interesting question about whether we should
120
+		append &strip=1 to all cache URLs.  This causes them to load
121
+		without images and styles, which is more secure but can look
122
+		worse.
123
+			Without &strip=1, the images and styles from the cached
124
+		pages still load from the original, typically unencrypted, page.
125
+			With &strip=1, the cached page will be text-only and
126
+		will come exclusively from Google's HTTPS server.
127
+									-->
128
+	<rule from="^http://(?:www\.)?gstatic\.com/"
129
+		to="https://www.gstatic.com/" />
130
+
131
+	<rule from="^http://(csi|encrypted-tbn\d|g0|[\w-]+\.metric|ssl|t\d)\.gstatic\.com/"
132
+		to="https://$1.gstatic.com/" />
133
+
134
+	<rule from="^http://api\.recaptcha\.net/"
135
+		to="https://www.google.com/recaptcha/api/" />
136
+
137
+	<rule from="^http://api-secure\.recaptcha\.net/"
138
+		to="https://api-secure.recaptcha.net/" />
139
+
140
+	<rule from="^http://gdata\.youtube\.com/"
141
+		to="https://gdata.youtube.com/" />
142
+
143
+</ruleset>

+ 6
- 0
searx/https_rules/GoogleCanada.xml Visa fil

@@ -0,0 +1,6 @@
1
+<ruleset name="GoogleCanada">
2
+	<target host="google.ca" />
3
+	<target host="*.google.ca" />
4
+	<rule from="^http://([^/:@\.]+)\.google\.ca/finance" to="https://$1.google.ca/finance"/>
5
+</ruleset>
6
+

+ 65
- 0
searx/https_rules/GoogleImages.xml Visa fil

@@ -0,0 +1,65 @@
1
+<!--
2
+	For other Google coverage, see GoogleServices.xml.
3
+
4
+
5
+	Problematic domains:
6
+
7
+		- www.google.bo *
8
+		- www.google.co *
9
+		- www.google.ec *
10
+		- www.google.in *
11
+		- www.google.kr *
12
+		- www.google.com.kz **
13
+		- www.google.com.lk *
14
+		- www.google.mx **
15
+		- www.google.sg *
16
+		- www.google.sl *
17
+		- www.google.ug *
18
+		- www.google.vn *
19
+
20
+	* 404; mismatched, CN: google.com
21
+	** Works; mismatched, CN: google.com
22
+
23
+-->
24
+<ruleset name="Google Images">
25
+
26
+	<target host="google.*" />
27
+	<target host="www.google.*" />
28
+	<target host="google.co.*" />
29
+	<target host="www.google.co.*" />
30
+	<target host="google.com" />
31
+	<target host="images.google.com" />
32
+	<target host="google.com.*" />
33
+	<target host="www.google.com.*" />
34
+		<!--
35
+			Only handle image-related paths in this ruleset:
36
+										-->
37
+		<exclusion pattern="^http://(?:www\.)?google(?:\.com?)?\.\w{2,3}/(?!(?:advanced_image_search|imghp|.*tb(?:m=isch|s=sbi)))" />
38
+
39
+
40
+	<rule from="^http://(?:www\.)?google\.com/"
41
+		to="https://www.google.com/" />
42
+
43
+	<rule from="^http://images\.google\.com/"
44
+		to="https://images.google.com/" />
45
+
46
+	<!--	First handle problematic domains:
47
+							-->
48
+	<rule from="^http://(?:www\.)?google\.co/"
49
+		to="https://www.google.com/" />
50
+
51
+	<rule from="^http://(?:www\.)?google\.(?:co\.)?(in|kr|ug)/"
52
+		to="https://www.google.co.$1/" />
53
+
54
+	<rule from="^http://(?:www\.)?google\.(?:com\.)?(kz|lk)/"
55
+		to="https://www.google.$1/" />
56
+
57
+	<rule from="^http://(?:www\.)?google\.(?:com\.)?(bo|ec|mx|sg|sl|vn)/"
58
+		to="https://www.google.com.$1/" />
59
+
60
+	<!--	And then the rest:
61
+					-->
62
+	<rule from="^http://(?:www\.)?google\.(com?\.)?(ae|ar|at|au|bg|bh|br|ca|ch|cl|co|cr|cu|de|eg|es|fi|fr|gh|gt|hr|id|ie|il|it|jo|jp|jm|ke|kw|lb|ly|my|na|ng|nl|no|nz|om|pa|pe|pk|pl|pt|py|qa|ro|ru|rw|sa|se|sv|th|tr|uk|uy|ve|za|zw)/"
63
+		to="https://www.google.$1$2/" />
64
+
65
+</ruleset>

+ 78
- 0
searx/https_rules/GoogleMainSearch.xml Visa fil

@@ -0,0 +1,78 @@
1
+<ruleset name="Search www.google.com">
2
+
3
+<!-- 
4
+Enabling this ruleset should cause searches to go to
5
+https://www.google.com rather than https://encrypted.google.com.  Note that
6
+the filename is important; it must be before GoogleSearch.xml in a bash
7
+expansion of src/chrome/content/rules/*.xml in order to take precedence. 
8
+-->
9
+
10
+  <target host="*.google.com" />
11
+  <target host="google.com" />
12
+  <target host="www.google.com.*" />
13
+  <target host="google.com.*" />
14
+  <target host="www.google.co.*" />
15
+  <target host="google.co.*" />
16
+  <target host="www.google.*" />
17
+  <target host="google.*" />
18
+  <!-- beyond clients1 these do not currently exist in the ccTLDs,
19
+       but just in case... -->
20
+  <target host="clients1.google.com.*" />
21
+  <target host="clients2.google.com.*" />
22
+  <target host="clients3.google.com.*" />
23
+  <target host="clients4.google.com.*" />
24
+  <target host="clients5.google.com.*" />
25
+  <target host="clients6.google.com.*" />
26
+  <target host="clients1.google.co.*" />
27
+  <target host="clients2.google.co.*" />
28
+  <target host="clients3.google.co.*" />
29
+  <target host="clients4.google.co.*" />
30
+  <target host="clients5.google.co.*" />
31
+  <target host="clients6.google.co.*" />
32
+  <target host="clients1.google.*" />
33
+  <target host="clients2.google.*" />
34
+  <target host="clients3.google.*" />
35
+  <target host="clients4.google.*" />
36
+  <target host="clients5.google.*" />
37
+  <target host="clients6.google.*" />
38
+
39
+  <rule from="^http://www\.google\.com/$"
40
+          to="https://www.google.com/"/>
41
+
42
+  <!-- The most basic case. -->
43
+
44
+  <rule from="^http://(?:www\.)?google\.com/search"
45
+          to="https://www.google.com/search"/>
46
+
47
+  <!-- A very annoying exception that we seem to need for the basic case -->
48
+
49
+  <exclusion pattern="^http://(?:www\.)?google\.com/search.*tbs=shop" />
50
+  <exclusion pattern="^http://clients[0-9]\.google\.com/.*client=products.*" />
51
+  <exclusion pattern="^http://suggestqueries\.google\.com/.*client=.*" />
52
+
53
+  <!-- https://trac.torproject.org/projects/tor/ticket/9713 -->
54
+
55
+  <exclusion pattern="^http://clients[0-9]\.google\.com/ocsp" />
56
+
57
+  <!-- This is necessary for image results links from web search results -->
58
+
59
+  <exclusion pattern="^http://(?:www\.)?google\.com/search.*tbm=isch.*" />
60
+
61
+  <rule from="^http://(?:www\.)?google\.com/webhp"
62
+          to="https://www.google.com/webhp"/>
63
+
64
+  <rule from="^http://(?:www\.)?google\.com/#"
65
+          to="https://www.google.com/#"/>
66
+
67
+  <rule from="^http://(?:www\.)?google\.com/$"
68
+          to="https://www.google.com/"/>
69
+
70
+   <!-- Completion urls look like this:
71
+
72
+http://clients2.google.co.jp/complete/search?hl=ja&client=hp&expIds=17259,24660,24729,24745&q=m&cp=1 HTTP/1.1\r\n
73
+
74
+   -->
75
+  <rule from="^http://clients[0-9]\.google\.com/complete/search"
76
+          to="https://clients1.google.com/complete/search"/>
77
+
78
+</ruleset>

+ 67
- 0
searx/https_rules/GoogleMaps.xml Visa fil

@@ -0,0 +1,67 @@
1
+<!--
2
+	Problematic domains:
3
+
4
+		- khms *
5
+		- khms[0-3] *
6
+
7
+	* $ 404s
8
+
9
+
10
+	Fully covered domains:
11
+
12
+		- google.com subdomains:
13
+
14
+			- khms
15
+			- khms[0-3]
16
+
17
+-->
18
+<ruleset name="Google Maps">
19
+
20
+	<target host="maps.google.*" />
21
+		<!--
22
+			https://trac.torproject.org/projects/tor/ticket/8627
23
+										-->
24
+		<exclusion pattern="^http://maps\.google\.com/local_url" />
25
+		<exclusion pattern="^http://maps\.google\.gr/transitathens" />
26
+	<target host="maps.google.co.*" />
27
+	<target host="khms.google.com" />
28
+	<target host="khms0.google.com" />
29
+	<target host="khms1.google.com" />
30
+	<target host="khms2.google.com" />
31
+	<target host="khms3.google.com" />
32
+	<target host="maps-api-ssl.google.com" />
33
+	<target host="mw2.google.com" />
34
+	<target host="maps.google.com.*" />
35
+	<target host="maps.googleapis.com" />
36
+		<!--
37
+			https://mail1.eff.org/pipermail/https-everywhere-rules/2012-September/001317.html
38
+														-->
39
+		<!--exclusion pattern="^http://maps\.googleapis\.com/map(files/lib/map_1_20\.swf|sapi/publicapi\?file=flashapi)" /-->
40
+		<exclusion pattern="^http://maps\.googleapis\.com/map(?:files/lib/map_\d+_\d+\.swf|sapi/publicapi\?file=flashapi)" />
41
+	<target host="maps.gstatic.com" />
42
+
43
+
44
+	<!--securecookie host="^maps\.google\.(com?\.)?(au|ca|gh|ie|in|jm|ke|lk|my|n[agz]|pk|rw|sl|sg|ug|uk|za|zw)$" name=".+" /-->
45
+	<securecookie host="^maps\.google\.[\w.]{2,6}$" name=".+" />
46
+	<securecookie host="^maps\.g(?:oogle|oogleapis|static)\.com$" name=".+" />
47
+	<securecookie host="^maps-api-ssl\.google\.com$" name=".+" />
48
+
49
+
50
+	<rule from="^http://maps\.google\.([^/]+)/"
51
+		to="https://maps.google.$1/" />
52
+
53
+	<!--	http://khms.../$ 404s:
54
+					-->
55
+	<rule from="^http://khms\d?\.google\.com/+\??$"
56
+		to="https://www.google.com/" />
57
+
58
+	<rule from="^http://(khms\d?|maps-api-ssl|mw2)\.google\.com/"
59
+		to="https://$1.google.com/" />
60
+
61
+	<rule from="^http://maps\.g(oogleapis|static)\.com/"
62
+		to="https://maps.g$1.com/" />
63
+
64
+	<rule from="^https://maps\.googleapis\.com/map(?=files/lib/map_\d+_\d+\.swf|sapi/publicapi\?file=flashapi)"
65
+		to="http://maps.googleapis.com/map" downgrade="1" />
66
+
67
+</ruleset>

+ 6
- 0
searx/https_rules/GoogleMelange.xml Visa fil

@@ -0,0 +1,6 @@
1
+<ruleset name="GoogleMelange">
2
+  <target host="www.google-melange.com" />
3
+  <target host="google-melange.com" />
4
+
5
+  <rule from="^http://(www\.)?google-melange\.com/" to="https://www.google-melange.com/" />
6
+</ruleset>

+ 135
- 0
searx/https_rules/GoogleSearch.xml Visa fil

@@ -0,0 +1,135 @@
1
+<ruleset name="Google Search">
2
+
3
+	<target host="google.com" />
4
+	<target host="*.google.com" />
5
+	<target host="google.com.*" />
6
+	<target host="www.google.com.*" />
7
+	<target host="google.co.*" />
8
+	<target host="www.google.co.*" />
9
+	<target host="google.*" />
10
+	<target host="www.google.*" />
11
+	<!--
12
+		Beyond clients1 these do not currently
13
+		exist in the ccTLDs, but just in case...
14
+							-->
15
+	<target host="clients1.google.com.*" />
16
+	<target host="clients2.google.com.*" />
17
+	<target host="clients3.google.com.*" />
18
+	<target host="clients4.google.com.*" />
19
+	<target host="clients5.google.com.*" />
20
+	<target host="clients6.google.com.*" />
21
+	<target host="clients1.google.co.*" />
22
+	<target host="clients2.google.co.*" />
23
+	<target host="clients3.google.co.*" />
24
+	<target host="clients4.google.co.*" />
25
+	<target host="clients5.google.co.*" />
26
+	<target host="clients6.google.co.*" />
27
+	<target host="clients1.google.*" />
28
+	<target host="clients2.google.*" />
29
+	<target host="clients3.google.*" />
30
+	<target host="clients4.google.*" />
31
+	<target host="clients5.google.*" />
32
+	<target host="clients6.google.*" />
33
+
34
+
35
+	<!--	Some Google pages can generate naive links back to the
36
+		unencrypted version of encrypted.google.com, which is
37
+		a 301 but theoretically vulnerable to SSL stripping.
38
+									-->
39
+	<rule from="^http://encrypted\.google\.com/"
40
+		to="https://encrypted.google.com/" />
41
+
42
+	<!--	The most basic case.
43
+					-->
44
+	<rule from="^http://(?:www\.)?google\.com/search"
45
+		to="https://encrypted.google.com/search" />
46
+
47
+	<!--	A very annoying exception that we
48
+		seem to need for the basic case
49
+						-->
50
+	<exclusion pattern="^http://(?:www\.)?google\.com/search.*tbs=shop" />
51
+	<exclusion pattern="^http://clients\d\.google\.com/.*client=products.*" />
52
+	<exclusion pattern="^http://suggestqueries\.google\.com/.*client=.*" />
53
+
54
+  <!-- https://trac.torproject.org/projects/tor/ticket/9713 
55
+         -->
56
+
57
+  <exclusion pattern="^http://clients[0-9]\.google\.com/ocsp" />
58
+
59
+
60
+	<!--	This is necessary for image results
61
+		links from web search results
62
+						-->
63
+	<exclusion pattern="^http://(?:www\.)?google\.com/search.*tbm=isch.*" />
64
+
65
+	<rule from="^http://(?:www\.)?google\.com/about"
66
+		to="https://www.google.com/about" />
67
+
68
+	<!--	There are two distinct cases for these firefox searches	-->
69
+
70
+	<rule from="^http://(?:www\.)?google(?:\.com?)?\.[a-z]{2}/firefox/?$"
71
+		to="https://encrypted.google.com/" />
72
+
73
+	<rule from="^http://(?:www\.)?google(?:\.com?)?\.[a-z]{2}/firefox"
74
+		to="https://encrypted.google.com/webhp" />
75
+
76
+	<rule from="^http://(?:www\.)?google\.com/webhp"
77
+		to="https://encrypted.google.com/webhp" />
78
+
79
+	<rule from="^http://codesearch\.google\.com/"
80
+		to="https://codesearch.google.com/" />
81
+
82
+	<rule from="^http://(?:www\.)?google\.com/codesearch"
83
+		to="https://www.google.com/codesearch" />
84
+
85
+	<rule from="^http://(?:www\.)?google\.com/#"
86
+		to="https://encrypted.google.com/#" />
87
+
88
+	<rule from="^http://(?:www\.)?google\.com/$"
89
+		to="https://encrypted.google.com/" />
90
+
91
+	<!--	Google supports IPv6 search, including
92
+		HTTPS with a valid certificate!	-->
93
+	<rule from="^http://ipv6\.google\.com/"
94
+		to="https://ipv6.google.com/" />
95
+
96
+	<!--	most google international sites look like
97
+		"google.fr", some look like "google.co.jp",
98
+		and some crazy ones like "google.com.au"	-->
99
+
100
+	<rule from="^http://(www\.)?google(\.com?)?\.([a-z]{2})/(search\?|#)"
101
+		to="https://$1google$2.$3/$4" />
102
+
103
+	<!--	Language preference setting	-->
104
+	<rule from="^http://(www\.)?google(\.com?)?\.([a-z]{2})/setprefs"
105
+	to="https://$1google$2.$3/setprefs" />
106
+
107
+	<!--	Completion urls look like this:
108
+
109
+http://clients2.google.co.jp/complete/search?hl=ja&client=hp&expIds=17259,24660,24729,24745&q=m&cp=1 HTTP/1.1\r\n
110
+
111
+		-->
112
+	<rule from="^http://clients\d\.google\.com/complete/search"
113
+		to="https://clients1.google.com/complete/search" />
114
+
115
+	<rule from="^http://clients\d\.google(\.com?\.[a-z]{2})/complete/search"
116
+		to="https://clients1.google.$1/complete/search" />
117
+
118
+	<rule from="^http://clients\d\.google\.([a-z]{2})/complete/search"
119
+		to="https://clients1.google.$1/complete/search" />
120
+
121
+	<rule from="^http://suggestqueries\.google\.com/complete/search"
122
+		to="https://clients1.google.com/complete/search" />
123
+
124
+	<rule from="^http://(www\.)?google\.(com?\.)?([a-z]{2})/(?:webhp)?$"
125
+		to="https://$1google.$2$3/" />
126
+
127
+	<!--	If there are URL parameters, keep them.	-->
128
+	<rule from="^http://(www\.)?google\.(com?\.)?([a-z]{2})/(?:webhp)?\?"
129
+		to="https://$1google.$2$3/webhp?" />
130
+
131
+	<!-- teapot -->
132
+	<rule from="^http://(www\.)?google(\.com?)?\.([a-z]{2})/teapot"
133
+		to="https://$1google$2.$3/teapot" />
134
+
135
+</ruleset>

+ 345
- 0
searx/https_rules/GoogleServices.xml Visa fil

@@ -0,0 +1,345 @@
1
+<!--
2
+	Other Google rulesets:
3
+
4
+		- 2mdn.net.xml
5
+		- Admeld.xml
6
+		- ChannelIntelligence.com.xml
7
+		- Doubleclick.net.xml
8
+		- FeedBurner.xml
9
+		- Google.org.xml
10
+		- GoogleAPIs.xml
11
+		- Google_App_Engine.xml
12
+		- GoogleImages.xml
13
+		- GoogleShopping.xml
14
+		- Ingress.xml
15
+		- Meebo.xml
16
+		- Orkut.xml
17
+		- Postini.xml
18
+		- WebM_Project.org.xml
19
+
20
+
21
+	Nonfunctional domains:
22
+
23
+		- feedproxy.google.com			(404, valid cert)
24
+		- partnerpage.google.com *
25
+		- safebrowsing.clients.google.com	(404, mismatched)
26
+		- (www.)googlesyndicatedsearch.com	(404; mismatched, CN: google.com)
27
+		- buttons.googlesyndication.com *
28
+
29
+	* 404, valid cert
30
+
31
+
32
+	Nonfunctional google.com paths:
33
+
34
+		- analytics	(redirects to http)
35
+		- imgres
36
+		- gadgets *
37
+		- hangouts	(404)
38
+		- u/		(404)
39
+
40
+	* Redirects to http
41
+
42
+
43
+	Problematic domains:
44
+
45
+		- www.goo.gl		(404; mismatched, CN: *.google.com)
46
+
47
+		- google.com subdomains:
48
+
49
+			- books		(googlebooks/, images/, & intl/ 404, but works when rewritten to www)
50
+			- cbks0 ****
51
+			- earth *
52
+			- gg		($ 404s)
53
+			- knoll *
54
+			- scholar **
55
+			- trends *
56
+
57
+		- news.google.cctld **
58
+		- scholar.google.cctld **
59
+		- *-opensocial.googleusercontent.com ***
60
+
61
+	**** $ 404s
62
+	* 404, valid cert
63
+	** Redirects to http, valid cert
64
+	*** Breaks followers widget - https://trac.torproject.org/projects/tor/ticket/7294
65
+
66
+
67
+	Partially covered domains:
68
+
69
+		- google.cctld subdomains:
70
+
71
+			- scholar	(→ www)
72
+
73
+		- google.com subdomains:
74
+
75
+			- (www.)
76
+			- cbks0		($ 404s)
77
+			- gg		($ 404s)
78
+			- news		(→ www)
79
+			- scholar	(→ www)
80
+
81
+		- *.googleusercontent.com	(*-opensocial excluded)
82
+
83
+
84
+	Fully covered domains:
85
+
86
+		- lh[3-6].ggpht.com
87
+		- (www.)goo.gl		(www → ^)
88
+
89
+		- google.com subdomains:
90
+
91
+			- accounts
92
+			- adwords
93
+			- apis
94
+			- appengine
95
+			- books		(→ encrypted)
96
+			- calendar
97
+			- checkout
98
+			- chrome
99
+			- clients[12]
100
+			- code
101
+			- *.corp
102
+			- developers
103
+			- dl
104
+			- docs
105
+			- docs\d
106
+			- \d.docs
107
+			- drive
108
+			- earth		(→ www)
109
+			- encrypted
110
+			- encrypted-tbn[123]
111
+			- feedburner
112
+			- fiber
113
+			- finance
114
+			- glass
115
+			- groups
116
+			- health
117
+			- helpouts
118
+			- history
119
+			- hostedtalkgadget
120
+			- id
121
+			- investor
122
+			- knol
123
+			- knoll		(→ knol)
124
+			- lh\d
125
+			- mail
126
+			- chatenabled.mail
127
+			- pack
128
+			- picasaweb
129
+			- pki
130
+			- play
131
+			- plus
132
+			- plusone
133
+			- productforums
134
+			- profiles
135
+			- safebrowsing-cache
136
+			- cert-test.sandbox
137
+			- plus.sandbox
138
+			- sb-ssl
139
+			- script
140
+			- security
141
+			- services
142
+			- servicessites
143
+			- sites
144
+			- spreadsheets
145
+			- spreadsheets\d
146
+			- support
147
+			- talk
148
+			- talkgadget
149
+			- tbn2			(→ encrypted-tbn2)
150
+			- tools
151
+			- trends		(→ www)
152
+
153
+		- partner.googleadservices.com
154
+		- (www.)googlecode.com
155
+		- *.googlecode.com	(per-project subdomains)
156
+		- googlesource.com
157
+		- *.googlesource.com
158
+		- pagead2.googlesyndication.com
159
+		- tpc.googlesyndication.com
160
+		- mail-attachment.googleusercontent.com
161
+		- webcache.googleusercontent.com
162
+
163
+
164
+	XXX: Needs more testing
165
+
166
+-->
167
+<ruleset name="Google Services">
168
+
169
+	<target host="*.ggpht.com" />
170
+	<target host="gmail.com" />
171
+	<target host="www.gmail.com" />
172
+	<target host="goo.gl" />
173
+	<target host="www.goo.gl" />
174
+	<target host="google.*" />
175
+	<target host="accounts.google.*" />
176
+	<target host="adwords.google.*" />
177
+	<target host="finance.google.*" />
178
+	<target host="groups.google.*" />
179
+	<target host="it.google.*" />
180
+	<target host="news.google.*" />
181
+		<exclusion pattern="^http://(?:news\.)?google\.com/(?:archivesearch|newspapers)" />
182
+	<target host="picasaweb.google.*" />
183
+	<target host="scholar.google.*" />
184
+	<target host="www.google.*" />
185
+	<target host="*.google.ca" />
186
+	<target host="google.co.*" />
187
+	<target host="accounts.google.co.*" />
188
+	<target host="adwords.google.co.*" />
189
+	<target host="finance.google.co.*" />
190
+	<target host="groups.google.co.*" />
191
+	<target host="id.google.co.*" />
192
+	<target host="news.google.co.*" />
193
+	<target host="picasaweb.google.co.*" />
194
+	<target host="scholar.google.co.*" />
195
+	<target host="www.google.co.*" />
196
+	<target host="google.com" />
197
+	<target host="*.google.com" />
198
+		<exclusion pattern="^http://(?:www\.)?google\.com/analytics/*(?:/[^/]+)?(?:\?.*)?$" />
199
+		<!--exclusion pattern="^http://books\.google\.com/(?!books/(\w+\.js|css/|javascript/)|favicon\.ico|googlebooks/|images/|intl/)" /-->
200
+		<exclusion pattern="^http://cbks0\.google\.com/(?:$|\?)" />
201
+		<exclusion pattern="^http://gg\.google\.com/(?!csi(?:$|\?))" />
202
+	<target host="google.com.*" />
203
+	<target host="accounts.google.com.*" />
204
+	<target host="adwords.google.com.*" />
205
+	<target host="groups.google.com.*" />
206
+	<target host="id.google.com.*" />
207
+	<target host="news.google.com.*" />
208
+	<target host="picasaweb.google.com.*" />
209
+	<target host="scholar.google.com.*" />
210
+	<target host="www.google.com.*" />
211
+	<target host="partner.googleadservices.com" />
212
+	<target host="googlecode.com" />
213
+	<target host="*.googlecode.com" />
214
+	<target host="googlemail.com" />
215
+	<target host="www.googlemail.com" />
216
+	<target host="googlesource.com" />
217
+	<target host="*.googlesource.com" />
218
+	<target host="*.googlesyndication.com" />
219
+	<target host="www.googletagservices.com" />
220
+	<target host="googleusercontent.com" />
221
+	<target host="*.googleusercontent.com" />
222
+		<!--
223
+			Necessary for the Followers widget:
224
+
225
+				 https://trac.torproject.org/projects/tor/ticket/7294
226
+											-->
227
+		<exclusion pattern="http://[^@:\./]+-opensocial\.googleusercontent\.com" />
228
+
229
+
230
+	<!--	Can we secure any of these wildcard cookies safely?
231
+									-->
232
+	<!--securecookie host="^\.google\.com$" name="^(hl|I4SUserLocale|NID|PREF|S)$" /-->
233
+	<!--securecookie host="^\.google\.[\w.]{2,6}$" name="^(hl|I4SUserLocale|NID|PREF|S|S_awfe)$" /-->
234
+	<securecookie host="^(?:accounts|adwords|\.code|login\.corp|developers|docs|\d\.docs|fiber|mail|picasaweb|plus|\.?productforums|support)\.google\.[\w.]{2,6}$" name=".+" />
235
+	<securecookie host="^www\.google\.com$" name="^GoogleAccountsLocale_session$" />
236
+	<securecookie host="^mail-attachment\.googleusercontent\.com$" name=".+" />
237
+	<securecookie host="^gmail\.com$" name=".+" />
238
+	<securecookie host="^www\.gmail\.com$" name=".+" />
239
+	<securecookie host="^googlemail\.com$" name=".+" />
240
+	<securecookie host="^www\.googlemail\.com$" name=".+" />
241
+
242
+
243
+	<!--    - lh 3-6 exist
244
+		- All appear identical
245
+		- Identical to lh\d.googleusercontent.com
246
+					-->
247
+	<rule from="^http://lh(\d)\.ggpht\.com/"
248
+		to="https://lh$1.ggpht.com/" />
249
+
250
+	<rule from="^http://lh(\d)\.google\.ca/"
251
+		to="https://lh$1.google.ca/" />
252
+
253
+
254
+	<rule from="^http://(www\.)?g(oogle)?mail\.com/"
255
+		to="https://$1g$2mail.com/" />
256
+
257
+	<rule from="^http://(?:www\.)?goo\.gl/"
258
+		to="https://goo.gl/" />
259
+
260
+
261
+	<!--	Redirects to http when rewritten to www:
262
+							-->
263
+	<rule from="^http://books\.google\.com/"
264
+		to="https://encrypted.google.com/" />
265
+
266
+	<!--	tisp$ 404s:
267
+				-->
268
+	<rule from="^http://(?:www\.)?google\.((?:com?\.)?\w{2,3})/tisp(?=$|\?)"
269
+		to="https://www.google.$1/tisp/" />
270
+
271
+	<!--	Paths that work on all in google.*
272
+							-->
273
+	<rule from="^http://(?:www\.)?google\.((?:com?\.)?\w{2,3})/(accounts|adplanner|ads|adsense|adwords|analytics|bookmarks|chrome|contacts|coop|cse|css|culturalinstitute|doodles|earth|favicon\.ico|finance|get|goodtoknow|googleblogs|grants|green|hostednews|images|intl|js|landing|logos|mapmaker|newproducts|news|nexus|patents|policies|prdhp|profiles|products|reader|s2|settings|shopping|support|tisp|tools|transparencyreport|trends|urchin|webmasters)(?=$|[?/])"
274
+		 to="https://www.google.$1/$2" />
275
+
276
+	<!--	Paths that 404 on .ccltd, but work on .com:
277
+								-->
278
+	<rule from="^http://(?:www\.)?google\.(?:com?\.)?\w{2,3}/(?=calendar|dictionary|doubleclick|help|ideas|pacman|postini|powermeter|url)"
279
+		 to="https://www.google.com/" />
280
+
281
+	<rule from="^http://(?:www\.)?google\.(?:com?\.)?\w{2,3}/custom"
282
+		 to="https://www.google.com/cse" />
283
+
284
+	<!--	Paths that only exist/work on .com
285
+							-->
286
+	<rule from="^http://(?:www\.)?google\.com/(\+|appsstatus|books|buzz|extern_js|glass|googlebooks|ig|insights|moderator|phone|safebrowsing|videotargetting|webfonts)(?=$|[?/])"
287
+		to="https://www.google.com/$1" />
288
+
289
+	<!--	Subdomains that work on all in google.*
290
+							-->
291
+	<rule from="^http://(accounts|adwords|finance|groups|id|picasaweb|)\.google\.((?:com?\.)?\w{2,3})/"
292
+		to="https://$1.google.$2/" />
293
+
294
+	<!--	Subdomains that only exist/work on .com
295
+							-->
296
+	<rule from="^http://(apis|appengine|books|calendar|cbks0|chat|checkout|chrome|clients[12]|code|[\w-]+\.corp|developers|dl|docs\d?|\d\.docs|drive|encrypted|encrypted-tbn[123]|feedburner|fiber|fonts|gg|glass||health|helpouts|history|(?:hosted)?talkgadget|investor|lh\d|(?:chatenabled\.)?mail|pack|pki|play|plus(?:\.sandbox)?|plusone|productforums|profiles|safebrowsing-cache|cert-test\.sandbox|sb-ssl|script|security|services|servicessites|sites|spreadsheets\d?|support|talk|tools)\.google\.com/"
297
+		to="https://$1.google.com/" />
298
+
299
+	<exclusion pattern="^http://clients[0-9]\.google\.com/ocsp"/>
300
+
301
+	<rule from="^http://earth\.google\.com/"
302
+		to="https://www.google.com/earth/" />
303
+
304
+	<rule from="^http://scholar\.google\.((?:com?\.)?\w{2,3})/intl/"
305
+		to="https://www.google.$1/intl/" />
306
+
307
+	<rule from="^http://(?:encrypted-)?tbn2\.google\.com/"
308
+		to="https://encrypted-tbn2.google.com/" />
309
+
310
+
311
+	<rule from="^http://knoll?\.google\.com/"
312
+		to="https://knol.google.com/" />
313
+
314
+
315
+	<rule from="^http://news\.google\.(?:com?\.)?\w{2,3}/(?:$|news|newshp)"
316
+		to="https://www.google.com/news" />
317
+
318
+	<rule from="^http://trends\.google\.com/"
319
+		 to="https://www.google.com/trends" />
320
+
321
+
322
+	<rule from="^http://([^/:@\.]+\.)?googlecode\.com/"
323
+		 to="https://$1googlecode.com/" />
324
+
325
+	<rule from="^http://([^\./]\.)?googlesource\.com/"
326
+		to="https://$1googlesource.com/" />
327
+
328
+
329
+	<rule from="^http://partner\.googleadservices\.com/"
330
+		 to="https://partner.googleadservices.com/" />
331
+
332
+	<rule from="^http://(pagead2|tpc)\.googlesyndication\.com/"
333
+		 to="https://$1.googlesyndication.com/" />
334
+
335
+	<!--	!www doesn't exist.
336
+					-->
337
+	<rule from="^http://www\.googletagservices\.com/tag/js/"
338
+		to="https://www.googletagservices.com/tag/js/" />
339
+
340
+
341
+	<rule from="^http://([^@:\./]+)\.googleusercontent\.com/"
342
+		to="https://$1.googleusercontent.com/" />
343
+	
344
+
345
+</ruleset>

+ 28
- 0
searx/https_rules/GoogleShopping.xml Visa fil

@@ -0,0 +1,28 @@
1
+<!--
2
+	For other Google coverage, see GoogleServices.xml.
3
+
4
+-->
5
+<ruleset name="Google Shopping">
6
+
7
+	<target host="google.*" />
8
+	<target host="www.google.*" />
9
+	<target host="google.co.*" />
10
+	<target host="www.google.co.*" />
11
+	<target host="*.google.com" />
12
+	<target host="google.com.*" />
13
+	<target host="www.google.com.*" />
14
+
15
+
16
+	<rule from="^http://encrypted\.google\.com/(prdhp|shopping)" 
17
+		to="https://www.google.com/$1" />
18
+
19
+	<rule from="^http://shopping\.google\.com/"
20
+		to="https://shopping.google.com/" />
21
+
22
+	<rule from="^http://(?:encrypted|www)\.google\.com/(.*tbm=shop)"
23
+		to="https://www.google.com/$1" />
24
+
25
+	<rule from="^http://(?:www\.)?google\.((?:com?\.)?(?:ae|ar|at|au|bg|bh|bo|br|ca|ch|cl|cr|co|cu|de|ec|eg|es|fi|fr|gh|gt|hr|id|ie|il|in|it|jm|jo|jp|ke|kr|kw|kz|lb|lk|ly|mx|my|na|ng|nl|no|nz|om|pa|pe|pk|pl|pt|py|qa|ro|ru|rw|sa|sg|sl|se|sv|th|tr|ug|uk|uy|ve|vn|za|zw))/(?=prdhp|shopping)"
26
+		to="https://www.google.com/$1" />
27
+
28
+</ruleset>

+ 7
- 0
searx/https_rules/GoogleSorry.xml Visa fil

@@ -0,0 +1,7 @@
1
+<ruleset name="GoogleSorry">
2
+  <target host="sorry.google.com" />
3
+  <target host="www.google.com" />
4
+  <target host="google.com" />
5
+
6
+  <rule from="^http://((sorry|www)\.)?google\.com/sorry/" to="https://sorry.google.com/sorry/" />
7
+</ruleset>

+ 8
- 0
searx/https_rules/GoogleTranslate.xml Visa fil

@@ -0,0 +1,8 @@
1
+<ruleset name="Google Translate (broken)" default_off="redirect loops">
2
+  <target host="translate.googleapis.com" />
3
+  <target host="translate.google.com" />
4
+
5
+  <rule from="^http://translate\.googleapis\.com/" to="https://translate.googleapis.com/"/>
6
+  <rule from="^http://translate\.google\.com/"
7
+      to="https://translate.google.com/" />
8
+</ruleset>

+ 83
- 0
searx/https_rules/GoogleVideos.xml Visa fil

@@ -0,0 +1,83 @@
1
+<ruleset name="Google Videos">
2
+  <target host="*.google.com" />
3
+  <target host="google.com" />
4
+  <target host="www.google.com.*" />
5
+  <target host="google.com.*" />
6
+  <target host="www.google.co.*" />
7
+  <target host="google.co.*" />
8
+  <target host="www.google.*" />
9
+  <target host="google.*" />
10
+
11
+  <rule from="^http://encrypted\.google\.com/videohp" 
12
+          to="https://encrypted.google.com/videohp" />
13
+
14
+  <!-- https://videos.google.com is currently broken; work around that... -->
15
+  <rule from="^https?://videos?\.google\.com/$"
16
+          to="https://encrypted.google.com/videohp" />
17
+  <rule from="^http://(?:www\.)?google\.com/videohp"
18
+	  to="https://encrypted.google.com/videohp" />
19
+  <rule from="^http://(?:images|www|encrypted)\.google\.com/(.*tbm=isch)"
20
+          to="https://encrypted.google.com/$1" />
21
+
22
+  <rule
23
+   from="^http://(?:www\.)?google\.(?:com?\.)?(?:au|ca|gh|ie|in|jm|ke|lk|my|na|ng|nz|pk|rw|sl|sg|ug|uk|za|zw)/videohp"
24
+     to="https://encrypted.google.com/videohp" />
25
+  <rule
26
+   from="^http://(?:www\.)?google\.(?:com?\.)?(?:ar|bo|cl|co|cu|cr|ec|es|gt|mx|pa|pe|py|sv|uy|ve)/videohp$"
27
+    to="https://encrypted.google.com/videohp?hl=es" />
28
+  <rule
29
+   from="^http://(?:www\.)?google\.(?:com\.)?(?:ae|bh|eg|jo|kw|lb|ly|om|qa|sa)/videohp$"
30
+     to="https://encrypted.google.com/videohp?hl=ar" />
31
+  <rule from="^http://(?:www\.)?google\.(?:at|ch|de)/videohp$"
32
+          to="https://encrypted.google.com/videohp?hl=de" />
33
+  <rule from="^http://(?:www\.)?google\.(fr|nl|it|pl|ru|bg|pt|ro|hr|fi|no)/videohp$"
34
+          to="https://encrypted.google.com/videohp?hl=$1" />
35
+  <rule from="^http://(?:www\.)?google\.com?\.(id|th|tr)/videohp$"
36
+          to="https://encrypted.google.com/videohp?hl=$1" />
37
+  <rule from="^http://(?:www\.)?google\.com\.il/videohp$"
38
+          to="https://encrypted.google.com/videohp?hl=he" />
39
+  <rule from="^http://(?:www\.)?google\.com\.kr/videohp$"
40
+          to="https://encrypted.google.com/videohp?hl=ko" />
41
+  <rule from="^http://(?:www\.)?google\.com\.kz/videohp$"
42
+          to="https://encrypted.google.com/videohp?hl=kk" />
43
+  <rule from="^http://(?:www\.)?google\.com\.jp/videohp$"
44
+          to="https://encrypted.google.com/videohp?hl=ja" />
45
+  <rule from="^http://(?:www\.)?google\.com\.vn/videohp$"
46
+          to="https://encrypted.google.com/videohp?hl=vi" />
47
+  <rule from="^http://(?:www\.)?google\.com\.br/videohp$"
48
+          to="https://encrypted.google.com/videohp?hl=pt-BR" />
49
+  <rule from="^http://(?:www\.)?google\.se/videohp$"
50
+          to="https://encrypted.google.com/videohp?hl=sv" />
51
+
52
+<!-- If there are URL parameters, keep them. -->
53
+  <rule
54
+   from="^http://(?:www\.)?google\.(?:com?\.)?(?:ar|bo|cl|co|cu|cr|ec|es|gt|mx|pa|pe|py|sv|uy|ve)/videohp\?"
55
+    to="https://encrypted.google.com/videohp?hl=es&#38;" />
56
+  <rule
57
+   from="^http://(?:www\.)?google\.(?:com\.)?(?:ae|bh|eg|jo|kw|lb|ly|om|qa|sa)/videohp\?"
58
+     to="https://encrypted.google.com/videohp?hl=ar&#38;" />
59
+  <rule from="^http://(?:www\.)?google\.(?:at|ch|de)/videohp\?"
60
+          to="https://encrypted.google.com/videohp?hl=de&#38;" />
61
+  <rule from="^http://(?:www\.)?google\.(fr|nl|it|pl|ru|bg|pt|ro|hr|fi|no)/videohp\?"
62
+          to="https://encrypted.google.com/videohp?hl=$1&#38;" />
63
+  <rule from="^http://(?:www\.)?google\.com?\.(id|th|tr)/videohp\?"
64
+          to="https://encrypted.google.com/videohp?hl=$1&#38;" />
65
+  <rule from="^http://(?:www\.)?google\.com\.il/videohp\?"
66
+          to="https://encrypted.google.com/videohp?hl=he&#38;" />
67
+  <rule from="^http://(?:www\.)?google\.com\.kr/videohp\?"
68
+          to="https://encrypted.google.com/videohp?hl=ko&#38;" />
69
+  <rule from="^http://(?:www\.)?google\.com\.kz/videohp\?"
70
+          to="https://encrypted.google.com/videohp?hl=kk&#38;" />
71
+  <rule from="^http://(?:www\.)?google\.com\.jp/videohp\?"
72
+          to="https://encrypted.google.com/videohp?hl=ja&#38;" />
73
+  <rule from="^http://(?:www\.)?google\.com\.vn/videohp\?"
74
+          to="https://encrypted.google.com/videohp?hl=vi&#38;" />
75
+  <rule from="^http://(?:www\.)?google\.com\.br/videohp\?"
76
+          to="https://encrypted.google.com/videohp?hl=pt-BR&#38;" />
77
+  <rule from="^http://(?:www\.)?google\.se/videohp\?"
78
+          to="https://encrypted.google.com/videohp?hl=sv&#38;" />
79
+
80
+	<rule from="^http://video\.google\.com/ThumbnailServer2"
81
+		to="https://video.google.com/ThumbnailServer2" />
82
+
83
+</ruleset>

+ 17
- 0
searx/https_rules/GoogleWatchBlog.xml Visa fil

@@ -0,0 +1,17 @@
1
+<!--
2
+	gwbhrd.appspot.com
3
+
4
+-->
5
+<ruleset name="GoogleWatchBlog">
6
+
7
+	<target host="googlewatchblog.de" />
8
+	<target host="*.googlewatchblog.de" />
9
+
10
+
11
+	<securecookie host="^(?:www)?\.googlewatchblog\.de$" name=".+" />
12
+
13
+
14
+	<rule from="^http://(static\.|www\.)?googlewatchblog\.de/"
15
+		to="https://$1googlewatchblog.de/" />
16
+
17
+</ruleset>

+ 21
- 0
searx/https_rules/Google_App_Engine.xml Visa fil

@@ -0,0 +1,21 @@
1
+<!--
2
+	For other Google coverage, see GoogleServices.xml.
3
+
4
+-->
5
+<ruleset name="Google App Engine">
6
+
7
+	<target host="appspot.com" />
8
+	<target host="*.appspot.com" />
9
+		<!--
10
+			Redirects to http for some reason.
11
+								-->
12
+		<exclusion pattern="^http://photomunchers\.appspot\.com/" />
13
+
14
+
15
+	<securecookie host="^.+\.appspot\.com$" name=".+" />
16
+
17
+
18
+	<rule from="^http://([^@:\./]+\.)?appspot\.com/"
19
+		 to="https://$1appspot.com/" />
20
+
21
+</ruleset>

+ 16
- 0
searx/https_rules/Googleplex.com.xml Visa fil

@@ -0,0 +1,16 @@
1
+<!-- This rule was automatically generated based on an HSTS
2
+     preload rule in the Chromium browser.  See 
3
+     https://src.chromium.org/viewvc/chrome/trunk/src/net/base/transport_security_state.cc
4
+     for the list of preloads.  Sites are added to the Chromium HSTS
5
+     preload list on request from their administrators, so HTTPS should
6
+     work properly everywhere on this site.
7
+ 
8
+     Because Chromium and derived browsers automatically force HTTPS for
9
+     every access to this site, this rule applies only to Firefox. -->
10
+<ruleset name="Googleplex.com (default off)" platform="firefox" default_off="Certificate error">
11
+  <target host="googleplex.com" />
12
+
13
+  <securecookie host="^googleplex\.com$" name=".+" />
14
+
15
+  <rule from="^http://googleplex\.com/" to="https://googleplex.com/" />
16
+</ruleset>

+ 15
- 0
searx/https_rules/OpenStreetMap.xml Visa fil

@@ -0,0 +1,15 @@
1
+<ruleset name="OpenStreetMap">
2
+
3
+	<target host="openstreetmap.org"/>
4
+	<target host="*.openstreetmap.org"/>
5
+
6
+	<rule from="^http://(?:www\.)?openstreetmap\.org/"
7
+		to="https://www.openstreetmap.org/"/>
8
+
9
+	<rule from="^http://tile\.openstreetmap\.org/"
10
+		to="https://a.tile.openstreetmap.org/"/>
11
+
12
+	<rule from="^http://(blog|help|lists|nominatim|piwik|taginfo|[abc]\.tile|trac|wiki)\.openstreetmap\.org/"
13
+		to="https://$1.openstreetmap.org/"/>
14
+
15
+</ruleset>

+ 14
- 0
searx/https_rules/Rawgithub.com.xml Visa fil

@@ -0,0 +1,14 @@
1
+<!--
2
+	www: cert only matches ^rawgithub.com
3
+
4
+-->
5
+<ruleset name="rawgithub.com">
6
+
7
+	<target host="rawgithub.com" />
8
+	<target host="www.rawgithub.com" />
9
+
10
+
11
+	<rule from="^http://(?:www\.)?rawgithub\.com/"
12
+		to="https://rawgithub.com/" />
13
+
14
+</ruleset>

+ 101
- 0
searx/https_rules/Soundcloud.xml Visa fil

@@ -0,0 +1,101 @@
1
+<!--
2
+
3
+	CDN buckets:
4
+
5
+		- akmedia-a.akamaihd.net
6
+
7
+		- soundcloud.assistly.com
8
+
9
+			- help.soundcloud.com
10
+
11
+		- cs70.wac.edgecastcdn.net
12
+
13
+			- a1.sndcdn.com
14
+			- i1.sndcdn.com
15
+			- w1.sndcdn.com
16
+
17
+		- wpc.658D.edgecastcdn.net
18
+		- m-a.sndcdn.com.edgesuite.net 
19
+		- soundcloud.gettyimages.com
20
+
21
+		- scbackstage.wpengine.netdna-cdn.com
22
+
23
+			- ssl doesn't exist
24
+			- backstage.soundcloud.com
25
+
26
+		- soundcloud.wpengine.netdna-cdn.com
27
+
28
+			- -ssl doesn't exist
29
+			- blog.soundcloud.com
30
+
31
+		- gs1.wpc.v2cdn.netcdn.net
32
+		- gs1.wpc.v2cdn.net
33
+
34
+			- ec-media.soundcloud.com
35
+
36
+	Nonfunctional soundcloud.com subdomains:
37
+
38
+		- help		(redirects to http, mismatched, CN: *.assistly.com)
39
+		- m		(redirects to http)
40
+		- media
41
+		- status	(times out)
42
+
43
+
44
+	Problematic domains:
45
+
46
+		- m-a.sndcdn.com	(works, akamai)
47
+
48
+
49
+	Partially covered domains:
50
+
51
+		- backstage.soundcloud.com
52
+
53
+
54
+	Fully covered domains:
55
+
56
+		- sndcdn.com subdomains:
57
+
58
+			- a[12]
59
+			- api
60
+			- i[1-4]
61
+			- w[12]
62
+			- wis
63
+
64
+		- soundcloud.com subdomains:
65
+
66
+			- (www.)
67
+			- api
68
+			- blog
69
+			- connect
70
+			- developers
71
+			- ec-media
72
+			- eventlogger
73
+			- help-assets
74
+			- media
75
+			- visuals
76
+			- w
77
+
78
+-->
79
+<ruleset name="Soundcloud (partial)">
80
+
81
+	<target host="scbackstage.wpengine.netdna-cdn.com" />
82
+	<target host="soundcloud.wpengine.netdna-cdn.com" />
83
+	<target host="*.sndcdn.com" />
84
+	<target host="soundcloud.com" />
85
+	<target host="*.soundcloud.com" />
86
+		<exclusion pattern="^https?://(?:scbackstage\.wpengine\.netdna-cdn|backstage\.soundcloud)\.com/(?!wp-content/)" />
87
+
88
+
89
+	<rule from="^http://([aiw]\d|api|wis)\.sndcdn\.com/"
90
+		to="https://$1.sndcdn.com/" />
91
+
92
+	<rule from="^http://((?:api|backstage|blog|connect|developers|ec-media|eventlogger|help-assets|media|visuals|w|www)\.)?soundcloud\.com/"
93
+		to="https://$1soundcloud.com/" />
94
+
95
+	<rule from="^https?://scbackstage\.wpengine\.netdna-cdn\.com/"
96
+		to="https://backstage.soundcloud.com/" />
97
+
98
+	<rule from="^https?://soundcloud\.wpengine\.netdna-cdn\.com/"
99
+		to="https://blog.soundcloud.com/" />
100
+
101
+</ruleset>

+ 36
- 0
searx/https_rules/ThePirateBay.xml Visa fil

@@ -0,0 +1,36 @@
1
+<!--
2
+  Nonfunctional:
3
+
4
+    - image.bayimg.com
5
+    - (www.)thepiratebay.sx		(http reply)
6
+
7
+
8
+  For problematic rules, see ThePirateBay-mismatches.xml.
9
+
10
+-->
11
+<ruleset name="The Pirate Bay (partial)">
12
+
13
+  <target host="suprbay.org" />
14
+  <target host="*.suprbay.org" />
15
+  <!--	* for cross-domain cookie	-->
16
+  <target host="*.forum.suprbay.org" />
17
+  <target host="thepiratebay.org"/>
18
+  <target host="*.thepiratebay.org"/>
19
+  <target host="thepiratebay.se"/>
20
+  <target host="*.thepiratebay.se"/>
21
+
22
+  <securecookie host="^.*\.suprbay\.org$" name=".*" />
23
+  <securecookie host="^(.*\.)?thepiratebay\.se$" name=".*"/>
24
+
25
+
26
+  <!--	Cert doesn't match (www.), redirects like so.	-->
27
+  <rule from="^https?://(?:forum\.|www\.)?suprbay\.org/"
28
+    to="https://forum.suprbay.org/" />
29
+
30
+  <rule from="^http://(?:www\.)?thepiratebay\.(?:org|se)/"
31
+    to="https://thepiratebay.se/"/>
32
+
33
+  <rule from="^http://(rss|static|torrents)\.thepiratebay\.(?:org|se)/"
34
+    to="https://$1.thepiratebay.se/"/>
35
+
36
+</ruleset>

+ 18
- 0
searx/https_rules/Torproject.xml Visa fil

@@ -0,0 +1,18 @@
1
+<ruleset name="Tor Project">
2
+
3
+	<target host="torproject.org" />
4
+	<target host="*.torproject.org" />
5
+		<exclusion pattern="^http://torperf\.torproject\.org/" />
6
+
7
+
8
+	<!--	Not secured by server:
9
+					-->
10
+	<!--securecookie host="^\.blog\.torproject\.org$" name="^SESS[0-9a-f]{32}$" /-->
11
+
12
+	<securecookie host="^(?:.*\.)?torproject\.org$" name=".+" />
13
+
14
+
15
+	<rule from="^http://([^/:@\.]+\.)?torproject\.org/"
16
+		 to="https://$1torproject.org/" />
17
+
18
+</ruleset>

+ 169
- 0
searx/https_rules/Twitter.xml Visa fil

@@ -0,0 +1,169 @@
1
+<!--
2
+	Other Twitter rulesets:
3
+
4
+		- Twitter_Community.com.xml
5
+
6
+
7
+	Nonfunctional domains:
8
+
9
+		- status.twitter.com *
10
+		- status.twitter.jp *
11
+
12
+	* Tumblr
13
+
14
+
15
+	CDN buckets:
16
+
17
+		- a1095.g.akamai.net/=/1095/134446/1d/platform.twitter.com/ | platform2.twitter.com.edgesuite.net
18
+
19
+			- platform2.twitter.com
20
+
21
+		- twitter-any.s3.amazonaws.com
22
+		- twitter-blog.s3.amazonaws.com
23
+
24
+		- d2rdfnizen5apl.cloudfront.net
25
+
26
+			- s.twimg.com
27
+
28
+		- ssl2.twitter.com.edgekey.net
29
+		- twitter.github.com
30
+
31
+
32
+	Problematic domains:
33
+
34
+		- twimg.com subdomains:
35
+
36
+			- a5 *
37
+			- s		(cloudfront)
38
+
39
+		- twitter.com subdomains:
40
+
41
+			- platform[0-3]		(403, akamai)
42
+
43
+	* akamai
44
+
45
+
46
+	Fully covered domains:
47
+
48
+		- (www.)t.co		(www → ^)
49
+
50
+		- twimg.com subdomains:
51
+
52
+			- a[5-9]	(→ si0)
53
+			- a\d
54
+			- abs
55
+			- dnt
56
+			- ea
57
+			- g
58
+			- g2
59
+			- gu
60
+			- hca
61
+			- jp
62
+			- ma
63
+			- ma[0123]
64
+			- o
65
+			- p
66
+			- pbs
67
+			- r
68
+			- s		(→ d2rdfnizen5apl.cloudfront.net)
69
+			- si[0-5]
70
+			- syndication
71
+			- cdn.syndication
72
+			- tailfeather
73
+			- ton
74
+			- v
75
+			- widgets
76
+
77
+		- twitter.com subdomains:
78
+
79
+			- (www.)
80
+			- 201[012]
81
+			- about
82
+			- ads
83
+			- analytics
84
+			- api
85
+			- cdn.api
86
+			- urls.api
87
+			- blog
88
+			- business
89
+			- preview.cdn
90
+			- preview-dev.cdn
91
+			- preview-stage.cdn
92
+			- de
93
+			- dev
94
+			- en
95
+			- engineering
96
+			- es
97
+			- firefox
98
+			- fr
99
+			- it
100
+			- ja
101
+			- jp
102
+			- m
103
+			- media
104
+			- mobile
105
+			- music
106
+			- oauth
107
+			- p
108
+			- pic
109
+			- platform
110
+			- platform[0-3]		(→ platform)
111
+			- widgets.platform
112
+			- search
113
+			- static
114
+			- support
115
+			- transparency
116
+			- upload
117
+
118
+
119
+	These altnames don't exist:
120
+
121
+		- i3.twimg.com
122
+		- p-dev.twimg.com
123
+		- vmtc.twimg.com
124
+
125
+		- cdn-dev.api.twitter.com
126
+
127
+-->
128
+<ruleset name="Twitter">
129
+
130
+	<target host="t.co" />
131
+	<target host="*.t.co" />
132
+	<target host="*.twimg.com" />
133
+	<target host="twitter.com" />
134
+	<target host="*.twitter.com" />
135
+
136
+
137
+	<!--	Secured by server:
138
+					-->
139
+	<!--securecookie host="^\.twitter\.com$" name="^_twitter_sess$" /-->
140
+	<!--securecookie host="^support\.twitter\.com$" name="^_help_center_session$" /-->
141
+	<!--
142
+		Not secured by server:
143
+					-->
144
+	<!--securecookie host="^\.t\.co$" name="^muc$" /-->
145
+	<!--securecookie host="^\.twitter\.com$" name="^guest_id$" /-->
146
+
147
+	<securecookie host="^\.t\.co$" name=".+" />
148
+	<securecookie host="^(?:.*\.)?twitter\.com$" name=".+" />
149
+
150
+
151
+	<rule from="^http://(?:www\.)?t\.co/"
152
+		to="https://t.co/" />
153
+
154
+	<rule from="^http://a[5-9]\.twimg\.com/"
155
+		to="https://si0.twimg.com/" />
156
+
157
+	<rule from="^http://(abs|a\d|dnt|ea|g[2u]?|hca|jp|ma\d?|o|p|pbs|r|si\d|(?:cdn\.)?syndication|tailfeather|ton|v|widgets)\.twimg\.com/"
158
+		to="https://$1.twimg.com/" />
159
+
160
+	<rule from="^http://s\.twimg\.com/"
161
+		to="https://d2rdfnizen5apl.cloudfront.net/" />
162
+
163
+	<rule from="^http://((?:201\d|about|ads|analytics|blog|(?:cdn\.|urls\.)?api|business|preview(?:-dev|-stage)?\.cdn|de|dev|engineering|en|es|firefox|fr|it|ja|jp|m|media|mobile|music|oauth|p|pic|platform|widgets\.platform|search|static|support|transparency|upload|www)\.)?twitter\.com/"
164
+		to="https://$1twitter.com/" />
165
+
166
+	<rule from="^http://platform\d\.twitter\.com/"
167
+		to="https://platform.twitter.com/" />
168
+
169
+</ruleset>

+ 75
- 0
searx/https_rules/Vimeo.xml Visa fil

@@ -0,0 +1,75 @@
1
+<!--
2
+	CDN buckets:
3
+
4
+		- av.vimeo.com.edgesuite.net
5
+
6
+			- a808.g.akamai.net
7
+
8
+		- pdl.vimeocdn.com.edgesuite.net
9
+
10
+			- a1189.g.akamai.net
11
+
12
+
13
+	Problematic subdomains:
14
+
15
+		- av	(pdl.../crossdomain.xml restricts to port 80)
16
+		- pdl	(works, akamai)
17
+
18
+
19
+	Partially covered subdomains:
20
+
21
+		- developer	(some pages redirect to http)
22
+		- pdl		(→ akamai)
23
+
24
+
25
+	Fully covered subdomains:
26
+
27
+		- (www.)
28
+		- secure
29
+
30
+
31
+Default off per https://trac.torproject.org/projects/tor/ticket/7569 -->
32
+<ruleset name="Vimeo (default off)" default_off="breaks some video embedding">
33
+
34
+	<target host="vimeo.com" />
35
+	<target host="*.vimeo.com" />
36
+		<exclusion pattern="^http://av\.vimeo\.com/crossdomain\.xml" />
37
+		<!--exclusion pattern="^http://developer\.vimeo\.com/($|\?|(apps|guidelines|help|player)($|[?/]))" /-->
38
+		<exclusion pattern="^http://developer\.vimeo\.com/(?!apis(?:$|[?/])|favicon\.ico)" />
39
+	<target host="*.vimeocdn.com" />
40
+		<!--
41
+			Uses crossdomain.xml from s3.amazonaws.com, which sets secure="false"
42
+
43
+				https://mail1.eff.org/pipermail/https-everywhere/2012-October/001583.html
44
+			-->
45
+		<exclusion pattern="^http://a\.vimeocdn\.com/p/flash/moogaloop/" />
46
+
47
+		<!--	We cannot secure streams because crossdomain.xml
48
+			restricts to port 80 :(
49
+						-->
50
+		<exclusion pattern="^http://pdl\.vimeocdn\.com/(?!crossdomain\.xml)" />
51
+
52
+
53
+	<!--	Tracking cookies:
54
+					-->
55
+	<securecookie host="^\.(?:player\.)?vimeo\.com$" name="^__utm\w$" />
56
+
57
+
58
+	<rule from="^http://((?:developer|player|secure|www)\.)?vimeo\.com/"
59
+		to="https://$1vimeo.com/" />
60
+
61
+	<rule from="^http://av\.vimeo\.com/"
62
+		to="https://a248.e.akamai.net/f/808/9207/8m/av.vimeo.com/" />
63
+
64
+	<!--	a & b: Akamai	-->
65
+	<rule from="^http://(?:secure-)?([ab])\.vimeocdn\.com/"
66
+		to="https://secure-$1.vimeocdn.com/" />
67
+
68
+	<rule from="^http://i\.vimeocdn\.com/"
69
+		to="https://i.vimeocdn.com/" />
70
+
71
+	<rule from="^http://pdl\.vimeocdn\.com/"
72
+		to="https://a248.e.akamai.net/f/1189/4415/8d/pdl.vimeocdn.com/" />
73
+
74
+</ruleset>
75
+

+ 13
- 0
searx/https_rules/WikiLeaks.xml Visa fil

@@ -0,0 +1,13 @@
1
+<ruleset name="WikiLeaks">
2
+
3
+	<target host="wikileaks.org" />
4
+	<target host="*.wikileaks.org" />
5
+
6
+
7
+	<securecookie host="^(?:w*\.)?wikileaks\.org$" name=".+" />
8
+
9
+
10
+	<rule from="^http://((?:chat|search|shop|www)\.)?wikileaks\.org/"
11
+		to="https://$1wikileaks.org/" />
12
+
13
+</ruleset>

+ 107
- 0
searx/https_rules/Wikimedia.xml Visa fil

@@ -0,0 +1,107 @@
1
+<!--
2
+	Wikipedia and other Wikimedia Foundation wikis previously had no real HTTPS support, and
3
+	URLs had to be rewritten to https://secure.wikimedia.org/$wikitype/$language/ . This is no
4
+	longer the case, see https://blog.wikimedia.org/2011/10/03/native-https-support-enabled-for-all-wikimedia-foundation-wikis/ ,
5
+	so this file is a lot simpler these days.
6
+
7
+
8
+	Mixed content:
9
+
10
+		- Images, on:
11
+
12
+			- stats.wikimedia.org from upload.wikimedia.org *
13
+			- stats.wikimedia.org from wikimediafoundation.org *
14
+
15
+	* Secured by us
16
+
17
+-->
18
+<ruleset name="Wikimedia">
19
+
20
+	<target host="enwp.org" />
21
+	<target host="frwp.org" />
22
+
23
+	<target host="mediawiki.org" />
24
+	<target host="www.mediawiki.org" />
25
+	<target host="wikimedia.org" />
26
+	<target host="*.wikimedia.org" />
27
+		<exclusion pattern="^http://(?:apt|cs|cz|parsoid-lb\.eqiad|status|torrus|ubuntu)\.wikimedia\.org" />
28
+		<!-- https://mail1.eff.org/pipermail/https-everywhere-rules/2012-June/001189.html -->
29
+		<exclusion pattern="^http://lists\.wikimedia\.org/pipermail(?:$|/)" />
30
+	<target host="wikimediafoundation.org" />
31
+	<target host="www.wikimediafoundation.org" />
32
+
33
+	<!-- Wikimedia projects (also some wikimedia.org subdomains) -->
34
+	<target host="wikibooks.org" />
35
+	<target host="*.wikibooks.org" />
36
+	<target host="wikidata.org" />
37
+	<target host="*.wikidata.org" />
38
+	<target host="wikinews.org" />
39
+	<target host="*.wikinews.org" />
40
+	<target host="wikipedia.org" />
41
+	<target host="*.wikipedia.org" />
42
+	<target host="wikiquote.org" />
43
+	<target host="*.wikiquote.org" />
44
+	<target host="wikisource.org" />
45
+	<target host="*.wikisource.org" />
46
+	<target host="wikiversity.org" />
47
+	<target host="*.wikiversity.org" />
48
+	<target host="wikivoyage.org" />
49
+	<target host="*.wikivoyage.org" />
50
+	<target host="wiktionary.org" />
51
+	<target host="*.wiktionary.org" />
52
+
53
+	<!-- Wikimedia chapters -->
54
+	<target host="wikimedia.ca" />
55
+	<target host="www.wikimedia.ca" />
56
+
57
+	<!-- Wikimedia Tool Labs -->
58
+	<target host="tools.wmflabs.org" />
59
+	<target host="icinga.wmflabs.org" />
60
+	<target host="ganglia.wmflabs.org" />
61
+
62
+	<!--	Not secured by server:
63
+					-->
64
+	<!--securecookie host="^\.wiki(books|ipedia)\.org$" name="^GeoIP$" /-->
65
+
66
+	<securecookie host="^^\.wik(?:ibooks|idata|imedia|inews|ipedia|iquote|isource|iversity|ivoyage|tionary)\.org$" name="^GeoIP$" />
67
+	<securecookie host="^([^@:/]+\.)?wik(ibooks|idata|inews|ipedia|iquote|isource|iversity|ivoyage|tionary)\.org$" name=".*" />
68
+	<securecookie host="^(species|commons|meta|incubator|wikitech).wikimedia.org$" name=".*" />
69
+	<securecookie host="^(?:www\.)?mediawiki\.org$" name=".*" />
70
+	<securecookie host="^wikimediafoundation.org$" name=".*" />
71
+
72
+	<rule from="^http://(en|fr)wp\.org/"
73
+		to="https://$1.wikipedia.org/wiki/" />
74
+
75
+	<rule from="^http://(?:www\.)?mediawiki\.org/"
76
+		to="https://www.mediawiki.org/" />
77
+
78
+	<rule from="^https?://download\.wikipedia\.org/"
79
+		to="https://dumps.wikimedia.org/" />
80
+
81
+	<rule from="^https?://(download|dataset2|sitemap)\.wikimedia\.org/"
82
+		to="https://dumps.wikimedia.org/" />
83
+
84
+	<rule from="^https?://(labs-ns[01]|virt0)\.wikimedia\.org/"
85
+		to="https://wikitech.wikimedia.org/" />	
86
+
87
+	<rule from="^https?://noboard\.chapters\.wikimedia\.org/"
88
+		to="https://noboard-chapters.wikimedia.org/" />
89
+
90
+	<rule from="^https?://wg\.en\.wikipedia\.org/"
91
+		to="https://wg-en.wikipedia.org/" />
92
+
93
+	<rule from="^https?://arbcom\.(de|en|fi|nl)\.wikipedia\.org/"
94
+		to="https://arbcom-$1.wikipedia.org/" />
95
+
96
+	<rule from="^http://([^@:/]+\.)?wik(ibooks|idata|imedia|inews|ipedia|iquote|isource|iversity|ivoyage|tionary)\.org/"
97
+		to="https://$1wik$2.org/" />
98
+
99
+	<rule from="^http://(www\.)?wikimediafoundation\.org/"
100
+		to="https://$1wikimediafoundation.org/" />
101
+
102
+	<rule from="^http://(www\.)?wikimedia\.ca/"
103
+		to="https://wikimedia.ca/" />
104
+
105
+	<rule from="^http://([^@:/]+)\.wmflabs\.org/"
106
+		to="https://$1.wmflabs.org/" />
107
+</ruleset>

+ 2450
- 0
searx/https_rules/Yahoo.xml
Filskillnaden har hållits tillbaka eftersom den är för stor
Visa fil


+ 46
- 0
searx/https_rules/YouTube.xml Visa fil

@@ -0,0 +1,46 @@
1
+<ruleset name="YouTube (partial)">
2
+
3
+	<target host="youtube.com" />
4
+	<target host="*.youtube.com" />
5
+		<exclusion pattern="^http://(?:www\.)?youtube\.com/crossdomain\.xml"/>
6
+		<exclusion pattern="^http://(?:www\.)?youtube\.com/(?:apiplayer|api_video_info)"/>
7
+        <exclusion pattern="^http://(?:[^/@:\.]+\.)?ytimg\.com/.*apiplayer[0-9]*\.swf"/>
8
+	<target host="*.ytimg.com" />
9
+	<target host="youtu.be" />
10
+	<target host="youtube-nocookie.com"/>
11
+	<target host="www.youtube-nocookie.com"/>
12
+	<target host="*.googlevideo.com"/>
13
+                <exclusion pattern="^http://([^/@:\.]+)\.googlevideo\.com/crossdomain\.xml"/>
14
+
15
+
16
+	<!--	Not secured by server:
17
+					-->
18
+	<!--securecookie host="^\.youtube\.com$" name="^(GEUP|PREF|VISITOR_INFO1_LIVE|YSC)$" /-->
19
+
20
+	<!--	observed ^. cookies:
21
+			- use_hitbox
22
+			- VISITOR_INFO1_LIVE
23
+			- recently_watched_video_id_list
24
+			- .youtube.com		-->
25
+	<securecookie host="^\.youtube\.com" name=".*"/>
26
+
27
+
28
+	<rule from="^http://(www\.)?youtube\.com/"
29
+		to="https://$1youtube.com/"/>
30
+
31
+	<rule from="^http://(br|de|es|fr|il|img|insight|jp|m|nl|uk)\.youtube\.com/"
32
+		to="https://$1.youtube.com/"/>
33
+
34
+	<rule from="^http://([^/@:\.]+)\.ytimg\.com/"
35
+		to="https://$1.ytimg.com/"/>
36
+
37
+	<rule from="^http://youtu\.be/"
38
+		to="https://youtu.be/"/>
39
+
40
+	<rule from="^http://(?:www\.)?youtube-nocookie\.com/"
41
+		to="https://www.youtube-nocookie.com/"/>
42
+
43
+	<rule from="^http://([^/@:\.]+)\.googlevideo\.com/"
44
+	        to="https://$1.googlevideo.com/"/>
45
+
46
+</ruleset>

+ 23
- 20
searx/query.py Visa fil

@@ -31,30 +31,31 @@ class Query(object):
31 31
     def __init__(self, query, blocked_engines):
32 32
         self.query = query
33 33
         self.blocked_engines = []
34
-        
34
+
35 35
         if blocked_engines:
36 36
             self.blocked_engines = blocked_engines
37
-            
37
+
38 38
         self.query_parts = []
39 39
         self.engines = []
40 40
         self.languages = []
41
-    
42
-    # parse query, if tags are set, which change the serch engine or search-language
41
+
42
+    # parse query, if tags are set, which
43
+    # change the serch engine or search-language
43 44
     def parse_query(self):
44 45
         self.query_parts = []
45
-        
46
+
46 47
         # split query, including whitespaces
47 48
         raw_query_parts = re.split(r'(\s+)', self.query)
48
-        
49
+
49 50
         parse_next = True
50
-        
51
+
51 52
         for query_part in raw_query_parts:
52 53
             if not parse_next:
53 54
                 self.query_parts[-1] += query_part
54 55
                 continue
55
-           
56
+
56 57
             parse_next = False
57
-           
58
+
58 59
             # part does only contain spaces, skip
59 60
             if query_part.isspace()\
60 61
                or query_part == '':
@@ -62,15 +63,17 @@ class Query(object):
62 63
                 self.query_parts.append(query_part)
63 64
                 continue
64 65
 
65
-            # this force a language            
66
+            # this force a language
66 67
             if query_part[0] == ':':
67 68
                 lang = query_part[1:].lower()
68 69
 
69
-                # check if any language-code is equal with declared language-codes
70
+                # check if any language-code is equal with
71
+                # declared language-codes
70 72
                 for lc in language_codes:
71 73
                     lang_id, lang_name, country = map(str.lower, lc)
72 74
 
73
-                    # if correct language-code is found, set it as new search-language
75
+                    # if correct language-code is found
76
+                    # set it as new search-language
74 77
                     if lang == lang_id\
75 78
                        or lang_id.startswith(lang)\
76 79
                        or lang == lang_name\
@@ -89,23 +92,24 @@ class Query(object):
89 92
                     parse_next = True
90 93
                     self.engines.append({'category': 'none',
91 94
                                          'name': engine_shortcuts[prefix]})
92
-                
95
+
93 96
                 # check if prefix is equal with engine name
94 97
                 elif prefix in engines\
95
-                        and not prefix in self.blocked_engines:
98
+                        and prefix not in self.blocked_engines:
96 99
                     parse_next = True
97 100
                     self.engines.append({'category': 'none',
98 101
                                         'name': prefix})
99 102
 
100 103
                 # check if prefix is equal with categorie name
101 104
                 elif prefix in categories:
102
-                    # using all engines for that search, which are declared under that categorie name
105
+                    # using all engines for that search, which
106
+                    # are declared under that categorie name
103 107
                     parse_next = True
104 108
                     self.engines.extend({'category': prefix,
105 109
                                         'name': engine.name}
106 110
                                         for engine in categories[prefix]
107
-                                        if not engine in self.blocked_engines)
108
-          
111
+                                        if engine not in self.blocked_engines)
112
+
109 113
             # append query part to query_part list
110 114
             self.query_parts.append(query_part)
111 115
 
@@ -114,14 +118,13 @@ class Query(object):
114 118
             self.query_parts[-1] = search_query
115 119
         else:
116 120
             self.query_parts.append(search_query)
117
-            
121
+
118 122
     def getSearchQuery(self):
119 123
         if len(self.query_parts):
120 124
             return self.query_parts[-1]
121 125
         else:
122 126
             return ''
123
-    
127
+
124 128
     def getFullQuery(self):
125 129
         # get full querry including whitespaces
126 130
         return string.join(self.query_parts, '')
127
-

+ 72
- 42
searx/search.py Visa fil

@@ -22,7 +22,7 @@ from datetime import datetime
22 22
 from operator import itemgetter
23 23
 from urlparse import urlparse, unquote
24 24
 from searx.engines import (
25
-    categories, engines, engine_shortcuts
25
+    categories, engines
26 26
 )
27 27
 from searx.languages import language_codes
28 28
 from searx.utils import gen_useragent
@@ -39,7 +39,13 @@ def default_request_params():
39 39
 
40 40
 
41 41
 # create a callback wrapper for the search engine results
42
-def make_callback(engine_name, results, suggestions, answers, infoboxes, callback, params):
42
+def make_callback(engine_name,
43
+                  results,
44
+                  suggestions,
45
+                  answers,
46
+                  infoboxes,
47
+                  callback,
48
+                  params):
43 49
 
44 50
     # creating a callback wrapper for the search engine results
45 51
     def process_callback(response, **kwargs):
@@ -95,7 +101,7 @@ def make_callback(engine_name, results, suggestions, answers, infoboxes, callbac
95 101
 def content_result_len(content):
96 102
     if isinstance(content, basestring):
97 103
         content = re.sub('[,;:!?\./\\\\ ()-_]', '', content)
98
-        return len(content) 
104
+        return len(content)
99 105
     else:
100 106
         return 0
101 107
 
@@ -126,7 +132,8 @@ def score_results(results):
126 132
 
127 133
         # strip multiple spaces and cariage returns from content
128 134
         if 'content' in res:
129
-            res['content'] = re.sub(' +', ' ', res['content'].strip().replace('\n', ''))
135
+            res['content'] = re.sub(' +', ' ',
136
+                                    res['content'].strip().replace('\n', ''))
130 137
 
131 138
         # get weight of this engine if possible
132 139
         if hasattr(engines[res['engine']], 'weight'):
@@ -139,8 +146,12 @@ def score_results(results):
139 146
         duplicated = False
140 147
         for new_res in results:
141 148
             # remove / from the end of the url if required
142
-            p1 = res['parsed_url'].path[:-1] if res['parsed_url'].path.endswith('/') else res['parsed_url'].path  # noqa
143
-            p2 = new_res['parsed_url'].path[:-1] if new_res['parsed_url'].path.endswith('/') else new_res['parsed_url'].path  # noqa
149
+            p1 = res['parsed_url'].path[:-1]\
150
+                if res['parsed_url'].path.endswith('/')\
151
+                else res['parsed_url'].path
152
+            p2 = new_res['parsed_url'].path[:-1]\
153
+                if new_res['parsed_url'].path.endswith('/')\
154
+                else new_res['parsed_url'].path
144 155
 
145 156
             # check if that result is a duplicate
146 157
             if res['host'] == new_res['host'] and\
@@ -153,7 +164,8 @@ def score_results(results):
153 164
         # merge duplicates together
154 165
         if duplicated:
155 166
             # using content with more text
156
-            if content_result_len(res.get('content', '')) > content_result_len(duplicated.get('content', '')):
167
+            if content_result_len(res.get('content', '')) >\
168
+                    content_result_len(duplicated.get('content', '')):
157 169
                 duplicated['content'] = res['content']
158 170
 
159 171
             # increase result-score
@@ -182,17 +194,25 @@ def score_results(results):
182 194
 
183 195
     for i, res in enumerate(results):
184 196
         # FIXME : handle more than one category per engine
185
-        category = engines[res['engine']].categories[0] + ':' + '' if 'template' not in res else res['template']
186
-
187
-        current = None if category not in categoryPositions else categoryPositions[category]
188
-
189
-        # group with previous results using the same category if the group can accept more result and is not too far from the current position
190
-        if current != None and (current['count'] > 0) and (len(gresults) - current['index'] < 20):
191
-            # group with the previous results using the same category with this one
197
+        category = engines[res['engine']].categories[0] + ':' + ''\
198
+            if 'template' not in res\
199
+            else res['template']
200
+
201
+        current = None if category not in categoryPositions\
202
+            else categoryPositions[category]
203
+
204
+        # group with previous results using the same category
205
+        # if the group can accept more result and is not too far
206
+        # from the current position
207
+        if current is not None and (current['count'] > 0)\
208
+                and (len(gresults) - current['index'] < 20):
209
+            # group with the previous results using
210
+            # the same category with this one
192 211
             index = current['index']
193 212
             gresults.insert(index, res)
194 213
 
195
-            # update every index after the current one (including the current one)
214
+            # update every index after the current one
215
+            # (including the current one)
196 216
             for k in categoryPositions:
197 217
                 v = categoryPositions[k]['index']
198 218
                 if v >= index:
@@ -206,7 +226,7 @@ def score_results(results):
206 226
             gresults.append(res)
207 227
 
208 228
             # update categoryIndex
209
-            categoryPositions[category] = { 'index' : len(gresults), 'count' : 8 }
229
+            categoryPositions[category] = {'index': len(gresults), 'count': 8}
210 230
 
211 231
     # return gresults
212 232
     return gresults
@@ -215,21 +235,21 @@ def score_results(results):
215 235
 def merge_two_infoboxes(infobox1, infobox2):
216 236
     if 'urls' in infobox2:
217 237
         urls1 = infobox1.get('urls', None)
218
-        if urls1 == None:
238
+        if urls1 is None:
219 239
             urls1 = []
220 240
             infobox1.set('urls', urls1)
221 241
 
222 242
         urlSet = set()
223 243
         for url in infobox1.get('urls', []):
224 244
             urlSet.add(url.get('url', None))
225
-        
245
+
226 246
         for url in infobox2.get('urls', []):
227 247
             if url.get('url', None) not in urlSet:
228 248
                 urls1.append(url)
229 249
 
230 250
     if 'attributes' in infobox2:
231 251
         attributes1 = infobox1.get('attributes', None)
232
-        if attributes1 == None:
252
+        if attributes1 is None:
233 253
             attributes1 = []
234 254
             infobox1.set('attributes', attributes1)
235 255
 
@@ -237,14 +257,14 @@ def merge_two_infoboxes(infobox1, infobox2):
237 257
         for attribute in infobox1.get('attributes', []):
238 258
             if attribute.get('label', None) not in attributeSet:
239 259
                 attributeSet.add(attribute.get('label', None))
240
-        
260
+
241 261
         for attribute in infobox2.get('attributes', []):
242 262
             attributes1.append(attribute)
243 263
 
244 264
     if 'content' in infobox2:
245 265
         content1 = infobox1.get('content', None)
246 266
         content2 = infobox2.get('content', '')
247
-        if content1 != None:
267
+        if content1 is not None:
248 268
             if content_result_len(content2) > content_result_len(content1):
249 269
                 infobox1['content'] = content2
250 270
         else:
@@ -257,12 +277,12 @@ def merge_infoboxes(infoboxes):
257 277
     for infobox in infoboxes:
258 278
         add_infobox = True
259 279
         infobox_id = infobox.get('id', None)
260
-        if infobox_id != None:
280
+        if infobox_id is not None:
261 281
             existingIndex = infoboxes_id.get(infobox_id, None)
262
-            if existingIndex != None:
282
+            if existingIndex is not None:
263 283
                 merge_two_infoboxes(results[existingIndex], infobox)
264
-                add_infobox=False
265
-            
284
+                add_infobox = False
285
+
266 286
         if add_infobox:
267 287
             results.append(infobox)
268 288
             infoboxes_id[infobox_id] = len(results)-1
@@ -311,9 +331,6 @@ class Search(object):
311 331
         if not self.request_data.get('q'):
312 332
             raise Exception('noquery')
313 333
 
314
-        # set query
315
-        self.query = self.request_data['q']
316
-
317 334
         # set pagenumber
318 335
         pageno_param = self.request_data.get('pageno', '1')
319 336
         if not pageno_param.isdigit() or int(pageno_param) < 1:
@@ -321,9 +338,13 @@ class Search(object):
321 338
 
322 339
         self.pageno = int(pageno_param)
323 340
 
324
-        # parse query, if tags are set, which change the serch engine or search-language
325
-        query_obj = Query(self.query, self.blocked_engines)
326
-        query_obj.parse_query()        
341
+        # parse query, if tags are set, which change
342
+        # the serch engine or search-language
343
+        query_obj = Query(self.request_data['q'], self.blocked_engines)
344
+        query_obj.parse_query()
345
+
346
+        # set query
347
+        self.query = query_obj.getSearchQuery()
327 348
 
328 349
         # get last selected language in query, if possible
329 350
         # TODO support search with multible languages
@@ -334,25 +355,29 @@ class Search(object):
334 355
 
335 356
         self.categories = []
336 357
 
337
-        # if engines are calculated from query, set categories by using that informations
358
+        # if engines are calculated from query,
359
+        # set categories by using that informations
338 360
         if self.engines:
339 361
             self.categories = list(set(engine['category']
340 362
                                        for engine in self.engines))
341 363
 
342
-        # otherwise, using defined categories to calculate which engines should be used
364
+        # otherwise, using defined categories to
365
+        # calculate which engines should be used
343 366
         else:
344 367
             # set used categories
345 368
             for pd_name, pd in self.request_data.items():
346 369
                 if pd_name.startswith('category_'):
347 370
                     category = pd_name[9:]
348 371
                     # if category is not found in list, skip
349
-                    if not category in categories:
372
+                    if category not in categories:
350 373
                         continue
351 374
 
352 375
                     # add category to list
353 376
                     self.categories.append(category)
354 377
 
355
-            # if no category is specified for this search, using user-defined default-configuration which (is stored in cookie)
378
+            # if no category is specified for this search,
379
+            # using user-defined default-configuration which
380
+            # (is stored in cookie)
356 381
             if not self.categories:
357 382
                 cookie_categories = request.cookies.get('categories', '')
358 383
                 cookie_categories = cookie_categories.split(',')
@@ -360,16 +385,18 @@ class Search(object):
360 385
                     if ccateg in categories:
361 386
                         self.categories.append(ccateg)
362 387
 
363
-            # if still no category is specified, using general as default-category
388
+            # if still no category is specified, using general
389
+            # as default-category
364 390
             if not self.categories:
365 391
                 self.categories = ['general']
366 392
 
367
-            # using all engines for that search, which are declared under the specific categories
393
+            # using all engines for that search, which are
394
+            # declared under the specific categories
368 395
             for categ in self.categories:
369 396
                 self.engines.extend({'category': categ,
370 397
                                      'name': x.name}
371 398
                                     for x in categories[categ]
372
-                                    if not x.name in self.blocked_engines)
399
+                                    if x.name not in self.blocked_engines)
373 400
 
374 401
     # do search-request
375 402
     def search(self, request):
@@ -386,7 +413,7 @@ class Search(object):
386 413
         number_of_searches += 1
387 414
 
388 415
         # set default useragent
389
-        #user_agent = request.headers.get('User-Agent', '')
416
+        # user_agent = request.headers.get('User-Agent', '')
390 417
         user_agent = gen_useragent()
391 418
 
392 419
         # start search-reqest for all selected engines
@@ -400,7 +427,8 @@ class Search(object):
400 427
             if self.pageno > 1 and not engine.paging:
401 428
                 continue
402 429
 
403
-            # if search-language is set and engine does not provide language-support, skip
430
+            # if search-language is set and engine does not
431
+            # provide language-support, skip
404 432
             if self.lang != 'all' and not engine.language_support:
405 433
                 continue
406 434
 
@@ -412,7 +440,8 @@ class Search(object):
412 440
             request_params['pageno'] = self.pageno
413 441
             request_params['language'] = self.lang
414 442
 
415
-            # update request parameters dependent on search-engine (contained in engines folder)
443
+            # update request parameters dependent on
444
+            # search-engine (contained in engines folder)
416 445
             request_params = engine.request(self.query.encode('utf-8'),
417 446
                                             request_params)
418 447
 
@@ -431,7 +460,8 @@ class Search(object):
431 460
                 request_params
432 461
             )
433 462
 
434
-            # create dictionary which contain all informations about the request
463
+            # create dictionary which contain all
464
+            # informations about the request
435 465
             request_args = dict(
436 466
                 headers=request_params['headers'],
437 467
                 hooks=dict(response=callback),

+ 7
- 0
searx/settings.yml Visa fil

@@ -52,6 +52,12 @@ engines:
52 52
     engine : duckduckgo
53 53
     shortcut : ddg
54 54
 
55
+# api-key required: http://www.faroo.com/hp/api/api.html#key
56
+#  - name : faroo
57
+#    engine : faroo
58
+#    shortcut : fa
59
+#    api_key : 'apikey' # required!
60
+
55 61
 # down - website is under criminal investigation by the UK
56 62
 #  - name : filecrop
57 63
 #    engine : filecrop
@@ -166,3 +172,4 @@ locales:
166 172
     es : Español
167 173
     it : Italiano
168 174
     nl : Nederlands
175
+    ja : 日本語 (Japanese)

+ 3
- 0
searx/settings_robot.yml Visa fil

@@ -4,6 +4,9 @@ server:
4 4
     debug : False
5 5
     request_timeout : 3.0 # seconds
6 6
     base_url: False
7
+    themes_path : ""
8
+    default_theme : default
9
+    https_rewrite : True
7 10
 
8 11
 engines:
9 12
   - name : general_dummy

+ 1
- 1
searx/static/default/css/style.css Visa fil

@@ -77,5 +77,5 @@ tr:hover{background:#ddd}
77 77
 #preferences{top:10px;padding:0;border:0;background:url('../img/preference-icon.png') no-repeat;background-size:28px 28px;opacity:.8;width:28px;height:30px;display:block}#preferences *{display:none}
78 78
 #pagination{clear:both;width:40em}
79 79
 #apis{margin-top:8px;clear:both}
80
-@media screen and (max-width:50em){#results{margin:auto;padding:0;width:90%} .github{display:none} .checkbox_container{display:block;width:90%}.checkbox_container label{border-bottom:0}}@media screen and (max-width:75em){#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em} #categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto} .right{display:none;postion:fixed !important;top:100px;right:0} #sidebar{position:static;max-width:50em;margin:0 0 2px 0;padding:0;float:none;border:none;width:auto}#sidebar input{border:0} #apis{display:none} #search_url{display:none} .result{border-top:1px solid #e8e7e6;margin:7px 0 6px 0}}.favicon{float:left;margin-right:4px;margin-top:2px}
80
+@media screen and (max-width:50em){#results{margin:auto;padding:0;width:90%} .github{display:none} .checkbox_container{display:block;width:90%}.checkbox_container label{border-bottom:0} .right{display:none;postion:fixed !important;top:100px;right:0}}@media screen and (max-width:75em){#infoboxes{position:inherit;max-width:inherit}#infoboxes .infobox{clear:both}#infoboxes .infobox img{float:left;max-width:10em} #categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto} #sidebar{position:static;max-width:50em;margin:0 0 2px 0;padding:0;float:none;border:none;width:auto}#sidebar input{border:0} #apis{display:none} #search_url{display:none} .result{border-top:1px solid #e8e7e6;margin:7px 0 6px 0}}.favicon{float:left;margin-right:4px;margin-top:2px}
81 81
 .preferences_back{background:none repeat scroll 0 0 #3498db;border:0 none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;cursor:pointer;display:inline-block;margin:2px 4px;padding:4px 6px}.preferences_back a{color:#fff}

+ 8
- 7
searx/static/default/less/style.less Visa fil

@@ -529,6 +529,14 @@ tr {
529 529
 			border-bottom: 0;
530 530
 		}
531 531
 	}
532
+
533
+	.right {
534
+		display: none;
535
+		postion: fixed !important;
536
+		top: 100px;
537
+		right: 0px;
538
+	}
539
+
532 540
 }
533 541
 
534 542
 @media screen and (max-width: 75em) {
@@ -558,13 +566,6 @@ tr {
558 566
 		}
559 567
 	}
560 568
 
561
-	.right {
562
-		display: none;
563
-		postion: fixed !important;
564
-		top: 100px;
565
-		right: 0px;
566
-	}
567
-
568 569
 	#sidebar {
569 570
 		position: static;
570 571
 		max-width: @results-width;

Binär
searx/translations/de/LC_MESSAGES/messages.mo Visa fil


+ 37
- 33
searx/translations/de/LC_MESSAGES/messages.po Visa fil

@@ -5,11 +5,12 @@
5 5
 # Translators:
6 6
 # pointhi, 2014
7 7
 # stf <stefan.marsiske@gmail.com>, 2014
8
+# rike, 2014
8 9
 msgid ""
9 10
 msgstr ""
10 11
 "Project-Id-Version:  searx\n"
11 12
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
12
-"POT-Creation-Date: 2014-10-01 19:45+0200\n"
13
+"POT-Creation-Date: 2014-10-26 19:10+0100\n"
13 14
 "PO-Revision-Date: 2014-03-15 18:40+0000\n"
14 15
 "Last-Translator: pointhi\n"
15 16
 "Language-Team: German "
@@ -20,31 +21,31 @@ msgstr ""
20 21
 "Content-Transfer-Encoding: 8bit\n"
21 22
 "Generated-By: Babel 1.3\n"
22 23
 
23
-#: searx/webapp.py:252
24
+#: searx/webapp.py:305
24 25
 msgid "{minutes} minute(s) ago"
25
-msgstr ""
26
+msgstr "vor {minutes} Minute(n)"
26 27
 
27
-#: searx/webapp.py:254
28
+#: searx/webapp.py:307
28 29
 msgid "{hours} hour(s), {minutes} minute(s) ago"
29
-msgstr ""
30
+msgstr "vor {hours} Stunde(n), {minutes} Minute(n)"
30 31
 
31
-#: searx/engines/__init__.py:164
32
+#: searx/engines/__init__.py:177
32 33
 msgid "Page loads (sec)"
33 34
 msgstr "Ladezeit (sek)"
34 35
 
35
-#: searx/engines/__init__.py:168
36
+#: searx/engines/__init__.py:181
36 37
 msgid "Number of results"
37 38
 msgstr "Trefferanzahl"
38 39
 
39
-#: searx/engines/__init__.py:172
40
+#: searx/engines/__init__.py:185
40 41
 msgid "Scores"
41 42
 msgstr "Punkte"
42 43
 
43
-#: searx/engines/__init__.py:176
44
+#: searx/engines/__init__.py:189
44 45
 msgid "Scores per result"
45 46
 msgstr "Punkte pro Treffer"
46 47
 
47
-#: searx/engines/__init__.py:180
48
+#: searx/engines/__init__.py:193
48 49
 msgid "Errors"
49 50
 msgstr "Fehler"
50 51
 
@@ -69,7 +70,7 @@ msgstr "Einstellungen"
69 70
 #: searx/templates/default/preferences.html:9
70 71
 #: searx/templates/oscar/preferences.html:21
71 72
 msgid "Default categories"
72
-msgstr "Standard Kategorien"
73
+msgstr "Standardkategorien"
73 74
 
74 75
 #: searx/templates/courgette/preferences.html:15
75 76
 #: searx/templates/default/preferences.html:15
@@ -93,19 +94,19 @@ msgstr "Oberflächensprache"
93 94
 #: searx/templates/default/preferences.html:36
94 95
 #: searx/templates/oscar/preferences.html:50
95 96
 msgid "Autocomplete"
96
-msgstr ""
97
+msgstr "Autovervollständigung"
97 98
 
98 99
 #: searx/templates/courgette/preferences.html:47
99 100
 #: searx/templates/default/preferences.html:47
100 101
 #: searx/templates/oscar/preferences.html:63
101 102
 msgid "Method"
102
-msgstr ""
103
+msgstr "Methode"
103 104
 
104 105
 #: searx/templates/courgette/preferences.html:56
105 106
 #: searx/templates/default/preferences.html:56
106 107
 #: searx/templates/oscar/preferences.html:73
107 108
 msgid "Themes"
108
-msgstr ""
109
+msgstr "Designs"
109 110
 
110 111
 #: searx/templates/courgette/preferences.html:66
111 112
 #: searx/templates/default/preferences.html:66
@@ -145,8 +146,8 @@ msgid ""
145 146
 "These settings are stored in your cookies, this allows us not to store "
146 147
 "this data about you."
147 148
 msgstr ""
148
-"Diese Informationen werden in Cookies gespeichert, damit wir keine ihrer "
149
-"persönlichen Daten speichern müssen."
149
+"Diese Informationen werden in Cookies auf Ihrem Rechner gespeichert, "
150
+"damit wir keine Ihrer persönlichen Daten speichern müssen."
150 151
 
151 152
 #: searx/templates/courgette/preferences.html:94
152 153
 #: searx/templates/default/preferences.html:94
@@ -155,8 +156,8 @@ msgid ""
155 156
 "These cookies serve your sole convenience, we don't use these cookies to "
156 157
 "track you."
157 158
 msgstr ""
158
-"Diese Cookies dienen ihrer Gemütlichkeit, wir verwenden sie nicht zum "
159
-"überwachen."
159
+"Diese Cookies dienen einzig Ihrem Komfort, wir verwenden sie nicht, um "
160
+"Sie zu überwachen."
160 161
 
161 162
 #: searx/templates/courgette/preferences.html:97
162 163
 #: searx/templates/default/preferences.html:97
@@ -172,30 +173,30 @@ msgstr "Zurück"
172 173
 
173 174
 #: searx/templates/courgette/results.html:12
174 175
 #: searx/templates/default/results.html:12
175
-#: searx/templates/oscar/results.html:74
176
+#: searx/templates/oscar/results.html:70
176 177
 msgid "Search URL"
177 178
 msgstr "Such-URL"
178 179
 
179 180
 #: searx/templates/courgette/results.html:16
180 181
 #: searx/templates/default/results.html:16
181
-#: searx/templates/oscar/results.html:79
182
+#: searx/templates/oscar/results.html:75
182 183
 msgid "Download results"
183 184
 msgstr "Ergebnisse herunterladen"
184 185
 
185 186
 #: searx/templates/courgette/results.html:34
186
-#: searx/templates/default/results.html:34
187
-#: searx/templates/oscar/results.html:51
187
+#: searx/templates/default/results.html:42
188
+#: searx/templates/oscar/results.html:50
188 189
 msgid "Suggestions"
189 190
 msgstr "Vorschläge"
190 191
 
191 192
 #: searx/templates/courgette/results.html:62
192
-#: searx/templates/default/results.html:62
193
+#: searx/templates/default/results.html:78
193 194
 #: searx/templates/oscar/results.html:29
194 195
 msgid "previous page"
195 196
 msgstr "vorherige Seite"
196 197
 
197 198
 #: searx/templates/courgette/results.html:73
198
-#: searx/templates/default/results.html:73
199
+#: searx/templates/default/results.html:89
199 200
 #: searx/templates/oscar/results.html:37
200 201
 msgid "next page"
201 202
 msgstr "nächste Seite"
@@ -209,7 +210,11 @@ msgstr "Suche nach..."
209 210
 #: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
210 211
 #: searx/templates/oscar/stats.html:5
211 212
 msgid "Engine stats"
212
-msgstr "Suchmaschienen Statistiken"
213
+msgstr "Suchmaschinenstatistik"
214
+
215
+#: searx/templates/default/results.html:34
216
+msgid "Answers"
217
+msgstr ""
213 218
 
214 219
 #: searx/templates/oscar/base.html:61
215 220
 msgid "Powered by"
@@ -228,14 +233,12 @@ msgid "home"
228 233
 msgstr ""
229 234
 
230 235
 #: searx/templates/oscar/preferences.html:11
231
-#, fuzzy
232 236
 msgid "General"
233 237
 msgstr "Allgemein"
234 238
 
235 239
 #: searx/templates/oscar/preferences.html:12
236
-#, fuzzy
237 240
 msgid "Engines"
238
-msgstr "Suchmaschienen Statistiken"
241
+msgstr ""
239 242
 
240 243
 #: searx/templates/oscar/preferences.html:36
241 244
 msgid "What language do you prefer for search?"
@@ -261,11 +264,10 @@ msgid "Change searx layout"
261 264
 msgstr ""
262 265
 
263 266
 #: searx/templates/oscar/results.html:6
264
-#, fuzzy
265 267
 msgid "Search results"
266
-msgstr "Trefferanzahl"
268
+msgstr ""
267 269
 
268
-#: searx/templates/oscar/results.html:68
270
+#: searx/templates/oscar/results.html:65
269 271
 msgid "Links"
270 272
 msgstr ""
271 273
 
@@ -340,9 +342,8 @@ msgid "Something went wrong."
340 342
 msgstr ""
341 343
 
342 344
 #: searx/templates/oscar/result_templates/images.html:20
343
-#, fuzzy
344 345
 msgid "Get image"
345
-msgstr "nächste Seite"
346
+msgstr ""
346 347
 
347 348
 #: searx/templates/oscar/result_templates/images.html:21
348 349
 msgid "View source"
@@ -379,3 +380,6 @@ msgstr "IT"
379 380
 msgid "news"
380 381
 msgstr "Neuigkeiten"
381 382
 
383
+msgid "map"
384
+msgstr "Karte"
385
+

Binär
searx/translations/en/LC_MESSAGES/messages.mo Visa fil


+ 22
- 18
searx/translations/en/LC_MESSAGES/messages.po Visa fil

@@ -7,7 +7,7 @@ msgid ""
7 7
 msgstr ""
8 8
 "Project-Id-Version: PROJECT VERSION\n"
9 9
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10
-"POT-Creation-Date: 2014-10-01 19:45+0200\n"
10
+"POT-Creation-Date: 2014-10-26 19:10+0100\n"
11 11
 "PO-Revision-Date: 2014-01-30 15:22+0100\n"
12 12
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 13
 "Language-Team: en <LL@li.org>\n"
@@ -17,31 +17,31 @@ msgstr ""
17 17
 "Content-Transfer-Encoding: 8bit\n"
18 18
 "Generated-By: Babel 1.3\n"
19 19
 
20
-#: searx/webapp.py:252
20
+#: searx/webapp.py:305
21 21
 msgid "{minutes} minute(s) ago"
22 22
 msgstr ""
23 23
 
24
-#: searx/webapp.py:254
24
+#: searx/webapp.py:307
25 25
 msgid "{hours} hour(s), {minutes} minute(s) ago"
26 26
 msgstr ""
27 27
 
28
-#: searx/engines/__init__.py:164
28
+#: searx/engines/__init__.py:177
29 29
 msgid "Page loads (sec)"
30 30
 msgstr ""
31 31
 
32
-#: searx/engines/__init__.py:168
32
+#: searx/engines/__init__.py:181
33 33
 msgid "Number of results"
34 34
 msgstr ""
35 35
 
36
-#: searx/engines/__init__.py:172
36
+#: searx/engines/__init__.py:185
37 37
 msgid "Scores"
38 38
 msgstr ""
39 39
 
40
-#: searx/engines/__init__.py:176
40
+#: searx/engines/__init__.py:189
41 41
 msgid "Scores per result"
42 42
 msgstr ""
43 43
 
44
-#: searx/engines/__init__.py:180
44
+#: searx/engines/__init__.py:193
45 45
 msgid "Errors"
46 46
 msgstr ""
47 47
 
@@ -165,30 +165,30 @@ msgstr ""
165 165
 
166 166
 #: searx/templates/courgette/results.html:12
167 167
 #: searx/templates/default/results.html:12
168
-#: searx/templates/oscar/results.html:74
168
+#: searx/templates/oscar/results.html:70
169 169
 msgid "Search URL"
170 170
 msgstr ""
171 171
 
172 172
 #: searx/templates/courgette/results.html:16
173 173
 #: searx/templates/default/results.html:16
174
-#: searx/templates/oscar/results.html:79
174
+#: searx/templates/oscar/results.html:75
175 175
 msgid "Download results"
176 176
 msgstr ""
177 177
 
178 178
 #: searx/templates/courgette/results.html:34
179
-#: searx/templates/default/results.html:34
180
-#: searx/templates/oscar/results.html:51
179
+#: searx/templates/default/results.html:42
180
+#: searx/templates/oscar/results.html:50
181 181
 msgid "Suggestions"
182 182
 msgstr ""
183 183
 
184 184
 #: searx/templates/courgette/results.html:62
185
-#: searx/templates/default/results.html:62
185
+#: searx/templates/default/results.html:78
186 186
 #: searx/templates/oscar/results.html:29
187 187
 msgid "previous page"
188 188
 msgstr ""
189 189
 
190 190
 #: searx/templates/courgette/results.html:73
191
-#: searx/templates/default/results.html:73
191
+#: searx/templates/default/results.html:89
192 192
 #: searx/templates/oscar/results.html:37
193 193
 msgid "next page"
194 194
 msgstr ""
@@ -204,6 +204,10 @@ msgstr ""
204 204
 msgid "Engine stats"
205 205
 msgstr ""
206 206
 
207
+#: searx/templates/default/results.html:34
208
+msgid "Answers"
209
+msgstr ""
210
+
207 211
 #: searx/templates/oscar/base.html:61
208 212
 msgid "Powered by"
209 213
 msgstr ""
@@ -255,7 +259,7 @@ msgstr ""
255 259
 msgid "Search results"
256 260
 msgstr ""
257 261
 
258
-#: searx/templates/oscar/results.html:68
262
+#: searx/templates/oscar/results.html:65
259 263
 msgid "Links"
260 264
 msgstr ""
261 265
 
@@ -350,9 +354,6 @@ msgstr ""
350 354
 msgid "files"
351 355
 msgstr ""
352 356
 
353
-msgid "general"
354
-msgstr ""
355
-
356 357
 msgid "music"
357 358
 msgstr ""
358 359
 
@@ -371,3 +372,6 @@ msgstr ""
371 372
 msgid "news"
372 373
 msgstr ""
373 374
 
375
+msgid "map"
376
+msgstr ""
377
+

Binär
searx/translations/es/LC_MESSAGES/messages.mo Visa fil


+ 32
- 29
searx/translations/es/LC_MESSAGES/messages.po Visa fil

@@ -3,14 +3,14 @@
3 3
 # This file is distributed under the same license as the  project.
4 4
 #
5 5
 # Translators:
6
-# niazle, 2014
6
+# Alejandro León Aznar, 2014
7 7
 msgid ""
8 8
 msgstr ""
9 9
 "Project-Id-Version:  searx\n"
10 10
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11
-"POT-Creation-Date: 2014-10-01 19:45+0200\n"
12
-"PO-Revision-Date: 2014-03-04 20:40+0000\n"
13
-"Last-Translator: niazle\n"
11
+"POT-Creation-Date: 2014-10-26 19:10+0100\n"
12
+"PO-Revision-Date: 2014-09-08 11:01+0000\n"
13
+"Last-Translator: Alejandro León Aznar\n"
14 14
 "Language-Team: Spanish "
15 15
 "(http://www.transifex.com/projects/p/searx/language/es/)\n"
16 16
 "Plural-Forms: nplurals=2; plural=(n != 1)\n"
@@ -19,31 +19,31 @@ msgstr ""
19 19
 "Content-Transfer-Encoding: 8bit\n"
20 20
 "Generated-By: Babel 1.3\n"
21 21
 
22
-#: searx/webapp.py:252
22
+#: searx/webapp.py:305
23 23
 msgid "{minutes} minute(s) ago"
24
-msgstr ""
24
+msgstr "hace {minutes} minuto(s)"
25 25
 
26
-#: searx/webapp.py:254
26
+#: searx/webapp.py:307
27 27
 msgid "{hours} hour(s), {minutes} minute(s) ago"
28
-msgstr ""
28
+msgstr "hace {hours} hora(s) y {minutes} minuto(s)"
29 29
 
30
-#: searx/engines/__init__.py:164
30
+#: searx/engines/__init__.py:177
31 31
 msgid "Page loads (sec)"
32 32
 msgstr "Tiempo de carga (segundos)"
33 33
 
34
-#: searx/engines/__init__.py:168
34
+#: searx/engines/__init__.py:181
35 35
 msgid "Number of results"
36 36
 msgstr "Número de resultados"
37 37
 
38
-#: searx/engines/__init__.py:172
38
+#: searx/engines/__init__.py:185
39 39
 msgid "Scores"
40 40
 msgstr "Puntuaciones"
41 41
 
42
-#: searx/engines/__init__.py:176
42
+#: searx/engines/__init__.py:189
43 43
 msgid "Scores per result"
44 44
 msgstr "Puntuaciones por resultado"
45 45
 
46
-#: searx/engines/__init__.py:180
46
+#: searx/engines/__init__.py:193
47 47
 msgid "Errors"
48 48
 msgstr "Errores"
49 49
 
@@ -171,30 +171,30 @@ msgstr "Atrás"
171 171
 
172 172
 #: searx/templates/courgette/results.html:12
173 173
 #: searx/templates/default/results.html:12
174
-#: searx/templates/oscar/results.html:74
174
+#: searx/templates/oscar/results.html:70
175 175
 msgid "Search URL"
176 176
 msgstr "Buscar URL"
177 177
 
178 178
 #: searx/templates/courgette/results.html:16
179 179
 #: searx/templates/default/results.html:16
180
-#: searx/templates/oscar/results.html:79
180
+#: searx/templates/oscar/results.html:75
181 181
 msgid "Download results"
182 182
 msgstr "Descargar resultados"
183 183
 
184 184
 #: searx/templates/courgette/results.html:34
185
-#: searx/templates/default/results.html:34
186
-#: searx/templates/oscar/results.html:51
185
+#: searx/templates/default/results.html:42
186
+#: searx/templates/oscar/results.html:50
187 187
 msgid "Suggestions"
188 188
 msgstr "Sugerencias"
189 189
 
190 190
 #: searx/templates/courgette/results.html:62
191
-#: searx/templates/default/results.html:62
191
+#: searx/templates/default/results.html:78
192 192
 #: searx/templates/oscar/results.html:29
193 193
 msgid "previous page"
194 194
 msgstr "Página anterior"
195 195
 
196 196
 #: searx/templates/courgette/results.html:73
197
-#: searx/templates/default/results.html:73
197
+#: searx/templates/default/results.html:89
198 198
 #: searx/templates/oscar/results.html:37
199 199
 msgid "next page"
200 200
 msgstr "Página siguiente"
@@ -203,13 +203,17 @@ msgstr "Página siguiente"
203 203
 #: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
204 204
 #: searx/templates/oscar/search_full.html:5
205 205
 msgid "Search for..."
206
-msgstr ""
206
+msgstr "Buscar..."
207 207
 
208 208
 #: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
209 209
 #: searx/templates/oscar/stats.html:5
210 210
 msgid "Engine stats"
211 211
 msgstr "Estadísticas del motor de búsqueda"
212 212
 
213
+#: searx/templates/default/results.html:34
214
+msgid "Answers"
215
+msgstr ""
216
+
213 217
 #: searx/templates/oscar/base.html:61
214 218
 msgid "Powered by"
215 219
 msgstr ""
@@ -227,14 +231,12 @@ msgid "home"
227 231
 msgstr ""
228 232
 
229 233
 #: searx/templates/oscar/preferences.html:11
230
-#, fuzzy
231 234
 msgid "General"
232
-msgstr "General"
235
+msgstr ""
233 236
 
234 237
 #: searx/templates/oscar/preferences.html:12
235
-#, fuzzy
236 238
 msgid "Engines"
237
-msgstr "Estadísticas del motor de búsqueda"
239
+msgstr ""
238 240
 
239 241
 #: searx/templates/oscar/preferences.html:36
240 242
 msgid "What language do you prefer for search?"
@@ -260,11 +262,10 @@ msgid "Change searx layout"
260 262
 msgstr ""
261 263
 
262 264
 #: searx/templates/oscar/results.html:6
263
-#, fuzzy
264 265
 msgid "Search results"
265
-msgstr "Número de resultados"
266
+msgstr ""
266 267
 
267
-#: searx/templates/oscar/results.html:68
268
+#: searx/templates/oscar/results.html:65
268 269
 msgid "Links"
269 270
 msgstr ""
270 271
 
@@ -339,9 +340,8 @@ msgid "Something went wrong."
339 340
 msgstr ""
340 341
 
341 342
 #: searx/templates/oscar/result_templates/images.html:20
342
-#, fuzzy
343 343
 msgid "Get image"
344
-msgstr "Página siguiente"
344
+msgstr ""
345 345
 
346 346
 #: searx/templates/oscar/result_templates/images.html:21
347 347
 msgid "View source"
@@ -378,3 +378,6 @@ msgstr "TIC"
378 378
 msgid "news"
379 379
 msgstr "noticias"
380 380
 
381
+msgid "map"
382
+msgstr "mapa"
383
+

Binär
searx/translations/fr/LC_MESSAGES/messages.mo Visa fil


+ 32
- 29
searx/translations/fr/LC_MESSAGES/messages.po Visa fil

@@ -5,14 +5,14 @@
5 5
 # Translators:
6 6
 # Benjamin Sonntag <benjamin@sonntag.fr>, 2014
7 7
 # FIRST AUTHOR <EMAIL@ADDRESS>, 2014
8
-# rike <u@451f.org>, 2014
8
+# rike, 2014
9 9
 msgid ""
10 10
 msgstr ""
11 11
 "Project-Id-Version:  searx\n"
12 12
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
13
-"POT-Creation-Date: 2014-10-01 19:45+0200\n"
14
-"PO-Revision-Date: 2014-03-16 07:40+0000\n"
15
-"Last-Translator: Benjamin Sonntag <benjamin@sonntag.fr>\n"
13
+"POT-Creation-Date: 2014-10-26 19:10+0100\n"
14
+"PO-Revision-Date: 2014-09-07 21:24+0000\n"
15
+"Last-Translator: Adam Tauber <asciimoo@gmail.com>\n"
16 16
 "Language-Team: French "
17 17
 "(http://www.transifex.com/projects/p/searx/language/fr/)\n"
18 18
 "Plural-Forms: nplurals=2; plural=(n > 1)\n"
@@ -21,31 +21,31 @@ msgstr ""
21 21
 "Content-Transfer-Encoding: 8bit\n"
22 22
 "Generated-By: Babel 1.3\n"
23 23
 
24
-#: searx/webapp.py:252
24
+#: searx/webapp.py:305
25 25
 msgid "{minutes} minute(s) ago"
26
-msgstr "Il y a {minutes} minute(s)"
26
+msgstr "il y a {minutes} minute(s)"
27 27
 
28
-#: searx/webapp.py:254
28
+#: searx/webapp.py:307
29 29
 msgid "{hours} hour(s), {minutes} minute(s) ago"
30
-msgstr "Il y a {hours} heure(s), {minutes} minute(s)"
30
+msgstr "il y a {hours} heure(s), {minutes} minute(s)"
31 31
 
32
-#: searx/engines/__init__.py:164
32
+#: searx/engines/__init__.py:177
33 33
 msgid "Page loads (sec)"
34 34
 msgstr "Chargement de la page (sec)"
35 35
 
36
-#: searx/engines/__init__.py:168
36
+#: searx/engines/__init__.py:181
37 37
 msgid "Number of results"
38 38
 msgstr "Nombre de résultats"
39 39
 
40
-#: searx/engines/__init__.py:172
40
+#: searx/engines/__init__.py:185
41 41
 msgid "Scores"
42 42
 msgstr "Score"
43 43
 
44
-#: searx/engines/__init__.py:176
44
+#: searx/engines/__init__.py:189
45 45
 msgid "Scores per result"
46 46
 msgstr "Score par résultat"
47 47
 
48
-#: searx/engines/__init__.py:180
48
+#: searx/engines/__init__.py:193
49 49
 msgid "Errors"
50 50
 msgstr "Erreurs"
51 51
 
@@ -111,7 +111,7 @@ msgstr ""
111 111
 #: searx/templates/courgette/preferences.html:66
112 112
 #: searx/templates/default/preferences.html:66
113 113
 msgid "Currently used search engines"
114
-msgstr "Moteurs actuellement utilisés"
114
+msgstr "Moteurs de recherche actuellement utilisés"
115 115
 
116 116
 #: searx/templates/courgette/preferences.html:70
117 117
 #: searx/templates/default/preferences.html:70
@@ -173,30 +173,30 @@ msgstr "retour"
173 173
 
174 174
 #: searx/templates/courgette/results.html:12
175 175
 #: searx/templates/default/results.html:12
176
-#: searx/templates/oscar/results.html:74
176
+#: searx/templates/oscar/results.html:70
177 177
 msgid "Search URL"
178 178
 msgstr "URL de recherche"
179 179
 
180 180
 #: searx/templates/courgette/results.html:16
181 181
 #: searx/templates/default/results.html:16
182
-#: searx/templates/oscar/results.html:79
182
+#: searx/templates/oscar/results.html:75
183 183
 msgid "Download results"
184 184
 msgstr "Télécharger les résultats"
185 185
 
186 186
 #: searx/templates/courgette/results.html:34
187
-#: searx/templates/default/results.html:34
188
-#: searx/templates/oscar/results.html:51
187
+#: searx/templates/default/results.html:42
188
+#: searx/templates/oscar/results.html:50
189 189
 msgid "Suggestions"
190 190
 msgstr "Suggestions"
191 191
 
192 192
 #: searx/templates/courgette/results.html:62
193
-#: searx/templates/default/results.html:62
193
+#: searx/templates/default/results.html:78
194 194
 #: searx/templates/oscar/results.html:29
195 195
 msgid "previous page"
196 196
 msgstr "page précédente"
197 197
 
198 198
 #: searx/templates/courgette/results.html:73
199
-#: searx/templates/default/results.html:73
199
+#: searx/templates/default/results.html:89
200 200
 #: searx/templates/oscar/results.html:37
201 201
 msgid "next page"
202 202
 msgstr "page suivante"
@@ -212,6 +212,10 @@ msgstr "Rechercher..."
212 212
 msgid "Engine stats"
213 213
 msgstr "Statistiques du moteur"
214 214
 
215
+#: searx/templates/default/results.html:34
216
+msgid "Answers"
217
+msgstr ""
218
+
215 219
 #: searx/templates/oscar/base.html:61
216 220
 msgid "Powered by"
217 221
 msgstr ""
@@ -229,14 +233,12 @@ msgid "home"
229 233
 msgstr ""
230 234
 
231 235
 #: searx/templates/oscar/preferences.html:11
232
-#, fuzzy
233 236
 msgid "General"
234
-msgstr "général"
237
+msgstr ""
235 238
 
236 239
 #: searx/templates/oscar/preferences.html:12
237
-#, fuzzy
238 240
 msgid "Engines"
239
-msgstr "Statistiques du moteur"
241
+msgstr ""
240 242
 
241 243
 #: searx/templates/oscar/preferences.html:36
242 244
 msgid "What language do you prefer for search?"
@@ -262,11 +264,10 @@ msgid "Change searx layout"
262 264
 msgstr ""
263 265
 
264 266
 #: searx/templates/oscar/results.html:6
265
-#, fuzzy
266 267
 msgid "Search results"
267
-msgstr "Nombre de résultats"
268
+msgstr ""
268 269
 
269
-#: searx/templates/oscar/results.html:68
270
+#: searx/templates/oscar/results.html:65
270 271
 msgid "Links"
271 272
 msgstr ""
272 273
 
@@ -341,9 +342,8 @@ msgid "Something went wrong."
341 342
 msgstr ""
342 343
 
343 344
 #: searx/templates/oscar/result_templates/images.html:20
344
-#, fuzzy
345 345
 msgid "Get image"
346
-msgstr "page suivante"
346
+msgstr ""
347 347
 
348 348
 #: searx/templates/oscar/result_templates/images.html:21
349 349
 msgid "View source"
@@ -380,3 +380,6 @@ msgstr "Informatique"
380 380
 msgid "news"
381 381
 msgstr "actus"
382 382
 
383
+msgid "map"
384
+msgstr ""
385
+

Binär
searx/translations/hu/LC_MESSAGES/messages.mo Visa fil


+ 37
- 31
searx/translations/hu/LC_MESSAGES/messages.po Visa fil

@@ -1,47 +1,50 @@
1
-# Hungarian translations for PROJECT.
1
+# English translations for .
2 2
 # Copyright (C) 2014 ORGANIZATION
3
-# This file is distributed under the same license as the PROJECT project.
4
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
3
+# This file is distributed under the same license as the  project.
5 4
 #
5
+# Translators:
6
+# Adam Tauber <asciimoo@gmail.com>, 2014
7
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2014
6 8
 msgid ""
7 9
 msgstr ""
8
-"Project-Id-Version: PROJECT VERSION\n"
10
+"Project-Id-Version:  searx\n"
9 11
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10
-"POT-Creation-Date: 2014-10-01 19:45+0200\n"
11
-"PO-Revision-Date: 2014-01-21 23:33+0100\n"
12
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
-"Language-Team: hu <LL@li.org>\n"
14
-"Plural-Forms: nplurals=1; plural=0\n"
12
+"POT-Creation-Date: 2014-10-26 19:10+0100\n"
13
+"PO-Revision-Date: 2014-09-07 21:30+0000\n"
14
+"Last-Translator: Adam Tauber <asciimoo@gmail.com>\n"
15
+"Language-Team: Hungarian "
16
+"(http://www.transifex.com/projects/p/searx/language/hu/)\n"
17
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
15 18
 "MIME-Version: 1.0\n"
16 19
 "Content-Type: text/plain; charset=utf-8\n"
17 20
 "Content-Transfer-Encoding: 8bit\n"
18 21
 "Generated-By: Babel 1.3\n"
19 22
 
20
-#: searx/webapp.py:252
23
+#: searx/webapp.py:305
21 24
 msgid "{minutes} minute(s) ago"
22 25
 msgstr "{minutes} perce"
23 26
 
24
-#: searx/webapp.py:254
27
+#: searx/webapp.py:307
25 28
 msgid "{hours} hour(s), {minutes} minute(s) ago"
26 29
 msgstr "{hours} óra, {minutes} perce"
27 30
 
28
-#: searx/engines/__init__.py:164
31
+#: searx/engines/__init__.py:177
29 32
 msgid "Page loads (sec)"
30 33
 msgstr "Válaszidők (sec)"
31 34
 
32
-#: searx/engines/__init__.py:168
35
+#: searx/engines/__init__.py:181
33 36
 msgid "Number of results"
34 37
 msgstr "Találatok száma"
35 38
 
36
-#: searx/engines/__init__.py:172
39
+#: searx/engines/__init__.py:185
37 40
 msgid "Scores"
38 41
 msgstr "Pontszámok"
39 42
 
40
-#: searx/engines/__init__.py:176
43
+#: searx/engines/__init__.py:189
41 44
 msgid "Scores per result"
42 45
 msgstr "Pontszámok találatonként"
43 46
 
44
-#: searx/engines/__init__.py:180
47
+#: searx/engines/__init__.py:193
45 48
 msgid "Errors"
46 49
 msgstr "Hibák"
47 50
 
@@ -167,30 +170,30 @@ msgstr "vissza"
167 170
 
168 171
 #: searx/templates/courgette/results.html:12
169 172
 #: searx/templates/default/results.html:12
170
-#: searx/templates/oscar/results.html:74
173
+#: searx/templates/oscar/results.html:70
171 174
 msgid "Search URL"
172 175
 msgstr "Keresési URL"
173 176
 
174 177
 #: searx/templates/courgette/results.html:16
175 178
 #: searx/templates/default/results.html:16
176
-#: searx/templates/oscar/results.html:79
179
+#: searx/templates/oscar/results.html:75
177 180
 msgid "Download results"
178 181
 msgstr "Találatok letöltése"
179 182
 
180 183
 #: searx/templates/courgette/results.html:34
181
-#: searx/templates/default/results.html:34
182
-#: searx/templates/oscar/results.html:51
184
+#: searx/templates/default/results.html:42
185
+#: searx/templates/oscar/results.html:50
183 186
 msgid "Suggestions"
184 187
 msgstr "Javaslatok"
185 188
 
186 189
 #: searx/templates/courgette/results.html:62
187
-#: searx/templates/default/results.html:62
190
+#: searx/templates/default/results.html:78
188 191
 #: searx/templates/oscar/results.html:29
189 192
 msgid "previous page"
190 193
 msgstr "előző oldal"
191 194
 
192 195
 #: searx/templates/courgette/results.html:73
193
-#: searx/templates/default/results.html:73
196
+#: searx/templates/default/results.html:89
194 197
 #: searx/templates/oscar/results.html:37
195 198
 msgid "next page"
196 199
 msgstr "következő oldal"
@@ -206,6 +209,10 @@ msgstr "Keresés..."
206 209
 msgid "Engine stats"
207 210
 msgstr "Kereső statisztikák"
208 211
 
212
+#: searx/templates/default/results.html:34
213
+msgid "Answers"
214
+msgstr ""
215
+
209 216
 #: searx/templates/oscar/base.html:61
210 217
 msgid "Powered by"
211 218
 msgstr ""
@@ -223,14 +230,12 @@ msgid "home"
223 230
 msgstr ""
224 231
 
225 232
 #: searx/templates/oscar/preferences.html:11
226
-#, fuzzy
227 233
 msgid "General"
228
-msgstr "általános"
234
+msgstr ""
229 235
 
230 236
 #: searx/templates/oscar/preferences.html:12
231
-#, fuzzy
232 237
 msgid "Engines"
233
-msgstr "Kereső statisztikák"
238
+msgstr ""
234 239
 
235 240
 #: searx/templates/oscar/preferences.html:36
236 241
 msgid "What language do you prefer for search?"
@@ -256,11 +261,10 @@ msgid "Change searx layout"
256 261
 msgstr ""
257 262
 
258 263
 #: searx/templates/oscar/results.html:6
259
-#, fuzzy
260 264
 msgid "Search results"
261
-msgstr "Találatok száma"
265
+msgstr ""
262 266
 
263
-#: searx/templates/oscar/results.html:68
267
+#: searx/templates/oscar/results.html:65
264 268
 msgid "Links"
265 269
 msgstr ""
266 270
 
@@ -335,9 +339,8 @@ msgid "Something went wrong."
335 339
 msgstr ""
336 340
 
337 341
 #: searx/templates/oscar/result_templates/images.html:20
338
-#, fuzzy
339 342
 msgid "Get image"
340
-msgstr "következő oldal"
343
+msgstr ""
341 344
 
342 345
 #: searx/templates/oscar/result_templates/images.html:21
343 346
 msgid "View source"
@@ -374,3 +377,6 @@ msgstr "it"
374 377
 msgid "news"
375 378
 msgstr "hírek"
376 379
 
380
+msgid "map"
381
+msgstr "térkép"
382
+

Binär
searx/translations/it/LC_MESSAGES/messages.mo Visa fil


+ 30
- 27
searx/translations/it/LC_MESSAGES/messages.po Visa fil

@@ -8,8 +8,8 @@ msgid ""
8 8
 msgstr ""
9 9
 "Project-Id-Version:  searx\n"
10 10
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11
-"POT-Creation-Date: 2014-10-01 19:45+0200\n"
12
-"PO-Revision-Date: 2014-03-05 13:30+0000\n"
11
+"POT-Creation-Date: 2014-10-26 19:10+0100\n"
12
+"PO-Revision-Date: 2014-09-08 08:19+0000\n"
13 13
 "Last-Translator: dp <d.pitrolo@gmx.com>\n"
14 14
 "Language-Team: Italian "
15 15
 "(http://www.transifex.com/projects/p/searx/language/it/)\n"
@@ -19,31 +19,31 @@ msgstr ""
19 19
 "Content-Transfer-Encoding: 8bit\n"
20 20
 "Generated-By: Babel 1.3\n"
21 21
 
22
-#: searx/webapp.py:252
22
+#: searx/webapp.py:305
23 23
 msgid "{minutes} minute(s) ago"
24
-msgstr ""
24
+msgstr "di {minutes} minuti fa"
25 25
 
26
-#: searx/webapp.py:254
26
+#: searx/webapp.py:307
27 27
 msgid "{hours} hour(s), {minutes} minute(s) ago"
28
-msgstr ""
28
+msgstr "di {ore} h e {minutes} minuti fa"
29 29
 
30
-#: searx/engines/__init__.py:164
30
+#: searx/engines/__init__.py:177
31 31
 msgid "Page loads (sec)"
32 32
 msgstr " Caricamento della pagina (secondi)"
33 33
 
34
-#: searx/engines/__init__.py:168
34
+#: searx/engines/__init__.py:181
35 35
 msgid "Number of results"
36 36
 msgstr "Risultati ottenuti"
37 37
 
38
-#: searx/engines/__init__.py:172
38
+#: searx/engines/__init__.py:185
39 39
 msgid "Scores"
40 40
 msgstr "Punteggio"
41 41
 
42
-#: searx/engines/__init__.py:176
42
+#: searx/engines/__init__.py:189
43 43
 msgid "Scores per result"
44 44
 msgstr "Punteggio per risultato"
45 45
 
46
-#: searx/engines/__init__.py:180
46
+#: searx/engines/__init__.py:193
47 47
 msgid "Errors"
48 48
 msgstr "Errori"
49 49
 
@@ -171,30 +171,30 @@ msgstr "indietro"
171 171
 
172 172
 #: searx/templates/courgette/results.html:12
173 173
 #: searx/templates/default/results.html:12
174
-#: searx/templates/oscar/results.html:74
174
+#: searx/templates/oscar/results.html:70
175 175
 msgid "Search URL"
176 176
 msgstr "URL della ricerca"
177 177
 
178 178
 #: searx/templates/courgette/results.html:16
179 179
 #: searx/templates/default/results.html:16
180
-#: searx/templates/oscar/results.html:79
180
+#: searx/templates/oscar/results.html:75
181 181
 msgid "Download results"
182 182
 msgstr "Scarica i risultati"
183 183
 
184 184
 #: searx/templates/courgette/results.html:34
185
-#: searx/templates/default/results.html:34
186
-#: searx/templates/oscar/results.html:51
185
+#: searx/templates/default/results.html:42
186
+#: searx/templates/oscar/results.html:50
187 187
 msgid "Suggestions"
188 188
 msgstr "Suggerimenti"
189 189
 
190 190
 #: searx/templates/courgette/results.html:62
191
-#: searx/templates/default/results.html:62
191
+#: searx/templates/default/results.html:78
192 192
 #: searx/templates/oscar/results.html:29
193 193
 msgid "previous page"
194 194
 msgstr "pagina precedente"
195 195
 
196 196
 #: searx/templates/courgette/results.html:73
197
-#: searx/templates/default/results.html:73
197
+#: searx/templates/default/results.html:89
198 198
 #: searx/templates/oscar/results.html:37
199 199
 msgid "next page"
200 200
 msgstr "pagina successiva"
@@ -203,13 +203,17 @@ msgstr "pagina successiva"
203 203
 #: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
204 204
 #: searx/templates/oscar/search_full.html:5
205 205
 msgid "Search for..."
206
-msgstr ""
206
+msgstr "Cerca…"
207 207
 
208 208
 #: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
209 209
 #: searx/templates/oscar/stats.html:5
210 210
 msgid "Engine stats"
211 211
 msgstr "Statistiche dei motori"
212 212
 
213
+#: searx/templates/default/results.html:34
214
+msgid "Answers"
215
+msgstr ""
216
+
213 217
 #: searx/templates/oscar/base.html:61
214 218
 msgid "Powered by"
215 219
 msgstr ""
@@ -227,14 +231,12 @@ msgid "home"
227 231
 msgstr ""
228 232
 
229 233
 #: searx/templates/oscar/preferences.html:11
230
-#, fuzzy
231 234
 msgid "General"
232
-msgstr "generale"
235
+msgstr ""
233 236
 
234 237
 #: searx/templates/oscar/preferences.html:12
235
-#, fuzzy
236 238
 msgid "Engines"
237
-msgstr "Statistiche dei motori"
239
+msgstr ""
238 240
 
239 241
 #: searx/templates/oscar/preferences.html:36
240 242
 msgid "What language do you prefer for search?"
@@ -260,11 +262,10 @@ msgid "Change searx layout"
260 262
 msgstr ""
261 263
 
262 264
 #: searx/templates/oscar/results.html:6
263
-#, fuzzy
264 265
 msgid "Search results"
265
-msgstr "Risultati ottenuti"
266
+msgstr ""
266 267
 
267
-#: searx/templates/oscar/results.html:68
268
+#: searx/templates/oscar/results.html:65
268 269
 msgid "Links"
269 270
 msgstr ""
270 271
 
@@ -339,9 +340,8 @@ msgid "Something went wrong."
339 340
 msgstr ""
340 341
 
341 342
 #: searx/templates/oscar/result_templates/images.html:20
342
-#, fuzzy
343 343
 msgid "Get image"
344
-msgstr "pagina successiva"
344
+msgstr ""
345 345
 
346 346
 #: searx/templates/oscar/result_templates/images.html:21
347 347
 msgid "View source"
@@ -378,3 +378,6 @@ msgstr "it"
378 378
 msgid "news"
379 379
 msgstr "notizie"
380 380
 
381
+msgid "map"
382
+msgstr "mappe"
383
+

Binär
searx/translations/ja/LC_MESSAGES/messages.mo Visa fil


+ 377
- 0
searx/translations/ja/LC_MESSAGES/messages.po Visa fil

@@ -0,0 +1,377 @@
1
+# Japanese translations for PROJECT.
2
+# Copyright (C) 2014 ORGANIZATION
3
+# This file is distributed under the same license as the PROJECT project.
4
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
5
+#
6
+msgid ""
7
+msgstr ""
8
+"Project-Id-Version: PROJECT VERSION\n"
9
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10
+"POT-Creation-Date: 2014-10-26 19:10+0100\n"
11
+"PO-Revision-Date: 2014-10-05 16:38+0200\n"
12
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+"Language-Team: ja <LL@li.org>\n"
14
+"Plural-Forms: nplurals=1; plural=0\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=utf-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Generated-By: Babel 1.3\n"
19
+
20
+#: searx/webapp.py:305
21
+msgid "{minutes} minute(s) ago"
22
+msgstr ""
23
+
24
+#: searx/webapp.py:307
25
+msgid "{hours} hour(s), {minutes} minute(s) ago"
26
+msgstr ""
27
+
28
+#: searx/engines/__init__.py:177
29
+msgid "Page loads (sec)"
30
+msgstr ""
31
+
32
+#: searx/engines/__init__.py:181
33
+msgid "Number of results"
34
+msgstr ""
35
+
36
+#: searx/engines/__init__.py:185
37
+msgid "Scores"
38
+msgstr ""
39
+
40
+#: searx/engines/__init__.py:189
41
+msgid "Scores per result"
42
+msgstr ""
43
+
44
+#: searx/engines/__init__.py:193
45
+msgid "Errors"
46
+msgstr ""
47
+
48
+#: searx/templates/courgette/index.html:8 searx/templates/default/index.html:8
49
+#: searx/templates/oscar/about.html:3 searx/templates/oscar/navbar.html:16
50
+msgid "about"
51
+msgstr "に関する"
52
+
53
+#: searx/templates/courgette/index.html:9 searx/templates/default/index.html:9
54
+#: searx/templates/oscar/navbar.html:17
55
+#: searx/templates/oscar/preferences.html:2
56
+msgid "preferences"
57
+msgstr "設定"
58
+
59
+#: searx/templates/courgette/preferences.html:5
60
+#: searx/templates/default/preferences.html:5
61
+#: searx/templates/oscar/preferences.html:6
62
+msgid "Preferences"
63
+msgstr "設定"
64
+
65
+#: searx/templates/courgette/preferences.html:9
66
+#: searx/templates/default/preferences.html:9
67
+#: searx/templates/oscar/preferences.html:21
68
+msgid "Default categories"
69
+msgstr ""
70
+
71
+#: searx/templates/courgette/preferences.html:15
72
+#: searx/templates/default/preferences.html:15
73
+#: searx/templates/oscar/preferences.html:27
74
+msgid "Search language"
75
+msgstr ""
76
+
77
+#: searx/templates/courgette/preferences.html:18
78
+#: searx/templates/default/preferences.html:18
79
+#: searx/templates/oscar/preferences.html:30
80
+msgid "Automatic"
81
+msgstr ""
82
+
83
+#: searx/templates/courgette/preferences.html:26
84
+#: searx/templates/default/preferences.html:26
85
+#: searx/templates/oscar/preferences.html:39
86
+msgid "Interface language"
87
+msgstr ""
88
+
89
+#: searx/templates/courgette/preferences.html:36
90
+#: searx/templates/default/preferences.html:36
91
+#: searx/templates/oscar/preferences.html:50
92
+msgid "Autocomplete"
93
+msgstr ""
94
+
95
+#: searx/templates/courgette/preferences.html:47
96
+#: searx/templates/default/preferences.html:47
97
+#: searx/templates/oscar/preferences.html:63
98
+msgid "Method"
99
+msgstr ""
100
+
101
+#: searx/templates/courgette/preferences.html:56
102
+#: searx/templates/default/preferences.html:56
103
+#: searx/templates/oscar/preferences.html:73
104
+msgid "Themes"
105
+msgstr ""
106
+
107
+#: searx/templates/courgette/preferences.html:66
108
+#: searx/templates/default/preferences.html:66
109
+msgid "Currently used search engines"
110
+msgstr ""
111
+
112
+#: searx/templates/courgette/preferences.html:70
113
+#: searx/templates/default/preferences.html:70
114
+msgid "Engine name"
115
+msgstr ""
116
+
117
+#: searx/templates/courgette/preferences.html:71
118
+#: searx/templates/default/preferences.html:71
119
+msgid "Category"
120
+msgstr ""
121
+
122
+#: searx/templates/courgette/preferences.html:72
123
+#: searx/templates/courgette/preferences.html:83
124
+#: searx/templates/default/preferences.html:72
125
+#: searx/templates/default/preferences.html:83
126
+#: searx/templates/oscar/preferences.html:110
127
+msgid "Allow"
128
+msgstr ""
129
+
130
+#: searx/templates/courgette/preferences.html:72
131
+#: searx/templates/courgette/preferences.html:84
132
+#: searx/templates/default/preferences.html:72
133
+#: searx/templates/default/preferences.html:84
134
+#: searx/templates/oscar/preferences.html:109
135
+msgid "Block"
136
+msgstr ""
137
+
138
+#: searx/templates/courgette/preferences.html:92
139
+#: searx/templates/default/preferences.html:92
140
+#: searx/templates/oscar/preferences.html:124
141
+msgid ""
142
+"These settings are stored in your cookies, this allows us not to store "
143
+"this data about you."
144
+msgstr ""
145
+
146
+#: searx/templates/courgette/preferences.html:94
147
+#: searx/templates/default/preferences.html:94
148
+#: searx/templates/oscar/preferences.html:126
149
+msgid ""
150
+"These cookies serve your sole convenience, we don't use these cookies to "
151
+"track you."
152
+msgstr ""
153
+
154
+#: searx/templates/courgette/preferences.html:97
155
+#: searx/templates/default/preferences.html:97
156
+#: searx/templates/oscar/preferences.html:129
157
+msgid "save"
158
+msgstr ""
159
+
160
+#: searx/templates/courgette/preferences.html:98
161
+#: searx/templates/default/preferences.html:98
162
+#: searx/templates/oscar/preferences.html:130
163
+msgid "back"
164
+msgstr ""
165
+
166
+#: searx/templates/courgette/results.html:12
167
+#: searx/templates/default/results.html:12
168
+#: searx/templates/oscar/results.html:70
169
+msgid "Search URL"
170
+msgstr ""
171
+
172
+#: searx/templates/courgette/results.html:16
173
+#: searx/templates/default/results.html:16
174
+#: searx/templates/oscar/results.html:75
175
+msgid "Download results"
176
+msgstr ""
177
+
178
+#: searx/templates/courgette/results.html:34
179
+#: searx/templates/default/results.html:42
180
+#: searx/templates/oscar/results.html:50
181
+msgid "Suggestions"
182
+msgstr "提案"
183
+
184
+#: searx/templates/courgette/results.html:62
185
+#: searx/templates/default/results.html:78
186
+#: searx/templates/oscar/results.html:29
187
+msgid "previous page"
188
+msgstr "前のページ"
189
+
190
+#: searx/templates/courgette/results.html:73
191
+#: searx/templates/default/results.html:89
192
+#: searx/templates/oscar/results.html:37
193
+msgid "next page"
194
+msgstr "次のページ"
195
+
196
+#: searx/templates/courgette/search.html:3
197
+#: searx/templates/default/search.html:3 searx/templates/oscar/search.html:4
198
+#: searx/templates/oscar/search_full.html:5
199
+msgid "Search for..."
200
+msgstr "検索する..."
201
+
202
+#: searx/templates/courgette/stats.html:4 searx/templates/default/stats.html:4
203
+#: searx/templates/oscar/stats.html:5
204
+msgid "Engine stats"
205
+msgstr ""
206
+
207
+#: searx/templates/default/results.html:34
208
+msgid "Answers"
209
+msgstr ""
210
+
211
+#: searx/templates/oscar/base.html:61
212
+msgid "Powered by"
213
+msgstr ""
214
+
215
+#: searx/templates/oscar/base.html:61
216
+msgid "a privacy-respecting, hackable metasearch engine"
217
+msgstr ""
218
+
219
+#: searx/templates/oscar/navbar.html:6
220
+msgid "Toggle navigation"
221
+msgstr ""
222
+
223
+#: searx/templates/oscar/navbar.html:15
224
+msgid "home"
225
+msgstr ""
226
+
227
+#: searx/templates/oscar/preferences.html:11
228
+msgid "General"
229
+msgstr ""
230
+
231
+#: searx/templates/oscar/preferences.html:12
232
+msgid "Engines"
233
+msgstr ""
234
+
235
+#: searx/templates/oscar/preferences.html:36
236
+msgid "What language do you prefer for search?"
237
+msgstr ""
238
+
239
+#: searx/templates/oscar/preferences.html:47
240
+msgid "Change the language of the layout"
241
+msgstr ""
242
+
243
+#: searx/templates/oscar/preferences.html:60
244
+msgid "Find stuff as you type"
245
+msgstr ""
246
+
247
+#: searx/templates/oscar/preferences.html:70
248
+msgid ""
249
+"Change how forms are submited, <a "
250
+"href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\""
251
+" rel=\"external\">learn more about request methods</a>"
252
+msgstr ""
253
+
254
+#: searx/templates/oscar/preferences.html:81
255
+msgid "Change searx layout"
256
+msgstr ""
257
+
258
+#: searx/templates/oscar/results.html:6
259
+msgid "Search results"
260
+msgstr ""
261
+
262
+#: searx/templates/oscar/results.html:65
263
+msgid "Links"
264
+msgstr ""
265
+
266
+#: searx/templates/oscar/search.html:6 searx/templates/oscar/search_full.html:7
267
+msgid "Start search"
268
+msgstr ""
269
+
270
+#: searx/templates/oscar/search_full.html:11
271
+msgid "Show search filters"
272
+msgstr ""
273
+
274
+#: searx/templates/oscar/search_full.html:11
275
+msgid "Hide search filters"
276
+msgstr ""
277
+
278
+#: searx/templates/oscar/stats.html:2
279
+msgid "stats"
280
+msgstr ""
281
+
282
+#: searx/templates/oscar/messages/first_time.html:4
283
+#: searx/templates/oscar/messages/no_results.html:5
284
+#: searx/templates/oscar/messages/save_settings_successfull.html:5
285
+#: searx/templates/oscar/messages/unknow_error.html:5
286
+msgid "Close"
287
+msgstr ""
288
+
289
+#: searx/templates/oscar/messages/first_time.html:6
290
+#: searx/templates/oscar/messages/no_data_available.html:3
291
+msgid "Heads up!"
292
+msgstr ""
293
+
294
+#: searx/templates/oscar/messages/first_time.html:7
295
+msgid "It look like you are using searx first time."
296
+msgstr ""
297
+
298
+#: searx/templates/oscar/messages/js_disabled.html:2
299
+msgid "Warning!"
300
+msgstr ""
301
+
302
+#: searx/templates/oscar/messages/js_disabled.html:3
303
+msgid "Please enable JavaScript to use full functionality of this site."
304
+msgstr ""
305
+
306
+#: searx/templates/oscar/messages/no_data_available.html:4
307
+msgid "There is currently no data available. "
308
+msgstr ""
309
+
310
+#: searx/templates/oscar/messages/no_results.html:7
311
+msgid "Sorry!"
312
+msgstr ""
313
+
314
+#: searx/templates/oscar/messages/no_results.html:8
315
+msgid ""
316
+"we didn't find any results. Please use another query or search in more "
317
+"categories."
318
+msgstr ""
319
+
320
+#: searx/templates/oscar/messages/save_settings_successfull.html:7
321
+msgid "Well done!"
322
+msgstr ""
323
+
324
+#: searx/templates/oscar/messages/save_settings_successfull.html:8
325
+msgid "Settings saved successfully."
326
+msgstr ""
327
+
328
+#: searx/templates/oscar/messages/unknow_error.html:7
329
+msgid "Oh snap!"
330
+msgstr ""
331
+
332
+#: searx/templates/oscar/messages/unknow_error.html:8
333
+msgid "Something went wrong."
334
+msgstr ""
335
+
336
+#: searx/templates/oscar/result_templates/images.html:20
337
+msgid "Get image"
338
+msgstr ""
339
+
340
+#: searx/templates/oscar/result_templates/images.html:21
341
+msgid "View source"
342
+msgstr ""
343
+
344
+#: searx/templates/oscar/result_templates/torrent.html:7
345
+msgid "Seeder"
346
+msgstr ""
347
+
348
+#: searx/templates/oscar/result_templates/torrent.html:7
349
+msgid "Leecher"
350
+msgstr ""
351
+
352
+# categories - manually added
353
+# TODO - automatically add
354
+msgid "files"
355
+msgstr "ファイル"
356
+
357
+msgid "map"
358
+msgstr "地図"
359
+
360
+msgid "music"
361
+msgstr "音楽"
362
+
363
+msgid "social media"
364
+msgstr "ソーシャルメディア"
365
+
366
+msgid "images"
367
+msgstr "画像"
368
+
369
+msgid "videos"
370
+msgstr "動画"
371
+
372
+msgid "it"
373
+msgstr "情報技術"
374
+
375
+msgid "news"
376
+msgstr "ニュース"
377
+

Binär
searx/translations/nl/LC_MESSAGES/messages.mo Visa fil


+ 29
- 26
searx/translations/nl/LC_MESSAGES/messages.po Visa fil

@@ -8,8 +8,8 @@ msgid ""
8 8
 msgstr ""
9 9
 "Project-Id-Version:  searx\n"
10 10
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11
-"POT-Creation-Date: 2014-10-01 19:45+0200\n"
12
-"PO-Revision-Date: 2014-03-15 20:20+0000\n"
11
+"POT-Creation-Date: 2014-10-26 19:10+0100\n"
12
+"PO-Revision-Date: 2014-09-09 15:33+0000\n"
13 13
 "Last-Translator: André Koot <meneer@tken.net>\n"
14 14
 "Language-Team: Dutch "
15 15
 "(http://www.transifex.com/projects/p/searx/language/nl/)\n"
@@ -19,31 +19,31 @@ msgstr ""
19 19
 "Content-Transfer-Encoding: 8bit\n"
20 20
 "Generated-By: Babel 1.3\n"
21 21
 
22
-#: searx/webapp.py:252
22
+#: searx/webapp.py:305
23 23
 msgid "{minutes} minute(s) ago"
24
-msgstr ""
24
+msgstr "{minutes} min geleden"
25 25
 
26
-#: searx/webapp.py:254
26
+#: searx/webapp.py:307
27 27
 msgid "{hours} hour(s), {minutes} minute(s) ago"
28
-msgstr ""
28
+msgstr "{hours} uur, {minutes} min geleden"
29 29
 
30
-#: searx/engines/__init__.py:164
30
+#: searx/engines/__init__.py:177
31 31
 msgid "Page loads (sec)"
32 32
 msgstr "Pagina laadt (sec)"
33 33
 
34
-#: searx/engines/__init__.py:168
34
+#: searx/engines/__init__.py:181
35 35
 msgid "Number of results"
36 36
 msgstr "Aantal zoekresultaten"
37 37
 
38
-#: searx/engines/__init__.py:172
38
+#: searx/engines/__init__.py:185
39 39
 msgid "Scores"
40 40
 msgstr "Scores"
41 41
 
42
-#: searx/engines/__init__.py:176
42
+#: searx/engines/__init__.py:189
43 43
 msgid "Scores per result"
44 44
 msgstr "Scores per zoekresultaat"
45 45
 
46
-#: searx/engines/__init__.py:180
46
+#: searx/engines/__init__.py:193
47 47
 msgid "Errors"
48 48
 msgstr "Fouten"
49 49
 
@@ -171,30 +171,30 @@ msgstr "terug"
171 171
 
172 172
 #: searx/templates/courgette/results.html:12
173 173
 #: searx/templates/default/results.html:12
174
-#: searx/templates/oscar/results.html:74
174
+#: searx/templates/oscar/results.html:70
175 175
 msgid "Search URL"
176 176
 msgstr "Zoek URL"
177 177
 
178 178
 #: searx/templates/courgette/results.html:16
179 179
 #: searx/templates/default/results.html:16
180
-#: searx/templates/oscar/results.html:79
180
+#: searx/templates/oscar/results.html:75
181 181
 msgid "Download results"
182 182
 msgstr "Downloaden zoekresultaten"
183 183
 
184 184
 #: searx/templates/courgette/results.html:34
185
-#: searx/templates/default/results.html:34
186
-#: searx/templates/oscar/results.html:51
185
+#: searx/templates/default/results.html:42
186
+#: searx/templates/oscar/results.html:50
187 187
 msgid "Suggestions"
188 188
 msgstr "Suggesties"
189 189
 
190 190
 #: searx/templates/courgette/results.html:62
191
-#: searx/templates/default/results.html:62
191
+#: searx/templates/default/results.html:78
192 192
 #: searx/templates/oscar/results.html:29
193 193
 msgid "previous page"
194 194
 msgstr "vorige pagina"
195 195
 
196 196
 #: searx/templates/courgette/results.html:73
197
-#: searx/templates/default/results.html:73
197
+#: searx/templates/default/results.html:89
198 198
 #: searx/templates/oscar/results.html:37
199 199
 msgid "next page"
200 200
 msgstr "volgende pagina"
@@ -210,6 +210,10 @@ msgstr "Zoeken naar..."
210 210
 msgid "Engine stats"
211 211
 msgstr "Zoekmachinestatistieken"
212 212
 
213
+#: searx/templates/default/results.html:34
214
+msgid "Answers"
215
+msgstr ""
216
+
213 217
 #: searx/templates/oscar/base.html:61
214 218
 msgid "Powered by"
215 219
 msgstr ""
@@ -227,14 +231,12 @@ msgid "home"
227 231
 msgstr ""
228 232
 
229 233
 #: searx/templates/oscar/preferences.html:11
230
-#, fuzzy
231 234
 msgid "General"
232
-msgstr "algemeen"
235
+msgstr ""
233 236
 
234 237
 #: searx/templates/oscar/preferences.html:12
235
-#, fuzzy
236 238
 msgid "Engines"
237
-msgstr "Zoekmachinestatistieken"
239
+msgstr ""
238 240
 
239 241
 #: searx/templates/oscar/preferences.html:36
240 242
 msgid "What language do you prefer for search?"
@@ -260,11 +262,10 @@ msgid "Change searx layout"
260 262
 msgstr ""
261 263
 
262 264
 #: searx/templates/oscar/results.html:6
263
-#, fuzzy
264 265
 msgid "Search results"
265
-msgstr "Aantal zoekresultaten"
266
+msgstr ""
266 267
 
267
-#: searx/templates/oscar/results.html:68
268
+#: searx/templates/oscar/results.html:65
268 269
 msgid "Links"
269 270
 msgstr ""
270 271
 
@@ -339,9 +340,8 @@ msgid "Something went wrong."
339 340
 msgstr ""
340 341
 
341 342
 #: searx/templates/oscar/result_templates/images.html:20
342
-#, fuzzy
343 343
 msgid "Get image"
344
-msgstr "volgende pagina"
344
+msgstr ""
345 345
 
346 346
 #: searx/templates/oscar/result_templates/images.html:21
347 347
 msgid "View source"
@@ -378,3 +378,6 @@ msgstr "it"
378 378
 msgid "news"
379 379
 msgstr "nieuws"
380 380
 
381
+msgid "map"
382
+msgstr "kaart"
383
+

+ 7
- 3
searx/utils.py Visa fil

@@ -1,4 +1,4 @@
1
-#import htmlentitydefs
1
+# import htmlentitydefs
2 2
 from codecs import getincrementalencoder
3 3
 from HTMLParser import HTMLParser
4 4
 from random import choice
@@ -20,6 +20,10 @@ def gen_useragent():
20 20
     return ua.format(os=choice(ua_os), version=choice(ua_versions))
21 21
 
22 22
 
23
+def searx_useragent():
24
+    return 'searx'
25
+
26
+
23 27
 def highlight_content(content, query):
24 28
 
25 29
     if not content:
@@ -64,8 +68,8 @@ class HTMLTextExtractor(HTMLParser):
64 68
         self.result.append(unichr(codepoint))
65 69
 
66 70
     def handle_entityref(self, name):
67
-        #codepoint = htmlentitydefs.name2codepoint[name]
68
-        #self.result.append(unichr(codepoint))
71
+        # codepoint = htmlentitydefs.name2codepoint[name]
72
+        # self.result.append(unichr(codepoint))
69 73
         self.result.append(name)
70 74
 
71 75
     def get_text(self):

+ 64
- 12
searx/webapp.py Visa fil

@@ -50,13 +50,16 @@ from searx.search import Search
50 50
 from searx.query import Query
51 51
 from searx.autocomplete import backends as autocomplete_backends
52 52
 
53
+from urlparse import urlparse
54
+import re
55
+
53 56
 
54 57
 static_path, templates_path, themes =\
55 58
     get_themes(settings['themes_path']
56 59
                if settings.get('themes_path')
57 60
                else searx_dir)
58
-default_theme = settings['default_theme'] if \
59
-    settings.get('default_theme', None) else 'default'
61
+
62
+default_theme = settings['server'].get('default_theme', 'default')
60 63
 
61 64
 app = Flask(
62 65
     __name__,
@@ -143,14 +146,14 @@ def render(template_name, override_theme=None, **kwargs):
143 146
 
144 147
     nonblocked_categories = set(chain.from_iterable(nonblocked_categories))
145 148
 
146
-    if not 'categories' in kwargs:
149
+    if 'categories' not in kwargs:
147 150
         kwargs['categories'] = ['general']
148 151
         kwargs['categories'].extend(x for x in
149 152
                                     sorted(categories.keys())
150 153
                                     if x != 'general'
151 154
                                     and x in nonblocked_categories)
152 155
 
153
-    if not 'selected_categories' in kwargs:
156
+    if 'selected_categories' not in kwargs:
154 157
         kwargs['selected_categories'] = []
155 158
         for arg in request.args:
156 159
             if arg.startswith('category_'):
@@ -165,7 +168,7 @@ def render(template_name, override_theme=None, **kwargs):
165 168
     if not kwargs['selected_categories']:
166 169
         kwargs['selected_categories'] = ['general']
167 170
 
168
-    if not 'autocomplete' in kwargs:
171
+    if 'autocomplete' not in kwargs:
169 172
         kwargs['autocomplete'] = autocomplete
170 173
 
171 174
     kwargs['method'] = request.cookies.get('method', 'POST')
@@ -201,23 +204,72 @@ def index():
201 204
             'index.html',
202 205
         )
203 206
 
204
-    search.results, search.suggestions, search.answers, search.infoboxes = search.search(request)
207
+    search.results, search.suggestions,\
208
+        search.answers, search.infoboxes = search.search(request)
205 209
 
206 210
     for result in search.results:
207 211
 
208 212
         if not search.paging and engines[result['engine']].paging:
209 213
             search.paging = True
210 214
 
215
+        # check if HTTPS rewrite is required
211 216
         if settings['server']['https_rewrite']\
212 217
            and result['parsed_url'].scheme == 'http':
213 218
 
214
-            for http_regex, https_url in https_rules:
215
-                if http_regex.match(result['url']):
216
-                    result['url'] = http_regex.sub(https_url, result['url'])
217
-                    # TODO result['parsed_url'].scheme
219
+            skip_https_rewrite = False
220
+
221
+            # check if HTTPS rewrite is possible
222
+            for target, rules, exclusions in https_rules:
223
+
224
+                # check if target regex match with url
225
+                if target.match(result['url']):
226
+                    # process exclusions
227
+                    for exclusion in exclusions:
228
+                        # check if exclusion match with url
229
+                        if exclusion.match(result['url']):
230
+                            skip_https_rewrite = True
231
+                            break
232
+
233
+                    # skip https rewrite if required
234
+                    if skip_https_rewrite:
235
+                        break
236
+
237
+                    # process rules
238
+                    for rule in rules:
239
+                        try:
240
+                            # TODO, precompile rule
241
+                            p = re.compile(rule[0])
242
+
243
+                            # rewrite url if possible
244
+                            new_result_url = p.sub(rule[1], result['url'])
245
+                        except:
246
+                            break
247
+
248
+                        # parse new url
249
+                        new_parsed_url = urlparse(new_result_url)
250
+
251
+                        # continiue if nothing was rewritten
252
+                        if result['url'] == new_result_url:
253
+                            continue
254
+
255
+                        # get domainname from result
256
+                        # TODO, does only work correct with TLD's like
257
+                        #  asdf.com, not for asdf.com.de
258
+                        # TODO, using publicsuffix instead of this rewrite rule
259
+                        old_result_domainname = '.'.join(
260
+                            result['parsed_url'].hostname.split('.')[-2:])
261
+                        new_result_domainname = '.'.join(
262
+                            new_parsed_url.hostname.split('.')[-2:])
263
+
264
+                        # check if rewritten hostname is the same,
265
+                        # to protect against wrong or malicious rewrite rules
266
+                        if old_result_domainname == new_result_domainname:
267
+                            # set new url
268
+                            result['url'] = new_result_url
269
+
270
+                    # target has matched, do not search over the other rules
218 271
                     break
219 272
 
220
-        # HTTPS rewrite
221 273
         if search.request_data.get('format', 'html') == 'html':
222 274
             if 'content' in result:
223 275
                 result['content'] = highlight_content(result['content'],
@@ -384,7 +436,7 @@ def preferences():
384 436
         for pd_name, pd in request.form.items():
385 437
             if pd_name.startswith('category_'):
386 438
                 category = pd_name[9:]
387
-                if not category in categories:
439
+                if category not in categories:
388 440
                     continue
389 441
                 selected_categories.append(category)
390 442
             elif pd_name == 'locale' and pd in settings['locales']:

+ 2
- 1
setup.py Visa fil

@@ -15,7 +15,7 @@ long_description = read('README.rst')
15 15
 
16 16
 setup(
17 17
     name='searx',
18
-    version="0.3.1",
18
+    version="0.4.0",
19 19
     description="A privacy-respecting, hackable metasearch engine",
20 20
     long_description=long_description,
21 21
     classifiers=[
@@ -70,6 +70,7 @@ setup(
70 70
             'translations/*/*/*',
71 71
             'templates/*/*.xml',
72 72
             'templates/*/*.html',
73
+            'https_rules/*.xml',
73 74
             'templates/*/result_templates/*.html',
74 75
         ],
75 76
     },