Ê×ÏÈÎÒÃÇÐèÒª»ñÈ¡¿ä¿ËCookie ½Ì³ÌÈçÏ£º
ÐèÒªÔÚµçÄÔä¯ÀÀÆ÷´ò¿ª¿ä¿ËÍøÅÌ£¬ÏȲ»µÇ¼µÄÇé¿öÏ °´ F12 £¬Ñ¡Ôñ¡°ÍøÂ硱£¬ÈçͼËùʾ£º
ɨÂëµÇ¼ºó£¬ÇëÑ¡Ôñ¡±sort?pr=ucpro&fr=pc¡°Ãû³ÆÎļþ£¬
²¢Ï»¬ÕÒµ½¡±Cookie¡°Ëù¶ÔÓ¦µÄÖµ¾ÍÊÇÄãµÄCookie
ÈçÏÂͼËùʾ
Ö´ÐÐPHPÎļþ£º°Ñ¸ÃÎļþÖ±½Ó·ÅÔÚÓòÃûÏ£¬Í¨¹ýÿÌ춨ʱ·ÃÎʸÃÎļþÁ´½Ó¿ÉʵÏÖÿÌì×Ô¶¯Ç©µ½
±ÈÈ磺http://ÄãµÄÓòÃû/sign_task.php
ÈçºÎÔÚ±¦ËþÔËÓÃÄØ£¿¡ý
ÈÎÎñÀàÐÍ£ºÑ¡Ôñ¡°·ÃÎÊURL¡±
ÈÎÎñÃû³ÆËæ±ãÌîд£¬Äã×Ô¼ºÖªµÀ¾ÍÐС£
Ö´ÐÐÖÜÆÚ£ºÑ¡Ôñ¡°Ã¿Ì족£¬Ð¡Ê±Ö¸´ÓµÚ¼¸Ð¡Ê±¿ªÊ¼£»·ÖÖÓÖ¸µ±Ç°Ð¡Ê±µÄµÚ¼¸·ÖÖÓ¡£
URLµØÖ·£ºÌîд¿ÉÒÔͨ¹ýÁ´½ÓÖ±½Ó·ÃÎʸÃÎļþµÄµØÖ·¡£
ÌîдÍêºó¡°Ìí¼ÓÈÎÎñ¡±¼´¿ÉʵÏÖÿÌìÖ¸¶¨¼¸µã¿ªÊ¼Ö´ÐÐÇ©µ½
Ò²¿ÉÒÔÊÖ¶¯µã»÷¡±Ö´ÐС°Îļþ½øÐÐÇ©µ½
¼ì²éÊÇ·ñÇ©µ½³É¹¦£¬¿Éͨ¹ýµã»÷¡±ÈÕÖ¾¡°²é¿´£¬Èçͼ£º
sign_task.php´úÂëÈçÏ£¨Çë×¢ÒâÐèÒª°ÑÄãµÄ¿ä¿Ë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";
?>
|