Skip to content

Instantly share code, notes, and snippets.

{
"00 Multicontainer Test": {
"container_links": {
"test_container_a": [
{
"name": "container_b",
"source_container": "test_container_b"
}
]
},
<?php
@set_time_limit(0); //disable time limit to make sure the whole video is streamed to the client
$id = $_GET['id']; //the youtube video ID
$type = $_GET['type']; //the MIME type of the desired format
parse_str(file_get_contents('http://www.youtube.com/get_video_info?video_id='.$id),$info); //get video info
$streams = explode(',',$info['url_encoded_fmt_stream_map']); //split the stream map into streams
foreach($streams as $stream){
parse_str($stream,$real_stream); //parse the splitted stream