php擷取音悅台視頻

來源:互聯網
上載者:User

標籤:blog   http   os   on   div   log   bs   amp   as   

<?php$url=isset($_GET[‘url‘])?trim($_GET[‘url‘]):‘‘;$url = "http://v.yinyuetai.com/video/692888";//http://v.yinyuetai.com/video/2185713$time=$_SERVER[‘REQUEST_TIME‘];$content = file_get_contents($url);//擷取標題preg_match(‘/property="og:title"[\s]+content="([^"]*)".*?>/i‘,$content,$title);//擷取封面preg_match(‘/property="og:image" content="([^"]*)".*?>/‘,$content,$images);//擷取MV的IDpreg_match(‘/[\d]+/‘,$url,$song_id);$title=$title[1];$images=$images[1];$song_id=$song_id[0];//解析json$songurl = "http://www.yinyuetai.com/api/info/get-video-urls?callback=callback&videoId=".$song_id."&_=".$time;$data = file_get_contents($songurl);if (strpos($data, "callback") !== false){    $lpos = strpos($data, "(");    $rpos = strrpos($data, ")");    $data  = substr($data, $lpos + 1, $rpos - $lpos -1);}$json= json_decode($data,true);echo $title."<br/>";echo "流暢地址:".$json[‘hcVideoUrl‘]."<br/>";echo "高清地址:".$json[‘hdVideoUrl‘]."<br/>";echo "超清地址:".$json[‘heVideoUrl‘]."<br/>";echo "<img src=\"".$images."\"/>";?>

  

php擷取音悅台視頻

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.