mirror of
https://github.com/searxng/searxng
synced 2024-11-09 01:10:26 +00:00
Merge pull request #10 from return42/fix-youtube
[fix] youtube - send CONSENT Cookie to not be redirected
This commit is contained in:
commit
981cdb7acf
@ -3,6 +3,7 @@
|
|||||||
Youtube (Videos)
|
Youtube (Videos)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
from json import loads, dumps
|
from json import loads, dumps
|
||||||
from urllib.parse import quote_plus
|
from urllib.parse import quote_plus
|
||||||
@ -56,6 +57,7 @@ def request(query, params):
|
|||||||
})
|
})
|
||||||
params['headers']['Content-Type'] = 'application/json'
|
params['headers']['Content-Type'] = 'application/json'
|
||||||
|
|
||||||
|
params['headers']['Cookie'] = "CONSENT=YES+cb.%s-17-p0.en+F+941;" % datetime.now().strftime("%Y%m%d")
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user