New preg-repleace for youtube

Posted by marc on Stack Overflow See other posts from Stack Overflow or by marc
Published on 2010-04-04T09:14:31Z Indexed on 2010/04/04 9:23 UTC
Read the original article Hit count: 542

Filed under:
|
|
|

Welcome,

I notice that Youtube make some changes into their website code.

Anyone have idea how make it working today ?

That's my script (don't work anymore)

preg_match('/"video_id": "(.*?)"/', $page, $match);
$var_id = $match[1];

preg_match('/"t": "(.*?)"/', $page, $match);
$var_t = $match[1];

Look at source of example Youtube video page:

http://www.youtube.com/watch?v=w_J27GxPNM0 (yes i like that song very much)

Now the t variable can be found under

<script>
  (function() {
   var isIE = /*@cc_on!@*/false;

I dont paste full because it's very long.

Regards

© Stack Overflow or respective owner

Related posts about youtube

Related posts about download