/** * Create the HTML to embed the video and return it. * * @param string $url The YouTube url belonging to the video you want to show * @return string The HTML to embed the video or an empty string if the url is not found */ public static function getEmbedHTML($url) { Logger::log("Enter: YouTube::getEmbedHTML | Arg: \$url = {$url}"); $html = ''; $youtube = new YouTube(); $videoID = $youtube->parseVideoID($url); if ($videoID !== null) { $entry = $youtube->getVideoEntry($videoID); if ($entry !== null) { $videoTitle = $entry->mediaGroup->title; $videoUrl = $youtube->findFlashUrl($entry); $description = $entry->mediaGroup->description; if ($videoUrl !== null) { if ($videoTitle !== null && $videoTitle !== '') { $html .= '<p class="video-title"><a href="' . $videoUrl . '">' . $videoTitle . '</a></p>' . "\n"; } else { $html .= '<p class="video-title"><a href="' . $videoUrl . '">View video on YouTube</a></p>' . "\n"; } $html .= '<p class="video-link">' . $videoUrl . '</p>' . "\n"; $html .= '<object width="300" height="180">'; $html .= "\t" . '<param name="movie" value="' . $videoUrl . '"></param>' . "\n"; $html .= "\t" . '<param name="allowFullScreen" value="true"></param>' . "\n"; $html .= "\t" . '<param name="allowscriptaccess" value="always"></param>' . "\n"; $html .= "\t" . '<param name="wmode" value="opaque"></param>' . "\n"; $html .= "\t" . '<embed src="' . $videoUrl . '" type="application/x-shockwave-flash"' . "\n"; $html .= "\t\t" . 'allowscriptaccess="always" allowfullscreen="true" wmode="opaque" width=425" height="350"></embed>' . "\n"; $html .= '</object>' . "\n"; $html .= '<p class="video-description">' . $description . '</p>' . "\n"; } } } Logger::log("Exit: YouTube::getEmbedHTML"); return $html; }
private function _loadComments() { $youtube = new YouTube($this->_developerKey); $data = $youtube->getComments($this->_id, $this->_maxResults, $this->_startIndex); $xml = new SimpleXMLElement($data); //fetch comments $this->_comments = array(); foreach ($xml->entry as $entry) { $comment = new YouTubeVideoComment($entry); $this->_comments[] = $comment; } //fetch list data $namespaces = $xml->getNameSpaces(true); if ($namespaces) { $openSearch = $entry->children($namespaces['openSearch']); } else { return FALSE; } $this->_totalVideos = (int) $openSearch->totalResults; $this->_startIndex = (int) $openSearch->startIndex; $this->_maxResults = (int) $openSearch->itemsPerPage; if ($this->_comments) { return TRUE; } /* else */ return FALSE; }
public static function get_link($movieId) { $link = self::find_by_id($movieId); $exists = $link ? true : false; if ($link && days_from_now($link->timestamp) < LINK_UPDATE_DAYS) { // good } else { $exists = $link ? true : false; $movie = Movie::find_by_id($movieId); $link = new YouTube(); $link->id = $movieId; $link->timestamp = gen_timestamp(); $title = urlencode($movie->title); $endpoint = "https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=10&q={$title}&type=video&videoCategoryId=30&key=AIzaSyBOaDIBNUCfbthPQ0XSZScnqI8jyxJ9G5Q"; $m = self::getData($endpoint); foreach ($m->items as $mov) { $desc = $mov->snippet->description; if (levenshtein($title, $mov->snippet->title) < 2) { foreach ($castArr as $actor) { if (strpos($desc, $actor) !== false) { $link->videoId = $mov->id->videoId; break 2; // break out of both foreach loops } } } } if ($exists) { $link->update(); } else { $link->create(); } } return $link; }
/** * Load video data using video id * @param String $videoId */ public function load($videoId) { $youtube = new YouTube($this->_developerKey); $videoData = $youtube->getVideo($videoId); if ($videoData != "BAD_REQUEST") { $xml = new SimpleXMLElement($videoData); $this->_load($xml); } }
public function getLinks($my_id = NULL, $addView = NULL, $my_type = NULL, $debug = NULL) { //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, 'result' => array(), "func" => "getLinks"); //---------------------------------------------------------- if (is_null($my_id)) { $chk['bool'] = false; $chk['message'] = "my_id is NULL."; return $chk; } //---------------------------------------------------------- $video = $this->getVideo($my_id); //---------------------------------------------------------- if ($video['error']) { return $video; } //---------------------------------------------------------- if ($addView && $video['bool']) { $chk = $this->addView($video['result'][0]); if (!$chk['bool']) { return $chk; } } //---------------------------------------------------------- $youtube = new YouTube(); $chk = $youtube->getLinks($video['bool'] ? $video['result'][0]['youtube_hash'] : $my_id, $my_type, $debug); //---------------------------------------------------------- if ($video['bool'] && !$chk['bool']) { $video['result'] = $video['result'][0]; $video['result']['formats'] = $chk['result']['formats']; return $chk = $video; } else { if (!$chk['bool']) { return $chk; } } //---------------------------------------------------------- if (!$video['bool']) { $chk['result']['title'] = stripslashes($youtube->my_title); } //---------------------------------------------------------- if ($video['bool']) { $video['result'] = $video['result'][0]; $video['result']['formats'] = $chk['result']['formats']; //$video['result']['img_url'] = $chk['result']['img_url']; $chk = $video; } return $chk; }
public function testSearchWithParameters() { $this->response = <<<'EOL' {"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$media":"http://search.yahoo.com/mrss/","xmlns$openSearch":"http://a9.com/-/spec/opensearch/1.1/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$yt":"http://gdata.youtube.com/schemas/2007","gd$etag":"W/\"CUAMQH44cSp7I2A9WhFQEUg.\"","id":{"$t":"tag:youtube.com,2008:videos"},"updated":{"$t":"2013-07-06T23:36:21.039Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"}],"title":{"$t":"Videos matching: Minecraft Videos"},"logo":{"$t":"http://www.youtube.com/img/pic_youtubelogo_123x63.gif"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com"},{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos?v=2"},{"rel":"http://schemas.google.com/g/2005#batch","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/batch?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos?alt=json&q=Minecraft+Videos&start-index=11&max-results=10&v=2"},{"rel":"service","type":"application/atomsvc+xml","href":"http://gdata.youtube.com/feeds/api/videos?alt=atom-service&v=2"},{"rel":"previous","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos?alt=json&q=Minecraft+Videos&start-index=1&max-results=10&v=2"},{"rel":"next","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos?alt=json&q=Minecraft+Videos&start-index=21&max-results=10&v=2"}],"author":[{"name":{"$t":"YouTube"},"uri":{"$t":"http://www.youtube.com/"}}],"generator":{"$t":"YouTube data API","version":"2.1","uri":"http://gdata.youtube.com"},"openSearch$totalResults":{"$t":1000000},"openSearch$startIndex":{"$t":11},"openSearch$itemsPerPage":{"$t":10},"entry":[{"gd$etag":"W/\"CkcNRX47eCp7I2A9WhFQEUw.\"","id":{"$t":"tag:youtube.com,2008:video:l3A7nUZ3aOc"},"published":{"$t":"2013-03-21T19:02:29.000Z"},"updated":{"$t":"2013-07-06T11:28:14.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Games","label":"Game"}],"title":{"$t":"\"I HAD A BABY\" Minecraft Oasis Ep 20"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/l3A7nUZ3aOc?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=l3A7nUZ3aOc&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/l3A7nUZ3aOc/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/l3A7nUZ3aOc/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=l3A7nUZ3aOc"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/qg2eLFNUu3QN3dttNeOWkw?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/l3A7nUZ3aOc?v=2"}],"author":[{"name":{"$t":"iHasCupquake"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/iHasCupquake"},"yt$userId":{"$t":"qg2eLFNUu3QN3dttNeOWkw"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"moderated"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/l3A7nUZ3aOc/comments?v=2","countHint":5906}},"yt$hd":{},"media$group":{"media$category":[{"$t":"Games","label":"Game","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/l3A7nUZ3aOc?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":1319,"yt$format":5},{"url":"rtsp://r18---sn-npo7en7d.c.youtube.com/CiILENy73wIaGQnnaHdGnTtwlxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":1319,"yt$format":1},{"url":"rtsp://r18---sn-npo7en7d.c.youtube.com/CiILENy73wIaGQnnaHdGnTtwlxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":1319,"yt$format":6}],"media$credit":[{"$t":"ihascupquake","role":"uploader","scheme":"urn:youtube","yt$display":"iHasCupquake","yt$type":"partner"}],"media$description":{"$t":"Baby Joby! Thanks for watching! Leave a like or favorite the video if you enjoyed it! // For the latest videos, Subscribe! http://bit.ly/iHasCupquakeYT // \"I...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=l3A7nUZ3aOc&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/l3A7nUZ3aOc/default.jpg","height":90,"width":120,"time":"00:10:59.500","yt$name":"default"},{"url":"http://i.ytimg.com/vi/l3A7nUZ3aOc/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/l3A7nUZ3aOc/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/l3A7nUZ3aOc/1.jpg","height":90,"width":120,"time":"00:05:29.750","yt$name":"start"},{"url":"http://i.ytimg.com/vi/l3A7nUZ3aOc/2.jpg","height":90,"width":120,"time":"00:10:59.500","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/l3A7nUZ3aOc/3.jpg","height":90,"width":120,"time":"00:16:29.250","yt$name":"end"}],"media$title":{"$t":"\"I HAD A BABY\" Minecraft Oasis Ep 20","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"1319"},"yt$uploaded":{"$t":"2013-03-21T19:02:29.000Z"},"yt$uploaderId":{"$t":"UCqg2eLFNUu3QN3dttNeOWkw"},"yt$videoid":{"$t":"l3A7nUZ3aOc"}},"gd$rating":{"average":4.804361,"max":5,"min":1,"numRaters":8301,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"912068"},"yt$rating":{"numDislikes":"406","numLikes":"7895"}},{"gd$etag":"W/\"C0QBSH47eCp7I2A9WhFQEU4.\"","id":{"$t":"tag:youtube.com,2008:video:ObPY4x8GHQw"},"published":{"$t":"2012-08-22T22:08:54.000Z"},"updated":{"$t":"2013-07-06T17:22:39.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Shows","label":"Acara"}],"title":{"$t":"Minecraft Quick Build Challenge - Human Launching Cannon!"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/ObPY4x8GHQw?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=ObPY4x8GHQw&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ObPY4x8GHQw/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ObPY4x8GHQw/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=ObPY4x8GHQw"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/VEbcFWM43PS-d5vaSKUMng?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/ObPY4x8GHQw?v=2"}],"author":[{"name":{"$t":"MachinimaRealm"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/MachinimaRealm"},"yt$userId":{"$t":"VEbcFWM43PS-d5vaSKUMng"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"moderated"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/ObPY4x8GHQw/comments?v=2","countHint":18196}},"yt$episode":{"number":"13"},"yt$firstReleased":{"$t":"2012-08-22T07:00:00.000Z"},"yt$hd":{},"media$group":{"media$category":[{"$t":"Shows","label":"Acara","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"},{"$t":"3","scheme":"http://gdata.youtube.com/schemas/2007/mediatypes.cat"}],"media$content":[{"url":"http://www.youtube.com/v/ObPY4x8GHQw?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":849,"yt$format":5},{"url":"rtsp://r9---sn-npo7en7d.c.youtube.com/CiILENy73wIaGQkMHQYf49izORMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":849,"yt$format":1},{"url":"rtsp://r9---sn-npo7en7d.c.youtube.com/CiILENy73wIaGQkMHQYf49izORMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":849,"yt$format":6}],"media$credit":[{"$t":"machinimarealm","role":"uploader","scheme":"urn:youtube","yt$display":"MachinimaRealm","yt$type":"partner"}],"media$description":{"$t":"Enjoyed the video? Subscribe! http://tinyurl.com/MachinimaRealm ◅◅◅ Minecraft Quick Build Challenge: Human Launching Cannon! Welcome to another episode o...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=ObPY4x8GHQw&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/ObPY4x8GHQw/default.jpg","height":90,"width":120,"time":"00:07:04.500","yt$name":"default"},{"url":"http://i.ytimg.com/vi/ObPY4x8GHQw/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/ObPY4x8GHQw/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/ObPY4x8GHQw/1.jpg","height":90,"width":120,"time":"00:03:32.250","yt$name":"start"},{"url":"http://i.ytimg.com/vi/ObPY4x8GHQw/2.jpg","height":90,"width":120,"time":"00:07:04.500","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/ObPY4x8GHQw/3.jpg","height":90,"width":120,"time":"00:10:36.750","yt$name":"end"}],"media$title":{"$t":"Minecraft Quick Build Challenge - Human Launching Cannon!","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"849"},"yt$uploaded":{"$t":"2012-08-22T22:08:54.000Z"},"yt$uploaderId":{"$t":"UCVEbcFWM43PS-d5vaSKUMng"},"yt$videoid":{"$t":"ObPY4x8GHQw"}},"gd$rating":{"average":4.8576593,"max":5,"min":1,"numRaters":9962,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"1582581"},"yt$rating":{"numDislikes":"354","numLikes":"9608"}},{"gd$etag":"W/\"CEYBRH47eCp7I2A9WhFQEUw.\"","id":{"$t":"tag:youtube.com,2008:video:UsTxS02JYFM"},"published":{"$t":"2013-04-25T17:00:32.000Z"},"updated":{"$t":"2013-07-06T12:02:35.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Games","label":"Game"}],"title":{"$t":"Minecraft Mini-Game : COPS N ROBBERS 4!"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/UsTxS02JYFM?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=UsTxS02JYFM&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/UsTxS02JYFM/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/UsTxS02JYFM/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=UsTxS02JYFM"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/KlhpmbHGxBE6uw9B_uLeqQ?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/UsTxS02JYFM?v=2"}],"author":[{"name":{"$t":"SkyDoesMinecraft"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/SkyDoesMinecraft"},"yt$userId":{"$t":"KlhpmbHGxBE6uw9B_uLeqQ"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"moderated"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/UsTxS02JYFM/comments?v=2","countHint":17804}},"yt$hd":{},"media$group":{"media$category":[{"$t":"Games","label":"Game","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/UsTxS02JYFM?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":1614,"yt$format":5},{"url":"rtsp://r9---sn-npo7enel.c.youtube.com/CiILENy73wIaGQlTYIlNS_HEUhMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":1614,"yt$format":1},{"url":"rtsp://r9---sn-npo7enel.c.youtube.com/CiILENy73wIaGQlTYIlNS_HEUhMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":1614,"yt$format":6}],"media$credit":[{"$t":"skydoesminecraft","role":"uploader","scheme":"urn:youtube","yt$display":"SkyDoesMinecraft","yt$type":"partner"}],"media$description":{"$t":"GOD I LOVE DIS GAME! JOIN THE ROBBERS AS THEY TRY AND ESCAPE THE PRISON! HOWEVER...THE COP CAN KILL THEM AT ANYTIME! CAN THEY FIND A WAY TO ESCAPE?! PodCrash...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=UsTxS02JYFM&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/UsTxS02JYFM/default.jpg","height":90,"width":120,"time":"00:13:27","yt$name":"default"},{"url":"http://i.ytimg.com/vi/UsTxS02JYFM/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/UsTxS02JYFM/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/UsTxS02JYFM/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/UsTxS02JYFM/1.jpg","height":90,"width":120,"time":"00:06:43.500","yt$name":"start"},{"url":"http://i.ytimg.com/vi/UsTxS02JYFM/2.jpg","height":90,"width":120,"time":"00:13:27","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/UsTxS02JYFM/3.jpg","height":90,"width":120,"time":"00:20:10.500","yt$name":"end"}],"media$title":{"$t":"Minecraft Mini-Game : COPS N ROBBERS 4!","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"1614"},"yt$uploaded":{"$t":"2013-04-25T17:00:32.000Z"},"yt$uploaderId":{"$t":"UCKlhpmbHGxBE6uw9B_uLeqQ"},"yt$videoid":{"$t":"UsTxS02JYFM"}},"gd$rating":{"average":4.857676,"max":5,"min":1,"numRaters":44490,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"3735767"},"yt$rating":{"numDislikes":"1583","numLikes":"42907"}},{"gd$etag":"W/\"CEEBSH47eCp7I2A9WhFQEUw.\"","id":{"$t":"tag:youtube.com,2008:video:cPJUBQd-PNM"},"published":{"$t":"2011-08-19T17:18:09.000Z"},"updated":{"$t":"2013-07-06T12:10:59.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Music","label":"Musik"}],"title":{"$t":"\"Revenge\" - A Minecraft Parody of Usher's DJ Got Us Fallin' in Love - Crafted Using Noteblocks"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/cPJUBQd-PNM?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=cPJUBQd-PNM&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/cPJUBQd-PNM/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/cPJUBQd-PNM/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=cPJUBQd-PNM"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/shoKvlZGZ20rVgazZp5vnQ?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/cPJUBQd-PNM?v=2"}],"author":[{"name":{"$t":"CaptainSparklez"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/CaptainSparklez"},"yt$userId":{"$t":"shoKvlZGZ20rVgazZp5vnQ"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"denied"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/cPJUBQd-PNM/comments?v=2","countHint":413199}},"yt$hd":{},"media$group":{"media$category":[{"$t":"Music","label":"Musik","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/cPJUBQd-PNM?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":265,"yt$format":5},{"url":"rtsp://r16---sn-npo7enes.c.youtube.com/CiILENy73wIaGQnTPH4HBVTycBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":265,"yt$format":1},{"url":"rtsp://r16---sn-npo7enes.c.youtube.com/CiILENy73wIaGQnTPH4HBVTycBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":265,"yt$format":6}],"media$credit":[{"$t":"captainsparklez","role":"uploader","scheme":"urn:youtube","yt$display":"CaptainSparklez","yt$type":"partner"}],"media$description":{"$t":"Download the song! http://bit.ly/TATnl0 The people involved: TryHardNinja - Usher's vocals: http://www.youtube.com/user/TryHardNinja Doc Exx - audio producti...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=cPJUBQd-PNM&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/cPJUBQd-PNM/default.jpg","height":90,"width":120,"time":"00:02:12.500","yt$name":"default"},{"url":"http://i.ytimg.com/vi/cPJUBQd-PNM/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/cPJUBQd-PNM/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/cPJUBQd-PNM/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/cPJUBQd-PNM/1.jpg","height":90,"width":120,"time":"00:01:06.250","yt$name":"start"},{"url":"http://i.ytimg.com/vi/cPJUBQd-PNM/2.jpg","height":90,"width":120,"time":"00:02:12.500","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/cPJUBQd-PNM/3.jpg","height":90,"width":120,"time":"00:03:18.750","yt$name":"end"}],"media$title":{"$t":"\"Revenge\" - A Minecraft Parody of Usher's DJ Got Us Fallin' in Love - Crafted Using Noteblocks","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"265"},"yt$uploaded":{"$t":"2011-08-19T17:18:09.000Z"},"yt$uploaderId":{"$t":"UCshoKvlZGZ20rVgazZp5vnQ"},"yt$videoid":{"$t":"cPJUBQd-PNM"}},"gd$rating":{"average":4.9057374,"max":5,"min":1,"numRaters":852140,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"106539715"},"yt$rating":{"numDislikes":"20081","numLikes":"832059"}},{"gd$etag":"W/\"Ak4BQX47eCp7I2A9WhFQEEU.\"","id":{"$t":"tag:youtube.com,2008:video:QOdh_fINAjU"},"published":{"$t":"2011-06-23T07:01:57.000Z"},"updated":{"$t":"2013-07-06T05:35:50.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Shows","label":"Acara"}],"title":{"$t":"Minecraft Survival - Hostile Paradise"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/QOdh_fINAjU?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=QOdh_fINAjU&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/QOdh_fINAjU/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/QOdh_fINAjU/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=QOdh_fINAjU"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/zJ3fz15AqCNLlrQYEF5nlg?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/QOdh_fINAjU?v=2"}],"author":[{"name":{"$t":"PaperBatVG"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/PaperBatVG"},"yt$userId":{"$t":"zJ3fz15AqCNLlrQYEF5nlg"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"allowed"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/QOdh_fINAjU/comments?v=2","countHint":11468}},"yt$episode":{"number":"32"},"yt$firstReleased":{"$t":"2011-06-23T07:00:00.000Z"},"yt$hd":{},"media$group":{"media$category":[{"$t":"Shows","label":"Acara","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"},{"$t":"3","scheme":"http://gdata.youtube.com/schemas/2007/mediatypes.cat"}],"media$content":[{"url":"http://www.youtube.com/v/QOdh_fINAjU?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":4349,"yt$format":5},{"url":"rtsp://r6---sn-npo7en7d.c.youtube.com/CiILENy73wIaGQk1Ag3y_WHnQBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":4349,"yt$format":1},{"url":"rtsp://r6---sn-npo7en7d.c.youtube.com/CiILENy73wIaGQk1Ag3y_WHnQBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":4349,"yt$format":6}],"media$credit":[{"$t":"paperbatvg","role":"uploader","scheme":"urn:youtube","yt$display":"PaperBatVG","yt$type":"partner"}],"media$description":{"$t":"Time to explore a whole new world.","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=QOdh_fINAjU&feature=youtube_gdata_player"},"media$rating":[{"$t":"pg","scheme":"urn:v-chip"}],"media$thumbnail":[{"url":"http://i.ytimg.com/vi/QOdh_fINAjU/default.jpg","height":90,"width":120,"time":"00:36:14.500","yt$name":"default"},{"url":"http://i.ytimg.com/vi/QOdh_fINAjU/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/QOdh_fINAjU/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/QOdh_fINAjU/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/QOdh_fINAjU/1.jpg","height":90,"width":120,"time":"00:18:07.250","yt$name":"start"},{"url":"http://i.ytimg.com/vi/QOdh_fINAjU/2.jpg","height":90,"width":120,"time":"00:36:14.500","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/QOdh_fINAjU/3.jpg","height":90,"width":120,"time":"00:54:21.750","yt$name":"end"}],"media$title":{"$t":"Minecraft Survival - Hostile Paradise","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"4349"},"yt$uploaded":{"$t":"2011-06-23T07:01:57.000Z"},"yt$uploaderId":{"$t":"UCzJ3fz15AqCNLlrQYEF5nlg"},"yt$videoid":{"$t":"QOdh_fINAjU"}},"gd$rating":{"average":4.9607096,"max":5,"min":1,"numRaters":38661,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"686625"},"yt$rating":{"numDislikes":"380","numLikes":"38281"}},{"gd$etag":"W/\"D0QHSX47eCp7I2A9WhFQEEo.\"","id":{"$t":"tag:youtube.com,2008:video:CCy87q-TI4Q"},"published":{"$t":"2012-05-02T18:01:48.000Z"},"updated":{"$t":"2013-07-06T01:48:58.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Games","label":"Game"}],"title":{"$t":"Minecraft - TOBUSCUS STONE"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/CCy87q-TI4Q?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=CCy87q-TI4Q&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/CCy87q-TI4Q/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/CCy87q-TI4Q/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=CCy87q-TI4Q"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/LCmJiSbIoa_ZFiBOBDf6ZA?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/CCy87q-TI4Q?v=2"}],"author":[{"name":{"$t":"TobyGames"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/TobyGames"},"yt$userId":{"$t":"LCmJiSbIoa_ZFiBOBDf6ZA"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"allowed"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/CCy87q-TI4Q/comments?v=2","countHint":2954}},"yt$hd":{},"media$group":{"media$category":[{"$t":"Games","label":"Game","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/CCy87q-TI4Q?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":616,"yt$format":5},{"url":"rtsp://r16---sn-npo7en7k.c.youtube.com/CiILENy73wIaGQmEI5Ov7rwsCBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":616,"yt$format":1},{"url":"rtsp://r16---sn-npo7en7k.c.youtube.com/CiILENy73wIaGQmEI5Ov7rwsCBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":616,"yt$format":6}],"media$credit":[{"$t":"tobygames","role":"uploader","scheme":"urn:youtube","yt$display":"TobyGames","yt$type":"partner"}],"media$description":{"$t":"SIGNED POSTERS ARE HERE! http://www.forhumanpeoples.com/products/tobuscus-drw-poster (you gotta select signed in the drop down!) Order Tobuscus zip hoodies h...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=CCy87q-TI4Q&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/CCy87q-TI4Q/default.jpg","height":90,"width":120,"time":"00:05:08","yt$name":"default"},{"url":"http://i.ytimg.com/vi/CCy87q-TI4Q/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/CCy87q-TI4Q/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/CCy87q-TI4Q/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/CCy87q-TI4Q/1.jpg","height":90,"width":120,"time":"00:02:34","yt$name":"start"},{"url":"http://i.ytimg.com/vi/CCy87q-TI4Q/2.jpg","height":90,"width":120,"time":"00:05:08","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/CCy87q-TI4Q/3.jpg","height":90,"width":120,"time":"00:07:42","yt$name":"end"}],"media$title":{"$t":"Minecraft - TOBUSCUS STONE","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"616"},"yt$uploaded":{"$t":"2012-05-02T18:01:48.000Z"},"yt$uploaderId":{"$t":"UCLCmJiSbIoa_ZFiBOBDf6ZA"},"yt$videoid":{"$t":"CCy87q-TI4Q"}},"gd$rating":{"average":4.8774323,"max":5,"min":1,"numRaters":4985,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"995413"},"yt$rating":{"numDislikes":"153","numLikes":"4832"}},{"gd$etag":"W/\"AkMBQn47eCp7I2A9WhFQEU0.\"","id":{"$t":"tag:youtube.com,2008:video:Xj446LPEy7E"},"published":{"$t":"2011-10-14T19:43:06.000Z"},"updated":{"$t":"2013-07-06T11:00:53.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Shows","label":"Acara"}],"title":{"$t":"Minecraft - Weeping Angels Mod Spotlight"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/Xj446LPEy7E?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=Xj446LPEy7E&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/Xj446LPEy7E/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/Xj446LPEy7E/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=Xj446LPEy7E"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/H-_hzb2ILSCo9ftVSnrCIQ?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/Xj446LPEy7E?v=2"}],"author":[{"name":{"$t":"YOGSCAST Lewis & Simon"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/BlueXephos"},"yt$userId":{"$t":"H-_hzb2ILSCo9ftVSnrCIQ"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"moderated"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/Xj446LPEy7E/comments?v=2","countHint":19297}},"yt$episode":{"number":"53"},"yt$firstReleased":{"$t":"2011-10-13T07:00:00.000Z"},"yt$hd":{},"media$group":{"media$category":[{"$t":"Shows","label":"Acara","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"},{"$t":"3","scheme":"http://gdata.youtube.com/schemas/2007/mediatypes.cat"}],"media$content":[{"url":"http://www.youtube.com/v/Xj446LPEy7E?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":661,"yt$format":5},{"url":"rtsp://r6---sn-npo7en7r.c.youtube.com/CiILENy73wIaGQmxy8Sz6Dg-XhMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":661,"yt$format":1},{"url":"rtsp://r6---sn-npo7en7r.c.youtube.com/CiILENy73wIaGQmxy8Sz6Dg-XhMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":661,"yt$format":6}],"media$credit":[{"$t":"bluexephos","role":"uploader","scheme":"urn:youtube","yt$display":"YOGSCAST Lewis & Simon","yt$type":"partner"}],"media$description":{"$t":"Oh God, now they're in Minecraft too! If you don't know what the weeping angels are, they're from Doctor Who, go check it out. http://www.minecraftforum.net/...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=Xj446LPEy7E&feature=youtube_gdata_player"},"media$rating":[{"$t":"tv-y","scheme":"urn:v-chip"}],"media$thumbnail":[{"url":"http://i.ytimg.com/vi/Xj446LPEy7E/default.jpg","height":90,"width":120,"time":"00:05:30.500","yt$name":"default"},{"url":"http://i.ytimg.com/vi/Xj446LPEy7E/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/Xj446LPEy7E/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/Xj446LPEy7E/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/Xj446LPEy7E/1.jpg","height":90,"width":120,"time":"00:02:45.250","yt$name":"start"},{"url":"http://i.ytimg.com/vi/Xj446LPEy7E/2.jpg","height":90,"width":120,"time":"00:05:30.500","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/Xj446LPEy7E/3.jpg","height":90,"width":120,"time":"00:08:15.750","yt$name":"end"}],"media$title":{"$t":"Minecraft - Weeping Angels Mod Spotlight","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"661"},"yt$uploaded":{"$t":"2011-10-14T19:43:06.000Z"},"yt$uploaderId":{"$t":"UCH-_hzb2ILSCo9ftVSnrCIQ"},"yt$videoid":{"$t":"Xj446LPEy7E"}},"gd$rating":{"average":4.9305744,"max":5,"min":1,"numRaters":28419,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"4149998"},"yt$rating":{"numDislikes":"493","numLikes":"27926"}},{"gd$etag":"W/\"CUcERn47eCp7I2A9WhFQEUw.\"","id":{"$t":"tag:youtube.com,2008:video:JJwyACPub3Q"},"published":{"$t":"2013-03-01T18:01:59.000Z"},"updated":{"$t":"2013-07-06T12:16:47.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Games","label":"Game"}],"title":{"$t":"Minecraft: Parkour FAILURE!"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/JJwyACPub3Q?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=JJwyACPub3Q&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/JJwyACPub3Q/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/JJwyACPub3Q/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=JJwyACPub3Q"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/KlhpmbHGxBE6uw9B_uLeqQ?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/JJwyACPub3Q?v=2"}],"author":[{"name":{"$t":"SkyDoesMinecraft"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/SkyDoesMinecraft"},"yt$userId":{"$t":"KlhpmbHGxBE6uw9B_uLeqQ"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"moderated"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/JJwyACPub3Q/comments?v=2","countHint":11929}},"yt$hd":{},"media$group":{"media$category":[{"$t":"Games","label":"Game","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/JJwyACPub3Q?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":1163,"yt$format":5},{"url":"rtsp://r9---sn-npo7enee.c.youtube.com/CiILENy73wIaGQl0b-4jADKcJBMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":1163,"yt$format":1},{"url":"rtsp://r9---sn-npo7enee.c.youtube.com/CiILENy73wIaGQl0b-4jADKcJBMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":1163,"yt$format":6}],"media$credit":[{"$t":"skydoesminecraft","role":"uploader","scheme":"urn:youtube","yt$display":"SkyDoesMinecraft","yt$type":"partner"}],"media$description":{"$t":"Join Sky, Deadlox and HuskyMudkipz in a basic tutorial on how to Parkour!...THIS IS A TUTORIAL!? THIS IS THE MOST ENRAGING THING EVER!?!!!@#$@ Friends Channe...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=JJwyACPub3Q&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/JJwyACPub3Q/default.jpg","height":90,"width":120,"time":"00:09:41.500","yt$name":"default"},{"url":"http://i.ytimg.com/vi/JJwyACPub3Q/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/JJwyACPub3Q/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/JJwyACPub3Q/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/JJwyACPub3Q/1.jpg","height":90,"width":120,"time":"00:04:50.750","yt$name":"start"},{"url":"http://i.ytimg.com/vi/JJwyACPub3Q/2.jpg","height":90,"width":120,"time":"00:09:41.500","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/JJwyACPub3Q/3.jpg","height":90,"width":120,"time":"00:14:32.250","yt$name":"end"}],"media$title":{"$t":"Minecraft: Parkour FAILURE!","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"1163"},"yt$uploaded":{"$t":"2013-03-01T18:01:59.000Z"},"yt$uploaderId":{"$t":"UCKlhpmbHGxBE6uw9B_uLeqQ"},"yt$videoid":{"$t":"JJwyACPub3Q"}},"gd$rating":{"average":4.8219614,"max":5,"min":1,"numRaters":22849,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"1917291"},"yt$rating":{"numDislikes":"1017","numLikes":"21832"}},{"gd$etag":"W/\"CE4GRn47eCp7I2A9WhFQEU4.\"","id":{"$t":"tag:youtube.com,2008:video:I-sH53vXP2A"},"published":{"$t":"2012-04-01T20:45:30.000Z"},"updated":{"$t":"2013-07-06T17:48:47.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Entertainment","label":"Hiburan"}],"title":{"$t":"\"Fallen Kingdom\" - A Minecraft Parody of Coldplay's Viva la Vida (Music Video)"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/I-sH53vXP2A?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=I-sH53vXP2A&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/I-sH53vXP2A/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/I-sH53vXP2A/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=I-sH53vXP2A"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/shoKvlZGZ20rVgazZp5vnQ?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/I-sH53vXP2A?v=2"}],"author":[{"name":{"$t":"CaptainSparklez"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/CaptainSparklez"},"yt$userId":{"$t":"shoKvlZGZ20rVgazZp5vnQ"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"denied"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/I-sH53vXP2A/comments?v=2","countHint":401995}},"yt$hd":{},"media$group":{"media$category":[{"$t":"Entertainment","label":"Hiburan","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/I-sH53vXP2A?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":288,"yt$format":5},{"url":"rtsp://r19---sn-npo7ene7.c.youtube.com/CiILENy73wIaGQlgP9d75wfrIxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":288,"yt$format":1},{"url":"rtsp://r19---sn-npo7ene7.c.youtube.com/CiILENy73wIaGQlgP9d75wfrIxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":288,"yt$format":6}],"media$credit":[{"$t":"captainsparklez","role":"uploader","scheme":"urn:youtube","yt$display":"CaptainSparklez","yt$type":"partner"}],"media$description":{"$t":"Download the song! http://bit.ly/TATJrU The people involved: TryHardNinja - Vocals: http://www.youtube.com/user/TryHardNinja Bootstrap Buckaroo - Modeling, r...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=I-sH53vXP2A&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/I-sH53vXP2A/default.jpg","height":90,"width":120,"time":"00:02:24","yt$name":"default"},{"url":"http://i.ytimg.com/vi/I-sH53vXP2A/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/I-sH53vXP2A/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/I-sH53vXP2A/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/I-sH53vXP2A/1.jpg","height":90,"width":120,"time":"00:01:12","yt$name":"start"},{"url":"http://i.ytimg.com/vi/I-sH53vXP2A/2.jpg","height":90,"width":120,"time":"00:02:24","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/I-sH53vXP2A/3.jpg","height":90,"width":120,"time":"00:03:36","yt$name":"end"}],"media$title":{"$t":"\"Fallen Kingdom\" - A Minecraft Parody of Coldplay's Viva la Vida (Music Video)","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"288"},"yt$uploaded":{"$t":"2012-04-01T20:45:30.000Z"},"yt$uploaderId":{"$t":"UCshoKvlZGZ20rVgazZp5vnQ"},"yt$videoid":{"$t":"I-sH53vXP2A"}},"gd$rating":{"average":4.920445,"max":5,"min":1,"numRaters":543044,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"59525828"},"yt$rating":{"numDislikes":"10800","numLikes":"532244"}},{"gd$etag":"W/\"DUUBRn47eCp7I2A9WhFQEEU.\"","id":{"$t":"tag:youtube.com,2008:video:RVAcd-ffIMg"},"published":{"$t":"2011-09-22T17:02:41.000Z"},"updated":{"$t":"2013-07-06T05:07:37.000Z"},"category":[{"scheme":"http://schemas.google.com/g/2005#kind","term":"http://gdata.youtube.com/schemas/2007#video"},{"scheme":"http://gdata.youtube.com/schemas/2007/categories.cat","term":"Games","label":"Game"}],"title":{"$t":"Minecraft - BROTHER PIG - Part 1"},"content":{"type":"application/x-shockwave-flash","src":"http://www.youtube.com/v/RVAcd-ffIMg?version=3&f=videos&app=youtube_gdata"},"link":[{"rel":"alternate","type":"text/html","href":"http://www.youtube.com/watch?v=RVAcd-ffIMg&feature=youtube_gdata"},{"rel":"http://gdata.youtube.com/schemas/2007#video.responses","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/RVAcd-ffIMg/responses?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#video.related","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/RVAcd-ffIMg/related?v=2"},{"rel":"http://gdata.youtube.com/schemas/2007#mobile","type":"text/html","href":"http://m.youtube.com/details?v=RVAcd-ffIMg"},{"rel":"http://gdata.youtube.com/schemas/2007#uploader","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/users/LCmJiSbIoa_ZFiBOBDf6ZA?v=2"},{"rel":"self","type":"application/atom+xml","href":"http://gdata.youtube.com/feeds/api/videos/RVAcd-ffIMg?v=2"}],"author":[{"name":{"$t":"TobyGames"},"uri":{"$t":"http://gdata.youtube.com/feeds/api/users/TobyGames"},"yt$userId":{"$t":"LCmJiSbIoa_ZFiBOBDf6ZA"}}],"yt$accessControl":[{"action":"comment","permission":"allowed"},{"action":"commentVote","permission":"allowed"},{"action":"videoRespond","permission":"allowed"},{"action":"rate","permission":"allowed"},{"action":"embed","permission":"allowed"},{"action":"list","permission":"allowed"},{"action":"autoPlay","permission":"allowed"},{"action":"syndicate","permission":"allowed"}],"gd$comments":{"gd$feedLink":{"rel":"http://gdata.youtube.com/schemas/2007#comments","href":"http://gdata.youtube.com/feeds/api/videos/RVAcd-ffIMg/comments?v=2","countHint":21096}},"yt$hd":{},"media$group":{"media$category":[{"$t":"Games","label":"Game","scheme":"http://gdata.youtube.com/schemas/2007/categories.cat"}],"media$content":[{"url":"http://www.youtube.com/v/RVAcd-ffIMg?version=3&f=videos&app=youtube_gdata","type":"application/x-shockwave-flash","medium":"video","isDefault":"true","expression":"full","duration":584,"yt$format":5},{"url":"rtsp://r9---sn-npo7en7d.c.youtube.com/CiILENy73wIaGQnIIN_ndxxQRRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":584,"yt$format":1},{"url":"rtsp://r9---sn-npo7en7d.c.youtube.com/CiILENy73wIaGQnIIN_ndxxQRRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp","type":"video/3gpp","medium":"video","expression":"full","duration":584,"yt$format":6}],"media$credit":[{"$t":"tobygames","role":"uploader","scheme":"urn:youtube","yt$display":"TobyGames","yt$type":"partner"}],"media$description":{"$t":"AUDIENCE! Welcome to my Minecraft series! Next Ep: http://www.youtube.com/watch?v=caYql4vG9LE&list=PLA1421D3B844DCA12 Main Channel Tobuscus: http://youtube.c...","type":"plain"},"media$keywords":{},"media$license":{"$t":"youtube","type":"text/html","href":"http://www.youtube.com/t/terms"},"media$player":{"url":"http://www.youtube.com/watch?v=RVAcd-ffIMg&feature=youtube_gdata_player"},"media$thumbnail":[{"url":"http://i.ytimg.com/vi/RVAcd-ffIMg/default.jpg","height":90,"width":120,"time":"00:04:52","yt$name":"default"},{"url":"http://i.ytimg.com/vi/RVAcd-ffIMg/mqdefault.jpg","height":180,"width":320,"yt$name":"mqdefault"},{"url":"http://i.ytimg.com/vi/RVAcd-ffIMg/hqdefault.jpg","height":360,"width":480,"yt$name":"hqdefault"},{"url":"http://i.ytimg.com/vi/RVAcd-ffIMg/sddefault.jpg","height":480,"width":640,"yt$name":"sddefault"},{"url":"http://i.ytimg.com/vi/RVAcd-ffIMg/1.jpg","height":90,"width":120,"time":"00:02:26","yt$name":"start"},{"url":"http://i.ytimg.com/vi/RVAcd-ffIMg/2.jpg","height":90,"width":120,"time":"00:04:52","yt$name":"middle"},{"url":"http://i.ytimg.com/vi/RVAcd-ffIMg/3.jpg","height":90,"width":120,"time":"00:07:18","yt$name":"end"}],"media$title":{"$t":"Minecraft - BROTHER PIG - Part 1","type":"plain"},"yt$aspectRatio":{"$t":"widescreen"},"yt$duration":{"seconds":"584"},"yt$uploaded":{"$t":"2011-09-22T17:02:41.000Z"},"yt$uploaderId":{"$t":"UCLCmJiSbIoa_ZFiBOBDf6ZA"},"yt$videoid":{"$t":"RVAcd-ffIMg"}},"gd$rating":{"average":4.855533,"max":5,"min":1,"numRaters":27155,"rel":"http://schemas.google.com/g/2005#overall"},"yt$statistics":{"favoriteCount":"0","viewCount":"3702250"},"yt$rating":{"numDislikes":"981","numLikes":"26174"}}]}} EOL; $this->browser->shouldReceive('get')->once()->andReturn($this->response); $youtube = new YouTube($this->browser); $max_results = 10; $start_index = 11; $response = $youtube->search('Minecraft Videos', $max_results, $start_index); $videos = $response['videos']; $meta = $response['meta']; $this->assertCount($max_results, $videos, 'Should returns ' . $max_results . ' videos'); $this->assertSame($start_index, $meta['start_index']); }
public function testSearchVideosRelatedToSong() { $this->createSampleMediaSet(); $song = Song::first(); // We test on the facade here YouTubeFacade::shouldReceive('searchVideosRelatedToSong')->once(); $this->visit("/api/youtube/search/song/{$song->id}"); }
public static function favorites($sUser) { $aV = YouTube::raw_favorites($sUser); $aVideos = array(); foreach ($aV->feed->entry as $h) { $s = $h->link[0]->href; $id = substr($s, strpos($s, 'v=') + 2); $hVideo = YouTube::get_video($id); $hVideo['favorited'] = $h->updated->t; $hVideo['link'] = $h->link[0]->href; $aVideos[] = $hVideo; } return $aVideos; }
function test() { App::import('Vendor', 'YouTube', array('file' => 'class.YouTube.php')); $VideoTube = new YouTube(); echo $youTubeID = $VideoTube->getEmbedID($this->Video->field('code', array('id' => 60))); // save ID!!! exit; }
$Message = "<nobr>" . $Dest . " " . L_TOPIC . "</nobr><BDO dir=\"{$textDirection}\"></BDO></td><td width=\"99%\" CLASS=\"notify\" valign=\"top\">" . $Message . "</td></tr></table>"; $noteclass = "notify"; } elseif ($User == "SYS topic reset") { $Message = $Dest . " " . L_TOPIC_RESET . "</td></tr></table>"; $noteclass = "notify"; } elseif ($User == "SYS image") { $imgSize = setImageSize($Message, MAX_PIC_SIZE); if ($imgSize[0] == MAX_PIC_SIZE || $imgSize[1] == MAX_PIC_SIZE) { $Resized = "<br />(" . L_PIC_RESIZED . " <B>" . round($imgSize[0], -1) . "</B>" . (isset($imgSize[1]) && $imgSize[1] != "" ? " x <B>" . round($imgSize[1], -1) . "</B>" : "") . ")"; } else { $Resized = ''; } $NewMsg .= "<font class=\"notify\"><a href='" . $Message . "' onMouseOver=\"window.status='" . sprintf(L_CLICK, L_FULLSIZE_PIC) . ".'; return true\" title='" . sprintf(L_CLICK, L_FULLSIZE_PIC) . "' target=_blank>" . L_PIC . "</a> " . $Dest . ":</font></td><td valign=\"top\"><a href=" . $Message . " onMouseOver=\"window.status='" . sprintf(L_CLICK, L_FULLSIZE_PIC) . ".'; return true\" title='" . sprintf(L_CLICK, L_FULLSIZE_PIC) . "' target=_blank><img src=" . $Message . (isset($imgSize[0]) && $imgSize[0] != "" ? " width=" . $imgSize[0] : "") . (isset($imgSize[1]) && $imgSize[1] != "" ? " height=" . $imgSize[1] : "") . " border=0 alt='" . sprintf(L_CLICK, L_FULLSIZE_PIC) . "'></a>" . $Resized . "</td></tr></table>"; } elseif ($User == "SYS utube") { include_once './plugins/video/youtube.class.php'; $jutjub = new YouTube(); $youtube = $jutjub->EmbedVideo($Message, C_VIDEO_WIDTH, C_VIDEO_HEIGHT); $NewMsg .= "<font class=\"notify\"><img src=\"images/icons/youtube.png\" border=0 alt='YouTube' title='YouTube'> <a href='" . $Message . "' onMouseOver=\"window.status='" . sprintf(L_CLICK, L_ORIG_VIDEO) . ".'; return true\" title='" . sprintf(L_CLICK, L_ORIG_VIDEO) . "' target=_blank>" . L_VIDEO . "</a> " . $Dest . ":</font></td><td valign=\"top\">" . $youtube . "</td></tr></table>"; } elseif ($User == "SYS video") { //require EmbeVi Class include_once 'plugins/video/embevi.class.php'; //instantiate EmbeVi class $embevi = new EmbeVi(); $embevi->setAcceptShortUrl(); $embevi->setProviderIconLocal(); $embevi->setProviderIconUrl('images/icons/'); $embevi->setAcceptExtendedSupport(); if ($embevi->parseUrl($Message)) { //set embeded width $embevi->setWidth(C_VIDEO_WIDTH); //set embeded height
/** * Return directory contents for the silo path * * @param string $path The path to retrieve the contents of * @return array An array of MediaAssets describing the contents of the directory */ public function silo_dir($path) { $props = array(); $props['filetype'] = 'youtube'; $username = User::identify()->info->youtube__username; $results = array(); $section = strtok($path, '/'); switch ($section) { case 'videos': $videos = YouTube::playlist($username); foreach ($videos as $video) { $results[] = new MediaAsset(self::SILO_NAME . '/videos/' . $video['id'], false, array_merge($props, $video)); } break; case 'subscriptions': break; case 'favorites': $videos = YouTube::favorites($username); foreach ($videos as $video) { $results[] = new MediaAsset(self::SILO_NAME . '/videos/' . $video['id'], false, array_merge($props, $video)); } break; case '': $results[] = new MediaAsset(self::SILO_NAME . '/videos', true, array('title' => 'Videos')); /* TODO These never worked anyway. $results[] = new MediaAsset( self::SILO_NAME . '/tags', true, array('title' => 'Tags') ); */ $results[] = new MediaAsset(self::SILO_NAME . '/favorites', true, array('title' => 'Favorites')); break; } return $results; }
$extention = '_audio'; $caption = $_POST['caption_audio']; break; case 'video': $url_file_field = 'userfile_video_url_'; $file_name_dynamic = "userfile_video_"; $extention = '_video'; $caption = $_POST['caption_video']; break; case 'youtube': $content = ''; $gallery_link = ''; $link = (isset($_POST) && isset($_POST['video_url'])) ? $_POST['video_url'] : ''; $embedHTML = YouTube::getEmbedHTML($link); if ($embedHTML != '') { $content .= $embedHTML; } else { $content .= '<p>No Preview Available</p>'; } ?> <p><?=$content?></p> <textarea name="attach_media_html" id="attach_media_html"><?=$content?></textarea> <?php exit(); break; }
Route::post('interaction/like', 'InteractionController@like'); Route::post('interaction/batch/like', 'InteractionController@batchLike'); Route::post('interaction/batch/unlike', 'InteractionController@batchUnlike'); // Playlist routes Route::resource('playlist', 'PlaylistController'); Route::put('playlist/{playlist}/sync', 'PlaylistController@sync')->where(['playlist' => '\\d+']); // User and user profile routes Route::resource('user', 'UserController', ['only' => ['store', 'update', 'destroy']]); Route::put('me', 'ProfileController@update'); // Last.fm-related routes Route::get('lastfm/connect', 'LastfmController@connect'); Route::post('lastfm/session-key', 'LastfmController@setSessionKey'); Route::get('lastfm/callback', ['as' => 'lastfm.callback', 'uses' => 'LastfmController@callback']); Route::delete('lastfm/disconnect', 'LastfmController@disconnect'); // YouTube-related routes if (YouTube::enabled()) { Route::get('youtube/search/song/{song}', 'YouTubeController@searchVideosRelatedToSong'); } // Download routes Route::group(['prefix' => 'download', 'namespace' => 'Download'], function () { Route::get('songs', 'SongController@download'); Route::get('album/{album}', 'AlbumController@download'); Route::get('artist/{artist}', 'ArtistController@download'); Route::get('playlist/{playlist}', 'PlaylistController@download'); Route::get('favorites', 'FavoritesController@download'); }); // Info routes if (Lastfm::used()) { Route::get('album/{album}/info', 'AlbumController@getInfo'); Route::get('artist/{artist}/info', 'ArtistController@getInfo'); }
private function _loadVideos() { $youtube = new YouTube($this->_developerKey); $playlist = $youtube->getPlaylist($this->_id, $this->_maxResults, $this->_startIndex); //load playlist data $xml = new SimpleXMLElement($playlist); $this->_title = (string) $xml->title; $this->_subtitle = (string) $xml->subtitle; //load videos return parent::populate($playlist); }
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); header("Access-Control-Allow-Origin: *"); header("Content-Type: application/json"); require_once __DIR__ . "/YouTube.php"; $result = array(); foreach (explode(",", $_GET["vid"]) as $vid) { $video = new YouTube($vid, isset($_GET["Cache"]) && $_GET["Cache"] === "false" ? false : true); array_push($result, array("id" => $video->getVideoID(), "title" => $video->getTitle(), "video" => array("url" => $video->getVideoURL(), "path" => $video->getVideoPath()), "audio" => array("url" => $video->getAudioURL(), "path" => $video->getAudioPath()))); } YouTube::ClearCache(); echo json_encode($result);
<!doctype html> <html> <head> <title>YouTube Viewer</title> </head> <body> <div> <?php $youtube = new YouTube(); $query = isset($_GET['q']) ? $_GET['q'] : ''; $startIndex = isset($_GET['start']) ? $_GET['start'] : 1; $numResults = isset($_GET['num']) ? $_GET['num'] : 9; $results = $youtube->search($query, $numResults, $startIndex, FALSE); foreach ($results as $result) { echo $result->embed; } echo '<br/><div style="text-align: center">'; echo '<a href="?q=' . urlencode($query) . '&start=' . urlencode($startIndex - $numResults) . '&num=' . $numResults . '">Prev Page</a>'; echo ' '; echo '<a href="?q=' . urlencode($query) . '&start=' . urlencode($startIndex + $numResults) . '&num=' . $numResults . '">Next Page</a>'; echo '</div>'; ?> </div> </body> </html> <?php class YouTube { public function search($query, $numResults = 25, $startIndex = 1, $fetchToken = FALSE) { $results = "&max-results={$numResults}&start-index={$startIndex}";
public static function ClearCache($newSize = 0) { //save the max cache limit $CacheSizeLimit = self::$config["YouTube"]["Cache"]["limit"] - $newSize; //while the cache size is greater that the max limit we will remove the oldest video while (self::$sql->query("SELECT SUM(size)/{$CacheSizeLimit} as total FROM YouTubeCache")["rows"][0]["total"] >= 1) { $oldId = self::$sql->query("SELECT videoID FROM `YouTubeCache` ORDER BY date LIMIT 1")["rows"][0]["videoID"]; $oldVideo = new YouTube($oldId, false, false); $oldVideo->RemoveFromCache(); } }
/** * Get URL of YouTube video screenshot * * This method returns URL of YouTube video screenshot. It can get one of three screenshots defined by YouTube * * @access public * @param string $url YouTube video URL. If this cannot be parsed it will be used as video ID. It can be omitted * @param integer $imgid Number of screenshot to be returned. It can be 1, 2 or 3 * @return string URL of YouTube video screenshot */ public function GetImgURL($url = null, $imgid = 1) { if ($url == null) { $videoid = $this->id; } else { $videoid = YouTube::parseURL($url); if (!$videoid) { $videoid = $url; } } return "http://img.youtube.com/vi/{$videoid}/{$imgid}.jpg"; }
<?php // adding namespace breaks google api // use Models\Concerts\YouTube; require_once ROOT . '/app/models/concerts/youtube.php'; $app->get('/concerts_testing', function ($request, $response) { $query = ""; $videoList = []; if (isset($_GET['search']) && !empty($_GET['search'])) { $youtube = new YouTube(); $query = $_GET['search']; $videoList = $youtube->videoSearch($query, "live", 30); $videoList = $youtube->getVideoDetails($videoList); } return $this->view->render($response, 'concerts/search_testing.twig', ['query' => $query, 'videoList' => $videoList]); })->setName('concerts-testing');
<? $this->DisplayNestedModule('blocs', 'Accueil') ?> <div class="video"> <div id="videoaccueil"> Désolé, le visionnement de ce vidéo nécessite <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Flash 8</a>. </div> </div> <?php echo YouTube::GetPlayerFromURL($youTubeURL, 'videoaccueil', 237, 203);
<?php /** ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [filename] is a part of PeopleAggregator. * [description including history] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @author [creator, or "Original Author"] * @license http://bit.ly/aVWqRV PayAsYouGo License * @copyright Copyright (c) 2010 Broadband Mechanics * @package PeopleAggregator */ $login_required = FALSE; $use_theme = 'Beta'; //TODO : Remove this when new UI is completely implemented. include_once "web/includes/page.php"; require_once "api/YouTube/YouTube.php"; // Now we are trying to get the data from the given id if (isset($_GET) && isset($_GET['url']) && !empty($_GET['url'])) { echo YouTube::getEmbedHTML($_GET['url']); }
// import page $app->get('/concerts_testing/import', function ($request, $response) { $this->view->render($response, 'concerts/import.twig'); })->setName('import'); // process import list $app->post('/concerts_testing/import_list', function ($request, $response) { if (isset($_POST['submit'])) { $queryList = $_POST['list']; $queryList = preg_replace('[\\r\\n?|\\n]', ',', trim($queryList)); $queryList = explode(",", $queryList); $keywordList = $_POST['keywords']; $keywordList = preg_replace('[\\r\\n?|\\n]', ',', trim($keywordList)); $keywordList = explode(",", $keywordList); $numResults = intval($_POST['numResults']); $tags = []; $youtube = new YouTube(); $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); foreach ($queryList as $query) { foreach ($keywordList as $keyword) { $videoList = $youtube->videoSearch($query, $keyword, $numResults); $videoList = $youtube->getVideoDetails($videoList); $stmt = $this->db->prepare("INSERT INTO `testing` (`query`, `keyword`, `video_id`, `title`, `description`, `tags`, `cat_id`, `publish_date`, `channel`, `channel_id`, `views`, `likes`, `dislikes`, `favorites`, `comments`, `iframe`) VALUES (:query, :keyword, :video_id, :title, :description, :tags, :cat_id, :publish_date, :channel, :channel_id, :views, :likes, :dislikes, :favorites, :comments, :iframe)"); $rowCount = 0; foreach ($videoList as $video) { try { if (!empty($video['tags'])) { $tags = implode(", ", $video['tags']); } $stmt->execute(['query' => $video['query'], 'keyword' => $video['keyword'], 'video_id' => $video['videoId'], 'title' => $video['title'], 'description' => $video['description'], 'tags' => $tags, 'cat_id' => $video['catId'], 'publish_date' => $video['publishDate'], 'channel' => $video['channel'], 'channel_id' => $video['channelId'], 'views' => $video['views'], 'likes' => $video['likes'], 'dislikes' => $video['dislikes'], 'favorites' => $video['favorites'], 'comments' => $video['comments'], 'iframe' => $video['iframe']]); } catch (PDOException $e) { $response->write($e->getMessage());
<?php echo YouTube::GetPlayerFromURL($adresseVideo, 'videotheme', 237, 203); ?> <div class="sous-boite"> <?php echo $questions; $this->DisplayNestedModule('lexique'); ?> </div> <div class="dynamique themes"> <?php $this->DisplayNestedModule('refs'); $this->DisplayNestedModule('pointsvue'); $this->DisplayNestedModule('contributions'); ?> <div class="bloc-dyn"> <h2>Téléchargements</h2> <?php $this->DisplayNestedModule('telechargements'); ?> </div> </div>