Error 403 when trying to play the direct URL of the generated blogger video with curl

401 Views Asked by At

when trying to reproduce the url rescued from the code below I get a 403 error, but when opening the url directly it works https://www.blogger.com/video.g?token=AD6v5dz8fGJIfh9owHm8_SRdSkqD8g5Y9pnwKdDak1KzDrzPQG1aJigXD2AK-G_QD2-NQomPJXMV4aG_eG7ft_abAK07fZbY_I25kkdfgOguD0lrU0y-qR1JdbQX7AYsm3XK7rOUBKCD

https://rr1---sn-p5qlsndr.googlevideo.com/videoplayback?expire=1649837590&ei=lRVWYvasO-aF_9EPw9Ct-As&ip=18.207.249.251&id=0278c50fe6a211d5&itag=22&source=blogger&mh=8g&mm=31&mn=sn-p5qlsndr&ms=au&mv=m&mvi=1&pl=16&susc=bl&eaua=do0w1CEA3T4&mime=video/mp4&vprv=1&dur=240.396&lmt=1649790419999233&mt=1649808299&txp=1311224&sparams=expire,ei,ip,id,itag,source,susc,eaua,mime,vprv,dur,lmt&sig=AOq0QJ8wRQIhALPcfgLupszvnU93pLJFJguqbl2i6bs-XOWTCHuU48-OAiBiHJkRFt0L3hGfz_rix-T4q1ZMFg_LuaKmQptafhNGdg%3D%3D&lsparams=mh,mm,mn,ms,mv,mvi,pl&lsig=AG3C_xAwRAIgVLt5vtKphkKg-tnC9qC4wIG8sQdfyA_rxdKuAqkSJUkCIHdz8F2p9c8Uk5GagGSKCqG5ksVc3zlo7efGBF1cKY30&title=Kaginado%202%20Epis%C3%B3dio%201

$url = "https://www.blogger.com/video.g?token=AD6v5dz8fGJIfh9owHm8_SRdSkqD8g5Y9pnwKdDak1KzDrzPQG1aJigXD2AK-G_QD2-NQomPJXMV4aG_eG7ft_abAK07fZbY_I25kkdfgOguD0lrU0y-qR1JdbQX7AYsm3XK7rOUBKCD";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);

1

There are 1 best solutions below

0
Raftx24 On

When you open it from the browser, you will send more data such as cookie or referrer. Probably they will check this information.
One option is to copy requests as curl in chrome(or probably in many browsers). in chrome, you can open developer tools(View -> Developer -> Developer Tools) and then you can click on Network Tab. then you can see network requests. you can right-click on one of them and then go to copy -> copy as curl, this command has all data