diff options
author | Alexandre Flament <alex@al-f.net> | 2021-04-22 12:21:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 12:21:31 +0200 |
commit | 981cdb7acf4b7d90a596654c3f7c35c4ecec6eb8 (patch) | |
tree | 24ee8014aac41954b8a212d155f4fa213d28834d /searx | |
parent | e9508cc89711e7f80fa12db54478c1cdad350416 (diff) | |
parent | e9a6ab4015ff0dbc6f617a5f643428c62421dde0 (diff) | |
download | searxng-981cdb7acf4b7d90a596654c3f7c35c4ecec6eb8.tar.gz searxng-981cdb7acf4b7d90a596654c3f7c35c4ecec6eb8.zip |
Merge pull request #10 from return42/fix-youtube
[fix] youtube - send CONSENT Cookie to not be redirected
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/youtube_noapi.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/searx/engines/youtube_noapi.py b/searx/engines/youtube_noapi.py index 0933eec68..68b75bc72 100644 --- a/searx/engines/youtube_noapi.py +++ b/searx/engines/youtube_noapi.py @@ -3,6 +3,7 @@ Youtube (Videos) """ +from datetime import datetime from functools import reduce from json import loads, dumps from urllib.parse import quote_plus @@ -56,6 +57,7 @@ def request(query, params): }) 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 |