Top Ad unit 728 × 90

Share API getlink zingmp3

Share code api getlink nhạc zingmp3

Các code get link zingmp3 hiện nay hầu hết đã bị lỗi không thể get được nữa. Nhưng các bạn đừng lo hôm nay mình sẽ share code get link zingmp3 phiên bản mới hỗ trợ lấy link bài hát, lấy cả album, lấy chi tiết một bài hát qua API Zing Mp3! Get Link Zing Mp3 Nhanh & Chuẩn Nhất Get 320 & lossless thì các bạn tự mày mò thêm chút, rất đơn giản.





 <?php
//set_time_limit (300);
header('Content-Type: application/json; charset=utf-8');

if (isset($_GET['url']) ){
        preg_match("/.*\/(.+).html/", $_GET['url'], $ids);
        $id = $ids[1];
        $mp3 = json_decode(auto('http://api.mp3.zing.vn/api/mobile/song/getsonginfo?requestdata=%7B"id":"'.$id.'"%7D'),true);
        $result = array(
                "messages" => array(
                        array(
                                "text" => "Tên: ".$mp3['title']."\nAlbum: ".$mp3['album']."\nLượt nghe: ".$mp3['total_play']
                        ),

                        array(
                                "attachment" => array(
                                        "type" => "template",
                                        "payload" => array(
                                                "template_type" => "button",
                                                "text" => "Bấm nút bên dưới để tải về!",
                                                "buttons" => array(
                                                        array(
                                                                "type" => "web_url",
                                                                "url" => $mp3['source']['128'],
                                                "title" => "128Kbs"
                                                        ),
                                                        array(
                                                                "type" => "web_url",
                                                                "url" => $mp3['source']['320'],
                                                "title" => "320Kbs"
                                                        ),
                                                        array(
                                                                "type" => "web_url",
                                                                "url" => $mp3['source']['lossless'],
                                                "title" => "LossLess"
                                                        )
                                                )
                                        )
                                )
                        )
                )
        );
        echo json_encode($result);
        header("Status: 200");
}

function auto($url){
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_URL, $url);
        $ch = curl_exec($curl);
        curl_close($curl);
        return $ch;
}
?>

Bạn có thể dùng làm api get link facebook nhé.
Share API getlink zingmp3 Reviewed by Cuong Nguyen on April 25, 2017 Rating: 5

No comments:

All Rights Reserved by Blog Chia Sẻ © 2014 - 2015
Powered by Blogger, Designed by Sweetheme

Contact Form

Name

Email *

Message *

Powered by Blogger.