diff options
author | misnyo <misnyo@misnyo.eu> | 2017-08-30 18:20:43 +0200 |
---|---|---|
committer | misnyo <misnyo@misnyo.eu> | 2017-08-30 19:51:33 +0200 |
commit | a49cc18f9c9b09c59daebe503f89d02d7357705f (patch) | |
tree | 50d98840a3505d5b8e41cd5ccfc38b159a544c10 | |
parent | 700baf2178d5970cef7cd1efaf24522a458a6b55 (diff) | |
download | searxng-a49cc18f9c9b09c59daebe503f89d02d7357705f.tar.gz searxng-a49cc18f9c9b09c59daebe503f89d02d7357705f.zip |
[fix] digg now requires cookie for search
-rw-r--r-- | searx/engines/digg.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/searx/engines/digg.py b/searx/engines/digg.py index 606747a4d..84f1ea599 100644 --- a/searx/engines/digg.py +++ b/searx/engines/digg.py @@ -10,6 +10,8 @@ @parse url, title, content, publishedDate, thumbnail """ +import random +import string from dateutil import parser from json import loads from lxml import html @@ -36,6 +38,10 @@ def request(query, params): offset = (params['pageno'] - 1) * 10 params['url'] = search_url.format(position=offset, query=quote_plus(query)) + params['cookies']['frontend.auid'] = ''.join(random.choice( + string.ascii_uppercase + + string.ascii_lowercase + + string.digits + "+_") for _ in range(22)) return params |