commit: a49cc18f9c9b09c59daebe503f89d02d7357705f
parent 700baf2178d5970cef7cd1efaf24522a458a6b55
Author: misnyo <misnyo@misnyo.eu>
Date: Wed, 30 Aug 2017 18:20:43 +0200
[fix] digg now requires cookie for search
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git 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