Note that there are some explanatory texts on larger screens.

plurals
  1. POPlay Youtube videos using Curl
    text
    copied!<p>I'm using Curl to scrape Youtube like this:</p> <pre><code>&lt;?php $url = "http://www.youtube.com/watch?v=RnpyRe_7jZA"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $curl_scraped_page = curl_exec($ch); curl_close($ch); $curl_scraped_page = preg_replace("#(&lt;\s*a\s+[^&gt;]*href\s*=\s*[\"'])(?!http)([^\"'&gt;]+)([\"'&gt;]+)#",'$1http://www.youtube.com$2$3', $curl_scraped_page); echo $curl_scraped_page; ?&gt; </code></pre> <p>This will load the page but it will not play the youtube video (giving me error). What can I do to make it play? I Googled but there isn't much info on this problem.</p> <p>This is part of what I see in my console when I hit the play button:</p> <pre><code>GET http://r1---sn-5hn7zn7r.c.youtube.com/videoplayback?algorithm=throttle-fact…r%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&amp;sver=3&amp;upn=CKRxxB49gXE 403 (Forbidden) www-watch-extra-vflTE8ErJ.js:85 GET http://tc.v21.cache3.c.youtube.com/videoplayback?algorithm=throttle-factor&amp;…r%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&amp;sver=3&amp;upn=CKRxxB49gXE 403 (Forbidden) tc.v21.cache3.c.youtube.com/videoplayback?algorithm=throttle-factor&amp;burst=4…2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&amp;sver=3&amp;upn=CKRxxB49gXE:1 GET http://r1---sn-5hn7zn7r.c.youtube.com/videoplayback?algorithm=throttle-fact…ver=3&amp;upn=CKRxxB49gXE&amp;ptchn=NickiMinajAtVEVO&amp;ptk=vevo&amp;cpn=uXm1XYfZqNkRDPGT 403 (Forbidden) r1---sn-5hn7zn7r.c.youtube.com/videoplayback?algorithm=throttle-factor&amp;burs…r=3&amp;upn=CKRxxB49gXE&amp;ptchn=NickiMinajAtVEVO&amp;ptk=vevo&amp;cpn=uXm1XYfZqNkRDPGT:1 GET http://tc.v21.cache3.c.youtube.com/videoplayback?algorithm=throttle-factor&amp;…RxxB49gXE&amp;ptchn=NickiMinajAtVEVO&amp;playretry=1&amp;ptk=vevo&amp;cpn=uXm1XYfZqNkRDPGT 403 (Forbidden) tc.v21.cache3.c.youtube.com/videoplayback?algorithm=throttle-factor&amp;burst=4…xB49gXE&amp;ptchn=NickiMinajAtVEVO&amp;playretry=1&amp;ptk=vevo&amp;cpn=uXm1XYfZqNkRDPGT:1 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload