• 百度随心听


    <?php
        /*
        频道列表url fm.baidu.com/dev/api/?tn=channellist
        */ 
        $url1="http://fm.baidu.com/dev/api/?tn=playlist&id=public_xinqing_shanggan";
        $res1=json_decode(file_get_contents($url1),true);
        $name=$res1['channel_name'];
        foreach( $res1['list'] as $key => $value )
        {
            $data['songids'].=$res1['list'][$key]['id'].",";
        }
        
        $url2="http://fm.baidu.com/data/music/songlink"; 
        echo https_request($url2,$data);die(); 
        
        
         function https_request($url, $data = null)
         {
             $curl = curl_init();
             curl_setopt($curl, CURLOPT_URL, $url);
             curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
             curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
             if (!empty($data)){
                 curl_setopt($curl, CURLOPT_POST, 1);
                 curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
             }
             curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
             $output = curl_exec($curl);
             curl_close($curl);
             return $output;
         }
    ?>
  • 相关阅读:
    【loj2639】[Tjoi2017]不勤劳的图书管理员
    【bzoj3514】Codechef MARCH14 GERALD07加强版
    BZOJ1002【FJOI2007】轮状病毒
    数论基础(附加例题)
    表达式总结
    背包
    hdu1027
    hdu1026
    hdu1025
    hdu1024
  • 原文地址:https://www.cnblogs.com/yutaoyao/p/4571773.html
Copyright © 2020-2023  润新知