<?php
function baiduPan($url) {
if (strpos($url, 'pan.baidu.com') === false) return false;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, true);
/*
$cookiefile = "cookie.txt";
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_close($ch);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
*/
$html = curl_exec($ch);
file_put_contents("out3.txt", $html);
if (preg_match('/fs_id\\\\":\\\\"(.*?)\\\\"/i', $html, $m)) {
$fsid = $m[1];
preg_match('/sh
baidu 云盘 php下载代码,还需要测试
最新推荐文章于 2024-03-07 02:39:18 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)