<?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"
;
?>