话不多说,看代码吧
import crypt; import console; import web.rest.jsonLiteClient; //创建HTTP客户端 var http = web.rest.jsonLiteClient() //第一步、声明获取视频基本信息的接口 var boosj = http.api("http://www.boosj.com/drama_43355_29.html",,{ id = '<@vid:"@>([0-9]+)'; name = "videoName\s*?\:\s*?\'(.*?)\'" } ) //第二步、找到分段视频配置文件m3u8 data = boosj.get(); data.t = crypt.md5(data.id+"01136c5948d353b1bg2",false); //第三步、提取分段视频网址 var gslb = http.api("http://gslb.boosj.com/f_hls/?_id={id}&t={t}") var m3u8 = gslb[ data ].get(); if( m3u8["error"] == 200 ){ var m3u8Urls = http.api(m3u8.url ++ "?" ++ m3u8.t,"GET",{"(http.*?\.ts)"}) var urls = m3u8Urls.get(); console.dumpJson( urls ) } console.pause(true);