1
0
Fork 0
mirror of https://git.sr.ht/~cadence/NewLeaf synced 2026-03-24 21:31:36 +00:00

change CONSENT cookie value

FX is accept all tracking, PENDING should imply no tracking
This commit is contained in:
bopol 2021-04-03 06:37:51 +02:00 committed by Cadence Ember
parent 5f47e1a71b
commit aaf7d65b32
No known key found for this signature in database
GPG key ID: BC1C2C61CF521B17
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@ ytdl = yt_dlp.YoutubeDL(ytdl_opts)
def extract_search(q):
try:
with requests.get("https://www.youtube.com/results", params={"q": q, "hl": "en"}, cookies={"CONSENT": "YES+cb.20210328-17-p0.en+FX+101"}) as r:
with requests.get("https://www.youtube.com/results", params={"q": q, "hl": "en"}, cookies={"CONSENT": "PENDING+999"}) as r:
r.raise_for_status()
content = r.content.decode("utf8")
yt_initial_data = extract_yt_initial_data(content)