首先我们需要获取夸克Cookie 教程如下:
需要在电脑浏览器打开夸克网盘,先不登录的情况下 按 F12 ,选择“网络”,如图所示:
扫码登录后,请选择”sort?pr=ucpro&fr=pc“名称文件,
并下滑找到”Cookie“所对应的值就是你的Cookie如下图所示
执行PHP文件:把该文件直接放在域名下,通过每天定时访问该文件链接可实现每天自动签到
<?php
$cookie = "填写你的Cookie";
// 查看当前签到状态
$stateUrl = "https://drive-m.quark.cn/1/clouddrive/capacity/growth/info?pr=ucpro&fr=pc&uc_param_str=";
$stateResponse = @file_get_contents($stateUrl, false, stream_context_create([
'http' => [
'header' => "Cookie: $cookie\r\n"
]
]));
if ($stateResponse === FALSE) {
// 请求失败,输出错误信息
echo "请求失败,请检查Cookie或网络连接是否正确。\n";
exit();
}
$response = json_decode($stateResponse, true);
$sign = $response["data"]["cap_sign"];
if ($sign["sign_daily"]) {
$number = $sign["sign_daily_reward"] / (1024 * 1024);
$progress = bcdiv($sign["sign_progress"], $sign["sign_target"], 4) * 100;
echo "今日已签到获取{$number}MB,进度{$progress}%\n";
exit();
}
// 执行签到
$signUrl = "https://drive-m.quark.cn/1/clouddrive/capacity/growth/sign?pr=ucpro&fr=pc&uc_param_str=";
$params = [
"sign_cyclic" => true
];
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n" .
"Cookie: $cookie\r\n",
'method' => 'POST',
'content' => json_encode($params)
]
];
$signResponse = @file_get_contents($signUrl, false, stream_context_create($options));
if ($signResponse === FALSE) {
// 请求失败,输出错误信息
echo "签到请求失败,请检查Cookie或网络连接是否正确。\n";
exit();
}
$dataResponse = json_decode($signResponse, true);
$mb = $dataResponse["data"]["sign_daily_reward"] / 2048;
echo json_encode($dataResponse) . "\n";
echo "签到成功,获取到{$mb}MB!\n";
?>