From d0001f10e6c604f3094d728bed703a60baa9ae17 Mon Sep 17 00:00:00 2001 From: Kirill Isakov Date: Wed, 30 Mar 2016 17:30:46 +0600 Subject: Add searx user agent to Reddit engine request to comply with API usage terms --- searx/engines/reddit.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'searx') diff --git a/searx/engines/reddit.py b/searx/engines/reddit.py index 9729898e5..08c4fde4b 100644 --- a/searx/engines/reddit.py +++ b/searx/engines/reddit.py @@ -15,6 +15,7 @@ from cgi import escape from urllib import urlencode from urlparse import urlparse from datetime import datetime +from searx.utils import searx_useragent # engine dependent config categories = ['general', 'images', 'news', 'social media'] @@ -30,6 +31,9 @@ def request(query, params): 'limit': page_size}) params['url'] = search_url.format(query=query) + # using searx User-Agent + params['headers']['User-Agent'] = searx_useragent() + return params -- cgit v1.2.3-54-g00ecf