summaryrefslogtreecommitdiff
path: root/searx/engines/youtube_noapi.py
diff options
context:
space:
mode:
authorEmilien Devos <github@emiliendevos.be>2022-07-09 23:08:08 +0200
committerGitHub <noreply@github.com>2022-07-09 21:33:24 +0000
commit6face215b83a268962f2fcc0a1b72719d6bff8c7 (patch)
treee58e3a31135d30efd3bf9ffed3cf79e5e1d2d874 /searx/engines/youtube_noapi.py
parent641e39b0df38ec84f77362c070b5974b31c81a6c (diff)
downloadsearxng-6face215b83a268962f2fcc0a1b72719d6bff8c7.tar.gz
searxng-6face215b83a268962f2fcc0a1b72719d6bff8c7.zip
bypass google consent with ucbcb=1
Diffstat (limited to 'searx/engines/youtube_noapi.py')
-rw-r--r--searx/engines/youtube_noapi.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/searx/engines/youtube_noapi.py b/searx/engines/youtube_noapi.py
index 406314684..30f89d72f 100644
--- a/searx/engines/youtube_noapi.py
+++ b/searx/engines/youtube_noapi.py
@@ -3,7 +3,6 @@
Youtube (Videos)
"""
-from datetime import datetime
from functools import reduce
from json import loads, dumps
from urllib.parse import quote_plus
@@ -26,7 +25,7 @@ time_range_support = True
# search-url
base_url = 'https://www.youtube.com/results'
-search_url = base_url + '?search_query={query}&page={page}'
+search_url = base_url + '?search_query={query}&page={page}&ucbcb=1'
time_range_url = '&sp=EgII{time_range}%253D%253D'
# the key seems to be constant
next_page_url = 'https://www.youtube.com/youtubei/v1/search?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8'
@@ -52,7 +51,6 @@ 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