会飞的鱼

FS - RM
谁能反抗生命随波逐流的离合
首页 » 源码代码 » 蓝奏云api接口

蓝奏云api接口

<?php
$get = $_get;
$url = $get['url'];
$json = $get['json'];
$type = $get['type'];

$contents = file_get_contents($url);
$con_zhengze = "/<iframe class=\"ifr2\" name=\".*?\" src=\"(.*)\" frameborder=\"0\" scrolling=\"no\"><\/iframe>/";
preg_match_all($con_zhengze, $contents, $data);

$ifurl = "https://www.lanzous.com" . $data[1][0];

$contents = file_get_contents($ifurl);
$if_zhengze = "/{ 'action':'downprocess','sign':'(.*)' },/";
preg_match_all($if_zhengze, $contents, $data);

$data = $data[1][0];

$post_data = array(
  "action" => "downprocess",
  "sign" => $data,
);

$softInfo = MloocCurlPost($post_data, "https://www.lanzous.com/ajaxm.php", $ifurl);
$softInfo = json_decode($softInfo, true);

$down_url = $softInfo['dom'] . '/file/' . $softInfo['url'];

if ($type == "down") {
  header("Location: $down_url");
} else {
  if ($json == 'json') {
    if ($softInfo['zt'] == 1) {
      return json([
        'code' => $softInfo['zt'],
        'msg' => '请求成功',
        'url' => $down_url,
      ]);
    } else {
      return json([
        'code' => $softInfo['zt'],
        'msg' => '请求失败',
      ]);
    }
  } else {
    echo $down_url;
  }
}

function MloocCurlGet($url, $UserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36')
{
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  if ($UserAgent != "") {
    curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent);
  }
  #关闭SSL
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  #返回数据不直接显示
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  $response = curl_exec($curl);
  curl_close($curl);
  return $response;
}
function MloocCurlPost($post_data, $url, $ifurl = '', $UserAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36')
{
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $url);
  curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent);
  if ($ifurl != '') {
    curl_setopt($curl, CURLOPT_REFERER, $ifurl);
  }
  #关闭SSL
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  #返回数据不直接显示
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_POST, 1);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
  $response = curl_exec($curl);
  curl_close($curl);
  return $response;
}

文章如无特别注明均为原创! 作者: 浮生若梦, 转载或复制请以 超链接形式 并注明出处 浮生若梦's Blog
原文地址《 蓝奏云api接口》发布于2019-6-10

分享到:
0 打赏

评论

切换注册

登录

您也可以使用第三方帐号快捷登录

Q Q 登 录
微 博 登 录
切换登录

注册