<?php header('Content-type: text/json;charset=utf-8'); if(isset($_GET['vid'])){ $html=http_curl('http://ext.yinyuetai.com/main/get-h-mv-info?json=true&videoId='.$_GET['vid']); $r=json_decode($html,true); print_r($r); $mp4=$r['videoInfo']['coreVideoInfo']['videoUrlModels'][count($r['videoInfo']['coreVideoInfo']['videoUrlModels'])-1]['videoUrl']; //header("location:".$mp4); echo $mp4; } function http_curl($url){ $curl = curl_init(); curl_setopt($curl,CURLOPT_URL,$url); curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,30); curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); $data=curl_exec($curl); curl_close($curl); return $data; } ?>
Das Folgende dient zum Testen
<?php //使用方法 http://localhost/yinyuetai.php?vid=2765558 // 作者:风云无忌 // 接口具有时效性,因官方改版可能会失效 header('Content-type: text/json;charset=utf-8'); if(isset($_GET['vid'])){ $html=http_curl('http://ext.yinyuetai.com/main/get-h-mv-info?json=true&videoId='.$_GET['vid']); $r=json_decode($html,true); $mp4=$r['videoInfo']['coreVideoInfo']['videoUrlModels'][count($r['videoInfo']['coreVideoInfo']['videoUrlModels'])-1]['videoUrl']; header("location:".$mp4); } function http_curl($url){ $curl = curl_init(); curl_setopt($curl,CURLOPT_URL,$url); curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,30); curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); $data=curl_exec($curl); curl_close($curl); return $data; } ?>
Das Ausgabeergebnis ist
Array ( [message] => [error] => [logined] => [videoInfo] => Array ( [pageUrl] => http://v.yinyuetai.com/video/2765558 [secretKeyUri] => http://api.yinyuetai.com/mv/secret-key [coreVideoInfo] => Array ( [videoId] => 2765558 [videoName] => Ting A Ling 官方版 [headImage] => http://img4.yytcdn.com/video/mv/170105/2765558/-M-fc7447cb4ef41cf8b1702e24a4191b31_120x67.jpg [bigHeadImage] => http://img4.yytcdn.com/video/mv/170105/2765558/-M-fc7447cb4ef41cf8b1702e24a4191b31_640x360.jpg [videoUrlModels] => Array ( [0] => Array ( [bitrateType] => 1 [bitrate] => 772 [qualityLevel] => hc [qualityLevelName] => 流畅 [QualityLevelName] => 流畅 [videoUrl] => http://hc.yinyuetai.com/uploads/videos/common/23A0015967F8BAEE9E3E4DB1642D2922.mp4?sc=995e533001fab560&br=772&vid=2765558&aid=3972&area=ML&vst=0 [fileSize] => 21362320 [sha1] => 65a71b32c37dcb8db97986f4b155ad6699d280c9 [md5] => cf9c286c117d8332ba7e22d7eb5cd4d7 ) [1] => Array ( [bitrateType] => 2 [bitrate] => 1090 [qualityLevel] => hd [qualityLevelName] => 高清 [QualityLevelName] => 高清 [videoUrl] => http://hd.yinyuetai.com/uploads/videos/common/0F7D01596C547EBF0CFB189211E8D810.mp4?sc=7d48406b5570ebf9&br=1090&vid=2765558&aid=3972&area=ML&vst=0 [fileSize] => 30128711 [sha1] => 010bd3f6662960baf6f29e3188d707eded04214c [md5] => 1beb6fc9a994469cfea247b47edc45d2 ) [2] => Array ( [bitrateType] => 3 [bitrate] => 3081 [qualityLevel] => he [qualityLevelName] => 超清 [QualityLevelName] => 超清 [videoUrl] => http://he.yinyuetai.com/uploads/videos/common/90E901596C547EB8CD39CF5283392940.mp4?sc=1d4cc17898759a5e&br=3081&vid=2765558&aid=3972&area=ML&vst=0 [fileSize] => 85160309 [sha1] => 0a27d2d85b7b068a2b32e43a279ea1071b21620d [md5] => 0b2d4faec857332287aa497311860db0 ) ) [duration] => 221 [artistIds] => 3972 [artistNames] => 江映蓉 [threeD] => [error] => [errorMsg] => [source] => music_video [modelType] => common ) ) ) http://he.yinyuetai.com/uploads/videos/common/90E901596C547EB8CD39CF5283392940.mp4?sc=1d4cc17898759a5e&br=3081&vid=2765558&aid=3972&area=ML&vst=0
PHP Yinyuetai-Parsing-Schnittstellen-Quellcode, hauptsächlich nützlich zum Sammeln von Videos
おすすめ
転載: blog.csdn.net/qq_37795174/article/details/77619241
おすすめ
ランキング