<?php include 'local/language.php'; $page = 1; if (isset($_GET['id'])) { $ID = $_GET['id']; } if (isset($_GET['page'])) { $page = strval($_GET['page']); } include 'lib/mq.php'; include_once "lib/apirequest.php"; initGFW('lib/mglib.txt'); $xml = xml_load2(ytapi . 'playlists/' . $ID . '?max-results=50&start-index=' . (($page - 1) * 15 + 1) . '&rand=' . rand(0, 1995)); /*$tit = $xml->title; $media = $xml->children('http://search.yahoo.com/mrss/'); $description_full = str_replace("\n","<br>",$media->group->description); $description = substr($description_full,0,140); $author = $xml->author->uri; $author = substr(strstr($author,'users/'),6); @date_default_timezone_set(PRC); $updateTime = date("Y-m-d H:i:s",strtotime($xml->updated)); */ $videos = array(); foreach ($xml->entry as $entry) { ob_start(); print_r($entry); $checking = ob_get_contents(); ob_end_clean(); if (!hasBadKey($checking)) { $media = $entry->children('http://search.yahoo.com/mrss/');
function ShowVideoGallery($dataid, $time = "", $local = "-") { $url = ytapi . 'standardfeeds/'; if ($local == "-") { $url .= ytpos; } else { if (strlen($local) > 0) { $url .= $local . '/'; } } $url .= $dataid; if (strlen($time) > 0) { $url .= "?time=" . $time; } $xml = xml_load2($url); if ($xml != NULL) { vg_head(); foreach ($xml->entry as $entry) { $media = $entry->children('http://search.yahoo.com/mrss/'); ob_start(); print_r($media); $checking = ob_get_contents(); ob_end_clean(); if (hasBadKey($checking)) { //out_bad(); } else { $yt = $media->children('http://gdata.youtube.com/schemas/2007'); $gd = $entry->children('http://schemas.google.com/g/2005'); $title = $media->group->title; $author = $entry->author->name; $description = $media->group->description; ob_start(); echo $media->group->category; $category = ob_get_contents(); ob_end_clean(); $attrs = $media->group->player->attributes(); $id = $attrs['url']; $id = substr(stristr($id, "v="), 2, 11); $attrs = $media->group->thumbnail[0]->attributes(); $thumbnail = $attrs['url']; $thumbnail = 'https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=' . urlencode($thumbnail) . '&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*'; //$thumbnail = 'lib/ytp.php?'.(str_replace("ytimg","yx_x",str_replace("/","|",$thumbnail))); $attrs = $yt->duration->attributes(); $length = $attrs['seconds']; $attrs = $yt->statistics->attributes(); $viewCount = "0"; @($viewCount = $attrs['viewCount']); if ($gd->rating) { $attrs = $gd->rating->attributes(); $rating = $attrs['average']; $rating = substr($rating, 0, 3); } else { $rating = 0; } vg_out($id, $title, $author, $description, $length / 60, $rating, $viewCount, $category, $thumbnail); } } vg_end(); } else { echo '<b><a href="http://code.google.com/p/youtubeindex/">NGSY</a>_FAILED:LOAD_VIDEO_LIST</b><br>Please contact laobubu@gmail.com'; } }
<?php include 'local/language.php'; if (!isset($_GET['id'])) { die("<b>NO ARGUMENT</b>: id<br><a href='index.php'>Please go back</a>"); } $ID = $_GET['id']; include 'lib/mq.php'; include_once "lib/apirequest.php"; initGFW('lib/mglib.txt'); $xml = xml_load2(ytapi . 'playlists/' . $ID . '?start-index=1&max-results=50'); $tit = $xml->title; $media = $xml->children('http://search.yahoo.com/mrss/'); $description_full = str_replace("\n", "<br>", $media->group->description); $description = substr($description_full, 0, 140); $author = $xml->author->uri; $author = substr(strstr($author, 'users/'), 6); @date_default_timezone_set(PRC); $updateTime = date("Y-m-d H:i:s", strtotime($xml->updated)); $entry = $xml->entry; $attrs = $entry[0]->link->attributes(); $vid = substr(stristr($attrs["href"], "v="), 2, 11); $i = 0; $videos = array(); foreach ($xml->entry as $entry) { $media = $entry->children('http://search.yahoo.com/mrss/'); $attrs = $entry->link->attributes(); $vid = substr(stristr($attrs["href"], "v="), 2, 11); array_push($videos, array('id' => $vid, 'title' => $media->group->title, 'author' => $entry->author->name)); $i++; }
if (!hasBadKey($checking)) { if ($type == "searchlist") { //搜索的是播放列表 $yt = $entry->children('http://gdata.youtube.com/schemas/2007'); $author = $entry->author->name; $title = $entry->title; $description = $entry->summary; $viewCount = $yt->countHint; $id = $yt->playlistId; array_push($outputitem, array($id, $title, $author, $description, $viewCount)); } elseif ($type == "searchchannel") { //搜索频道 $author = $entry->author->name; $title = $entry->title; $description = $entry->summary; $xml_people = xml_load2(ytapi . 'users/' . $author); $yt_media_people = $xml_people->children("http://search.yahoo.com/mrss/")->thumbnail->attributes(); //$thumbnail = 'lib/ytp.php?'.(str_replace("ytimg","yx_x",str_replace("/","|",$yt_media_people['url']))); $thumbnail = 'https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=' . urlencode($yt_media_people['url']) . '&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*'; array_push($outputitem, array($title, $author, $description, '', $thumbnail)); } else { $yt = $media->children('http://gdata.youtube.com/schemas/2007'); $gd = $entry->children('http://schemas.google.com/g/2005'); $title = $media->group->title; $author = $entry->author->name; $description = $media->group->description; ob_start(); echo $media->group->category; $category = ob_get_contents(); ob_end_clean(); $attrs = $entry->link->attributes();
<?php if (!isset($_GET['id'])) { header("Location: baderr.html"); exit; } include 'local/language.php'; include 'lib/apirequest.php'; include 'lib/gfw.php'; initGFW('lib/mglib.txt'); $id = $_GET['id']; $sxml = xml_load2(ytapi . 'users/' . $id); $entry = $sxml; //->entry; ob_start(); print_r($entry); $checking = ob_get_contents(); ob_end_clean(); if (hasBadKey($checking)) { header("Location: http://www.people.com.cn/"); exit; } $yt = $entry->children('http://gdata.youtube.com/schemas/2007'); $yt_media = $entry->children("http://search.yahoo.com/mrss/")->thumbnail->attributes(); ob_start(); echo $yt->gender; $gender = ob_get_contents(); ob_end_clean(); $tit = str_replace('XXX', $yt->username, ChannelOfXXX); include THEME_PATH . "/person.php";
did_not_get_qs 获取视频质量表失败 */ if (!isset($_GET["id"])) { die('<ngsyvideo><msg>lost_arg</msg></ngsyvideo>'); } else { $id = $_GET["id"]; } echo '<!-- NO AD PLEASE'; @ob_flush(); @flush(); include_once "mq.php"; include_once "../local/language.php"; include_once "apirequest.php"; initGFW('mglib.txt'); ob_start(); $xml = xml_load2(ytapi . 'videos/' . $id); $media = $xml->children('http://search.yahoo.com/mrss/'); $checking = ob_get_contents(); ob_end_clean(); if (strlen($checking) > 10) { die('<ngsyvideo><msg>api_load_error</msg></ngsyvideo>'); } /* $str = getArgData("http://www.youtube.com/watch?v=".$id); //if (strlen($str)<10) die('<ngsyvideo><msg>did_not_get_qs</msg></ngsyvideo>'); @$url_map_array = fmt_url_map($str); */ $author = $xml->author->uri; $author = substr(strstr($author, 'users/'), 6); $baseurl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $baseurl = substr($baseurl, 0, strrpos($baseurl, "/"));
$ID = $_GET["id"]; } elseif (isset($_GET["v"])) { $ID = $_GET["v"]; } else { die(file_get_contents('baderr.html')); } include_once 'lib/mq.php'; include_once 'lib/nglib.php'; include_once "lib/apirequest.php"; initGFW('lib/mglib.txt'); $rating = "-"; $raters = "-"; $viewcount = "-"; $favoritecount = "-"; $xml = xml_load2(ytapi . 'videos/' . $ID); $xml_related = xml_load2(ytapi . 'videos/' . $ID . '/related'); if (hasBadKey(var_export($xml, true))) { header("Location: http://www.people.com.cn/"); exit; } $relatedvideo = array(); if ($xml_related != NULL) { foreach ($xml_related->entry as $entry) { $media = $entry->children('http://search.yahoo.com/mrss/'); ob_start(); print_r($media); $checking = ob_get_contents(); ob_end_clean(); if (hasBadKey($checking)) { //out_bad(); } else {
$categories4show[$id] = $name; } } include THEME_PATH . '/category.php'; } else { $outputitem = array(); $feedURL = ytapi . 'videos/-/' . $type . '/?orderby=' . Orderby; if (strlen(Local) > 1) { $feedURL = $feedURL . '&restriction=' . Local; } if (isset($_GET['page'])) { $feedURL = $feedURL . '&start-index=' . (($_GET['page'] - 1) * 10 + 1); } $feedURL = $feedURL . '&max-results=10'; $feedURL = $feedURL . ytlang; $sxml = xml_load2($feedURL); $counts = $sxml->children('http://a9.com/-/spec/opensearchrss/1.0/'); $total = $counts->totalResults; $indexfrom = $counts->startIndex; $indexto = $indexfrom + $counts->itemsPerPage; $pagenow = floor($indexfrom / $counts->itemsPerPage) + 1; $pagetotal = ceil($total / $counts->itemsPerPage); $extraguide = array(); foreach ($Category as $id => $name) { if (substr($id, 0, strlen($type) + 1) == $type . '/') { array_push($extraguide, array(MoreChildCategorys, 'category.php?parent=' . $type)); break; } } foreach ($sxml->entry as $entry) { $media = $entry->children('http://search.yahoo.com/mrss/');
<?php include 'local/language.php'; $page = 1; if (isset($_GET['id'])) { $ID = $_GET['id']; } if (isset($_GET['page'])) { $page = strval($_GET['page']); } include_once 'lib/mq.php'; include_once "lib/apirequest.php"; initGFW('lib/mglib.txt'); $xml_comment = xml_load2(ytapi . 'videos/' . $ID . '/comments?max-results=15&start-index=' . (($page - 1) * 15 + 1) . '&rand=' . rand(0, 8964)); if ($xml_comment == NULL) { $error = true; } else { $opensearch = $xml_comment->children('http://a9.com/-/spec/opensearchrss/1.0/'); $comments = array(); $comments_has_prev = $page > 1; $comments_has_next = count($xml_comment->entry) >= 15; $comments_pages = ceil($opensearch->totalResults / 15); if ($xml_comment != NULL) { foreach ($xml_comment->entry as $entry) { $tauthor = $entry->author->name; $tcontent = $entry->content; $tdate = date("Y-m-d H:i:s", strtotime($entry->published)); if (!hasBadKey($tcontent)) { array_push($comments, array("author" => $tauthor, "content" => $tcontent, "published" => $tdate)); } }