streamja是一个国外的视频存储网盘,只可以上传视频且视频不能大于50MB,支持游客与注册会员上传,可以直接生成一个播放页面进行视频播放,视频的播放速度不是很慢,蓝叶此次分享的php代码可以读取streamja视频封面与地址数据,读取到视频的封面和地址就可以进行外链调用。
<?php header('Content-Type:text/json; charset=utf-8'); date_default_timezone_set('Asia/Shanghai'); $url = isset($_GET['url']) ? addslashes(trim($_GET['url'])) : 'https://streamja.com/krMN2'; $getDat = Curldata($url); preg_match('/<video.*?poster=["\']+(.*?)["\']+.*?src=["\']+(.*?)["\']+.*?<\/video>/i',$getDat,$matchs); $res = json_encode(array('img'=>$matchs[1],'url'=>$matchs[2])); echo $res; function Curldata($url){ $curl = curl_init(); $header = array( "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36 ", "Referer: ".$url ); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_TIMEOUT, 10); curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($curl, CURLOPT_ENCODING, ''); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); $response = curl_exec($curl); curl_close($curl); return $response; }
免责声明:
本页网址:点击复制分享给朋友吧!
本站分享的一切内容资源如若没有备注,均为蓝叶原创,如需转载请注明出处;如有侵权请与我们联系处理。敬请谅解!