• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Admin

Well-Known Member
Staff member
Administrator
Demo ảnh
5c3s.png

Hướng dẫn sử dụng
Tạo tập tin tuoitreit_getnhaccuatui.php dán code này vào
PHP:
<?php

function checkLink($link) {
    $regex_link = '/http\:\/\/(www\.)?nhaccuatui\.com\/bai-hat\/.*/';
    if (preg_match($regex_link, $link)) {
        return 'bai-hat';
    }
    $regex_link = '/http\:\/\/(www\.)?nhaccuatui\.com\/playlist\/.*/';
    if (preg_match($regex_link, $link)) {
        return 'album';
    }
    return null;
}

function getCode($link, $type) {
    $content = file_get_contents($link); //Lấy nội dung html
    $links = array();
    $temp = array();
    switch ($type) {
        case 'bai-hat':
            preg_match('/NCTNowPlaying\.intFlashPlayer\(\"flashPlayer\"\,\s\"song\"\,\s\"(.*)\"/', $content, $temp); //Lấy nột dung từ fmt_url_map= choi tới dấu &
            break;
        case 'album':
            preg_match('/NCTNowPlaying\.intFlashPlayer\(\"flashPlayer\"\,\s\"playlist\"\,\s\"(.*)\"\,\s\"1"\,\s\"(.*)\"/', $content, $temp); //Lấy nột dung từ fmt_url_map= choi tới dấu &
            break;
    }
    if (isset($temp[1])) {
        $links = $temp[1];
    }
    return $links;
}

$content = "";
if (isset($_POST['link'])) {
    $link = $_POST['link'];
    $type = checkLink($link);
    if (!empty($type)) {
        $code = getCode($link, $type);
        if (!empty($code)) {
            $xmlLink = '';
            switch ($type) {
                case 'bai-hat':
                    $xmlLink = 'http://www.nhaccuatui.com/flash/xml?key1=' . $code;
                    break;
                case 'album':
                    $xmlLink = 'http://www.nhaccuatui.com/flash/xml?key2=' . $code;
                    break;
            }
            $musics = new SimpleXMLElement(file_get_contents($xmlLink));
            $content .= '<table>';
            foreach ($musics->track as $item) {
                $content .= '<tr>';
                $content .= '<td>' . $item->title . "</td><td>" . $item->location . '</td>';
                $content .= '</tr>';
            }
            $content .= '</table>';
        } else {
            $content .= '<br/>Đường dẫn không hợp lệ';
        }
    } else {
        $content .= '<br/>Đường dẫn không hợp lệ';
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style>
            table {
                margin-top: 20px;
            }
            table td {
                margin: 5px;
                padding: 5px;
                border: 1px dotted #777;
            }
        </style>
    </head>
    <body>
        <center><h1>Get link nhaccuatui.com</h1></center>
        <form action="" method="post">
            Link bài hát hoặc album <input input="text" name="link"/><input type="submit" value="Get link ngay"/>
        </form>
        <?php
        if (!empty($content)) {
            echo $content;
        }
        ?>
    </body>
</html>
Chúc các bạn thành công!
 

Facebook Comments

New posts New threads New resources

Back
Top