forked from Ponysearch/Ponysearch
Merge pull request #10 from return42/fix-youtube
[fix] youtube - send CONSENT Cookie to not be redirected
This commit is contained in:
commit
981cdb7acf
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue