mirror of https://github.com/searx/searx
[fix] digg now requires cookie for search
This commit is contained in:
parent
700baf2178
commit
a49cc18f9c
|
@ -10,6 +10,8 @@
|
||||||
@parse url, title, content, publishedDate, thumbnail
|
@parse url, title, content, publishedDate, thumbnail
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import random
|
||||||
|
import string
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
from json import loads
|
from json import loads
|
||||||
from lxml import html
|
from lxml import html
|
||||||
|
@ -36,6 +38,10 @@ def request(query, params):
|
||||||
offset = (params['pageno'] - 1) * 10
|
offset = (params['pageno'] - 1) * 10
|
||||||
params['url'] = search_url.format(position=offset,
|
params['url'] = search_url.format(position=offset,
|
||||||
query=quote_plus(query))
|
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
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue