Beispiel #1
0
function FetchLyric($artist, $title)
{
    $doc = new DOMDocument();
    $doc->load("http://lrccnc.ttplayer.com/dll/lyricsvr.dll?sh?Artist=" . qianqian_code($artist) . "&Title=" . qianqian_code($title) . "&Flags=0");
    $lrcNode = $doc->getElementsByTagName("lrc");
    $code = 0;
    foreach ($lrcNode as $lrc) {
        $artist = $lrc->getAttribute("artist");
        $title = $lrc->getAttribute("title");
        if ($code == 0 || strpos($title, "中") || strpos($artist, "中")) {
            $id = $lrc->getAttribute("id");
            $code = CodeFunc($id, $artist, $title);
        }
    }
    if ($code != 0) {
        $lrcstr = file_get_contents("http://lrccnc.ttplayer.com/dll/lyricsvr.dll?dl?Id=" . $id . "&Code=" . $code);
        $lrcstr = preg_replace("/\\[(.+?)\\]/", "", $lrcstr);
        //替换掉时间标签
        $lrcstr = preg_replace("/(.*)QQ[::](.*)\n/", "", $lrcstr);
        // 替换联系QQ什么的广告
        echo trim($lrcstr);
    }
}
Beispiel #2
0
        $tmp1 = $tmp1 + $tmp7 & 4294967295.0;
        $i += 1;
    }
    $t = conv($tmp2 ^ $tmp3);
    $t = conv($t + ($tmp1 | $Id));
    $t = conv(bcmul($t, $tmp1 | $tmp3));
    $t = conv(bcmul($t, $tmp2 ^ $Id));
    if (bccomp($t, 2147483648.0) > 0) {
        $t = bcadd($t, -4294967296.0);
    }
    return $t;
}
//$artist="¹ãÖÝ";
//$title="½»ÓÑÍø";
$artist = $_GET['zz'];
$title = $_GET['gm'];
$doc = new DOMDocument();
$doc->load("http://lrccnc.ttplayer.com/dll/lyricsvr.dll?sh?Artist=" . qianqian_code($artist) . "&Title=" . qianqian_code($title) . "&Flags=0");
$lrcNode = $doc->getElementsByTagName("lrc");
foreach ($lrcNode as $lrc) {
    $id = $lrc->getAttribute("id");
    $artist = iconv('UTF-8', 'GBK', $lrc->getAttribute("artist"));
    $title = iconv('UTF-8', 'GBK', $lrc->getAttribute("title"));
    $code = CodeFunc($id, $artist, $title);
    $lrcstr = iconv('UTF-8', 'GBK', file_get_contents("http://lrccnc.ttplayer.com/dll/lyricsvr.dll?dl?Id=" . $id . "&Code=" . $code));
    echo $lrcstr;
    break;
}
?>