Damn YouTube is pushing the ads these days. I don't remember last time I opened YouTube and didn't see an ad on open. I'm logged into Chrome, no VPN or funny business. What a racket.
#!/bin/sh
x(){ bssl client -connect www.youtube.com:443;};
x(){ openssl s_client -connect www.youtube.com:443 -ign_eof;};
read x;
printf "%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\n" \
"POST /youtubei/v1/player?key=AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w HTTP/1.1" \
"Host: www.youtube.com" \
"Content-Type: x-www-form-urlencoded" \
"Content-Length: 121" \
"Connection: close" \
"" \
'{"videoId":"'$x'","context":{"client":{"clientName":"ANDROID","clientVersion":"17.10.35","androidSdkVersion":30}}}' \
|x|sed -n "/itag=22&/{s/.*: ./<a href=/;s/\",/>$x<\/a>/p;}"
Usage: echo RfNdaYqVxR0|1.sh > 1.htm
chrome ./1.htm