Learn

The forum of documents and methods for studying - Lượm lặt kiến thức


    Get link download trực tiếp của Mp3 Zing qua code

    QaniTri
    QaniTri
    Admin

    Nam Libra Monkey
    Tổng số bài gửi : 1568
    Tiền xu Ⓑ : 3891
    Được cảm ơn № : 6
    Ngày khởi sự Ngày khởi sự : 07/01/2013
    Đến từ Đến từ : HCMC
    Côngviệc / Sởthix Côngviệc / Sởthix : Languages, Softwares, Sciences, Martial arts

    Get link download trực tiếp của Mp3 Zing qua code Empty Get link download trực tiếp của Mp3 Zing qua code

    Bài gửi by QaniTri 16th May 2014, 16:37

    I. Lấy qua source


    viewsource thì đc đống lằng nhằng , tìm object flash
    Code:
     Lựa chọn code | Ẩn/Hiện code
     <object width="643" height="84" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
        <param value="http://static.mp3.zing.vn/skins/mp3_main/flash/mp3Player_new.swf" name="movie">
        <param value="high" name="quality">
        <param value="transparent" name="wmode">
        <param value="true" name="allowfullscreen">
        <param value="songID=0&autoplay=true&xmlURL=http://mp3.zing.vn/xml/song/LGJmyLmNdczdNFxyZvxtDmZn" name="flashvars">
        <embed width="643" height="84" flashvars="songID=0&autoplay=true&xmlURL=http://mp3.zing.vn/xml/song/LGJmyLmNdczdNFxyZvxtDmZn" src="http://static.mp3.zing.vn/skins/mp3_main/flash/mp3Player_new.swf" wmode="transparent">
    </object>


    Chú ý đoạn:
    Code:
    Lựa chọn code | Ẩn/Hiện code
     <param value="songID=0&autoplay=true&xmlURL=http://mp3.zing.vn/xml/song/LGJmyLmNdczdNFxyZvxtDmZn" name="flashvars">


    sẽ tách được địa chỉ
    http://mp3.zing.vn/xml/song/LGJmyLmNdczdNFxyZvxtDmZn

    paste lên trình duyệt rồi viewsource của nó :
    Code:
    Lựa chọn code | Ẩn/Hiện code
     <data>  
         <item type="mp3">
            <title><![CDATA[ Khó ]]></title>
            <singer><![CDATA[ Nam Cường ]]></singer>
            <source>http://stream2.mp3.zdn.vn/fsfsdfdsfdserwrwq3/6318f98c3eb8f642834d8d14cbcffe54/4e0623cf/2011/02/20/a/5/a58a555a85fb5167185f0c87103d1bee.mp3</source>
        </item>
        <ad>
        <config></config>
        </ad>

    </data>



    nhận được link là http://stream2.mp3.zdn.vn/fsfsdfdsfd...87103d1bee.mp3
    đó là direct link để download


    cần tìm hiểu 2 cái
    1.cách lấy source web từ url
    2. cách dùng biểu thức chính qui (regular expression) để lọc URL
    như ở trên thì sẽ có các bước :
    - lấy source từ địa chỉ http://mp3.zing.vn/bai-hat/Kho-Nam-Cuong/ZWZADE90.html
    - dùng regular expression lọc URL http://mp3.zing.vn/xml/song/LGJmyLmNdczdNFxyZvxtDmZn
    - lấy source từ http://mp3.zing.vn/xml/song/LGJmyLmNdczdNFxyZvxtDmZn
    - dùng regular expression lấy link http://stream2.mp3.zdn.vn/fsfsdfdsfd...87103d1bee.mp3
     

    II. Lấy qua embed (mã nhúng)


    Ví dụ, link nhạc mp3 là:
    http://mp3.zing.vn/bai-hat/Dung-Lui-.../IW7E6OI8.html

    Thì link flash-player embed trong đoạn source là:

    Code:
    <embed wmode="transparent" width="643" height="84" src="http://static.mp3.zing.vn/skins/mp3_main/flash/mp3Player_new.swf" flashvars="songID=0&autoplay=true&xmlURL=http://mp3.zing.vn/xml/song/ZGJmybAFuQiDTkbcybHkn">

    Khi mở file xml trong đoạn code trên ra
    http://mp3.zing.vn/xml/song/ZGJmybAFuQiDTkbcybHkn

    thì sẽ thấy được dynamic mp3 link là:
    Code:
    http://stream3.mp3.zdn.vn/ES3stAYFQh/41f26c6db44b91fba00909e592ef5ae4/4e1bb82d/2011/07/02/a/2/a261f697f0a60940318eb0b4f05a7b51.mp3


    Nếu nhấn ô download sẽ nhận được link download là
    Code:
    http://mp3.zing.vn/download/song/Dung-Lui-Buoc-Karik/ZGcmybzDRQRvTLbJyFHLm

    Và khi nhấn download sẽ download được 1 link tạm để down:
    Code:
    http://dl3.mp3.zdn.vn/tUtYXLhuDGwX1aWn6/a9eb16c62ee80f5f7a899974f57dc88a/4e1b8

    ____________________________________

    Nguồn
    http://www.4mghc.com/topics/14068/1/get-link-download-truc-tiep-cua-mp3-zing
    http://www.hvaonline.net/hvaonline/posts/list/39556.hva
    http://www.nhatnghe.com/forum/showthread.php?t=193351

    _____________________________________

    Từ khoá: XML


      Hôm nay: 19th April 2024, 22:12