diff options
author | Kirill Isakov <ukwt@ya.ru> | 2016-03-30 17:30:46 +0600 |
---|---|---|
committer | Kirill Isakov <ukwt@ya.ru> | 2016-03-30 17:30:46 +0600 |
commit | d0001f10e6c604f3094d728bed703a60baa9ae17 (patch) | |
tree | cc78fb6c7e62a8e98eff1473376ad51fdd864289 /searx/engines/reddit.py | |
parent | 0bfbdff234535f0a190f272d2f03d7a801b74e10 (diff) | |
download | searxng-d0001f10e6c604f3094d728bed703a60baa9ae17.tar.gz searxng-d0001f10e6c604f3094d728bed703a60baa9ae17.zip |
Add searx user agent to Reddit engine request to comply with API usage terms
Diffstat (limited to 'searx/engines/reddit.py')
-rw-r--r-- | searx/engines/reddit.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 |