Browse Source

[fix] digg now requires cookie for search

misnyo 7 years ago
parent
commit
a49cc18f9c
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      searx/engines/digg.py

+ 6
- 0
searx/engines/digg.py View File

10
  @parse       url, title, content, publishedDate, thumbnail
10
  @parse       url, title, content, publishedDate, thumbnail
11
 """
11
 """
12
 
12
 
13
+import random
14
+import string
13
 from dateutil import parser
15
 from dateutil import parser
14
 from json import loads
16
 from json import loads
15
 from lxml import html
17
 from lxml import html
36
     offset = (params['pageno'] - 1) * 10
38
     offset = (params['pageno'] - 1) * 10
37
     params['url'] = search_url.format(position=offset,
39
     params['url'] = search_url.format(position=offset,
38
                                       query=quote_plus(query))
40
                                       query=quote_plus(query))
41
+    params['cookies']['frontend.auid'] = ''.join(random.choice(
42
+        string.ascii_uppercase +
43
+        string.ascii_lowercase +
44
+        string.digits + "+_") for _ in range(22))
39
     return params
45
     return params
40
 
46
 
41
 
47