コード例 #1
0
ファイル: video_info.php プロジェクト: istrwei/youtube
$length = $attrs['duration'];
$rating = "0";
@($r1 = $xml->children('http://schemas.google.com/g/2005')->rating->attributes());
@($rating = $r1['average']);
$a = ' -->
<?xml version="1.0" encoding="utf-8"?>';
$a .= '<ngsyvideo>
<id>' . $id . '</id>
<title>' . $xml->title . '</title>
<author>' . $author . '</author>
<image>' . $thumbnail . '</image>
<rating>' . $rating . '</rating>
<length>' . $length . '</length><!-- 单位为秒(s) -->
<quality>';
include 'nglib.php';
foreach (getVList($id) as $t_num1 => $t_url) {
    $t_num = substr($t_num1, 1);
    $a .= '<qitem id="' . $t_num . '" description="' . $QualityList[$t_num] . '">' . $t_url . '</qitem>';
}
$a .= '</quality>';
$ccurl = get_one_arg_data($str, 'ttsurl');
$cc = get_net_data($ccurl . '&type=list&tlangs=1&asrs=1&hl=zh&v=' . $id);
if (strlen($cc) > 2) {
    $a .= $cc;
    print $cc;
} else {
    $a .= '<transcript_list/>';
    print '<transcript_list/>';
}
print '<laobubu>';
$a .= '<ccurl>' . strstr($ccurl, "timedtext?") . '</ccurl>
コード例 #2
0
ファイル: watch.php プロジェクト: istrwei/youtube
ob_start();
echo $media->group->category;
$category_id = ob_get_contents();
ob_end_clean();
$author = $xml->author->uri;
$author = substr(strstr($author, 'users/'), 6);
$publishTime = date("Y-m-d H:i:s", strtotime($xml->published));
$updateTime = date("Y-m-d H:i:s", strtotime($xml->updated));
@($r1 = $xml->children('http://schemas.google.com/g/2005')->rating->attributes());
@($rating = $r1['average']);
@($raters = $r1['numRaters']);
@($s1 = $xml->children('http://gdata.youtube.com/schemas/2007')->statistics->attributes());
@($viewcount = $s1['viewCount']);
@($favoritecount = $s1['favoriteCount']);
$qualitylist = array();
foreach (getVList($ID, array()) as $x => $y) {
    $qualitylist[] = substr($x, 1);
}
if (count($qualitylist) < 2) {
    header('location: fixer.php');
    die('<a href="fixer.php">FIX ERROR</a>');
}
$str_page = get_net_data("http://www.youtube.com/watch?v=" . $ID);
if (strpos($str_page, 'watch-extra-info-left') != false) {
    //Check if there is Extra info
    $extrainfomation = strstr($str_page, "watch-extra-info-left");
    $extrainfomation = strstr($extrainfomation, ">");
    $extrainfomation = substr($extrainfomation, 0, strpos($extrainfomation, '</span'));
    $extrainfomation = strip_tags($extrainfomation);
}
include THEME_PATH . "/watch.php";