mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
reddit: add gen_useragent
This commit is contained in:
parent
f5eb56b63f
commit
af76e7a82c
1 changed files with 2 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
import json
|
import json
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from urllib.parse import urlencode, urljoin, urlparse
|
from urllib.parse import urlencode, urljoin, urlparse
|
||||||
|
from searx.utils import gen_useragent
|
||||||
|
|
||||||
# about
|
# about
|
||||||
about = {
|
about = {
|
||||||
|
@ -30,6 +31,7 @@ def request(query, params):
|
||||||
|
|
||||||
query = urlencode({'q': query, 'limit': page_size})
|
query = urlencode({'q': query, 'limit': page_size})
|
||||||
params['url'] = search_url.format(query=query)
|
params['url'] = search_url.format(query=query)
|
||||||
|
params['headers']['User-Agent'] = gen_useragent()
|
||||||
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue