Created
November 25, 2011 15:04
-
-
Save celmaun/1393725 to your computer and use it in GitHub Desktop.
Grab youtube video download URLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
preg_match("/yt\.setConfig\(\{\s+\'PLAYER_CONFIG\'\:\s(?<config>.*?)\s+\}\)/s", $page, $matches); | |
$config = json_decode($matches['config']); | |
$fmts = explode(',', $config->args->url_encoded_fmt_stream_map); | |
foreach( $fmts as $k => $v ) { parse_str($v, $fmts[$k]); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment