summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAlex <alex@al-f.net>2018-08-05 10:55:42 +0200
committerAlex <alex@al-f.net>2018-08-05 10:55:42 +0200
commit50c836864a9a7a765561d886b11f44d8cea0bce9 (patch)
tree2075a7d35a02836c5f9909c48fbd2e11897e16c7 /searx
parent066bd916bf0c0344c978d2ea46cf9e9960841a61 (diff)
downloadsearxng-50c836864a9a7a765561d886b11f44d8cea0bce9.tar.gz
searxng-50c836864a9a7a765561d886b11f44d8cea0bce9.zip
fetch_firefox_version.py : compatible with Python 3 and minor fixes.
Diffstat (limited to 'searx')
-rw-r--r--searx/data/useragents.json19
-rw-r--r--searx/utils.py4
2 files changed, 11 insertions, 12 deletions
diff --git a/searx/data/useragents.json b/searx/data/useragents.json
index ba80ce885..850bc418a 100644
--- a/searx/data/useragents.json
+++ b/searx/data/useragents.json
@@ -1,15 +1,14 @@
{
+ "ua": "Mozilla/5.0 ({os}; rv:{version}) Gecko/20100101 Firefox/{version}",
+ "versions": [
+ "61.0.1",
+ "61.0",
+ "60.0.2",
+ "60.0.1",
+ "60.0"
+ ],
"os": [
- "Windows NT 10; WOW64",
+ "Windows NT 10; WOW64",
"X11; Linux x86_64"
- ],
- "ua": "Mozilla/5.0 ({os}; rv:{version}) Gecko/20100101 Firefox/{version}",
- "versions": [
- "59.0.2",
- "59.0.1",
- "59.0",
- "58.0.2",
- "58.0.1",
- "58.0"
]
} \ No newline at end of file
diff --git a/searx/utils.py b/searx/utils.py
index f457284e3..dfa22c5fc 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -54,8 +54,8 @@ def searx_useragent():
suffix=settings['outgoing'].get('useragent_suffix', ''))
-def gen_useragent():
- return str(useragents['ua'].format(os=choice(useragents['os']), version=choice(useragents['versions'])))
+def gen_useragent(os=None):
+ return str(useragents['ua'].format(os=os or choice(useragents['os']), version=choice(useragents['versions'])))
def highlight_content(content, query):