mirror of
				https://git.sr.ht/~cadence/NewLeaf
				synced 2025-10-31 11:35:35 +00:00 
			
		
		
		
	change CONSENT cookie value
FX is accept all tracking, PENDING should imply no tracking
This commit is contained in:
		
							parent
							
								
									5f47e1a71b
								
							
						
					
					
						commit
						aaf7d65b32
					
				| @ -18,7 +18,7 @@ def extract_channel(ucid): | ||||
| 			return channel_cache[ucid] | ||||
| 
 | ||||
| 	channel_type = "channel" if len(ucid) == 24 and ucid[:2] == "UC" else "user" | ||||
| 	with requests.get("https://www.youtube.com/{}/{}/videos?hl=en".format(channel_type, ucid), cookies={"CONSENT": "YES+cb.20210328-17-p0.en+FX+101"}) as r: | ||||
| 	with requests.get("https://www.youtube.com/{}/{}/videos?hl=en".format(channel_type, ucid), cookies={"CONSENT": "PENDING+999"}) as r: | ||||
| 		r.raise_for_status() | ||||
| 		yt_initial_data = extract_yt_initial_data(r.content.decode("utf8")) | ||||
| 
 | ||||
|  | ||||
| @ -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) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user