取消https验证,并添加vendor文件夹。
This commit is contained in:
@@ -15,6 +15,7 @@ class Zm extends Command
|
||||
{
|
||||
private $aria2 = null;
|
||||
private $completed = false;
|
||||
private $client = null;
|
||||
private $user_id = '8ROYK0G3vGLyyEFjr9DtEQ==';
|
||||
|
||||
protected function configure()
|
||||
@@ -33,6 +34,11 @@ class Zm extends Command
|
||||
$this->aria2->setOption('enable-async-dns', true); //设置异步dns解析
|
||||
$this->aria2->setOption('enable-http-pipelining', true); //设置http管道化
|
||||
$this->aria2->setOption('enable-http-keep-alive', true); //设置http保持连接
|
||||
|
||||
// Disable SSL verification for cURL requests
|
||||
$this->client = new Client([
|
||||
'verify' => false,
|
||||
]);
|
||||
$this->completed = false;
|
||||
while($this->completed === false){
|
||||
try {
|
||||
@@ -46,7 +52,7 @@ class Zm extends Command
|
||||
}
|
||||
protected function start()
|
||||
{
|
||||
$savepath = 'E:/zm';
|
||||
$savepath = 'D:/zm';
|
||||
$lable = $this->getLable();
|
||||
if($lable['code'] == 0){
|
||||
$leftLabel = $lable['data']['leftLabel'];
|
||||
@@ -163,10 +169,9 @@ class Zm extends Command
|
||||
if(($head = Cache::get($key,null)) === NULL ){
|
||||
$head = [];
|
||||
|
||||
$client = new Client(['timeout' => 5.0,]);
|
||||
try {
|
||||
// 发送 HEAD 请求,并添加自定义请求头
|
||||
$response = $client->head($url, [
|
||||
$response = $this->client->head($url, [
|
||||
'headers' => [
|
||||
'User-Agent'=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36 Core/1.116.489.400 QQBrowser/13.7.6351.400',
|
||||
'referer'=>'https://edu.zmrobo.com/courses',
|
||||
@@ -248,8 +253,7 @@ class Zm extends Command
|
||||
}
|
||||
public function getLable($sign = 'null')
|
||||
{
|
||||
$client = new Client();
|
||||
$result = $client->get("https://edu.zmrobo.com/api/label",[
|
||||
$result = $this->client->get("https://edu.zmrobo.com/api/label",[
|
||||
'headers'=>[
|
||||
'User-Agent'=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36 Core/1.116.489.400 QQBrowser/13.7.6351.400',
|
||||
'referer'=>'https://edu.zmrobo.com/courses',
|
||||
@@ -266,7 +270,6 @@ class Zm extends Command
|
||||
}
|
||||
public function getCurr($label_id,$page,$sign = 'null')
|
||||
{
|
||||
$client = new Client();
|
||||
$options = [
|
||||
'headers'=>[
|
||||
'User-Agent'=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36 Core/1.116.489.400 QQBrowser/13.7.6351.400',
|
||||
@@ -281,7 +284,7 @@ class Zm extends Command
|
||||
'page'=>$page,
|
||||
])
|
||||
];
|
||||
$result = $client->post("https://edu.zmrobo.com/api/curriculum/list",$options);
|
||||
$result = $this->client->post("https://edu.zmrobo.com/api/curriculum/list",$options);
|
||||
$result = json_decode($result->getBody()->getContents(),true);
|
||||
if($result['code'] == -3){
|
||||
return $this->getCurr($label_id,$page,$result['sign']);
|
||||
@@ -296,7 +299,6 @@ class Zm extends Command
|
||||
|
||||
public function getCurrDetails($curr_id,$sign = 'null')
|
||||
{
|
||||
$client = new Client();
|
||||
$options = [
|
||||
'headers'=>[
|
||||
'User-Agent'=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36 Core/1.116.489.400 QQBrowser/13.7.6351.400',
|
||||
@@ -311,7 +313,7 @@ class Zm extends Command
|
||||
'user_id'=>$this->user_id,
|
||||
])
|
||||
];
|
||||
$result = $client->post("https://edu.zmrobo.com/api/curriculum/details",$options);
|
||||
$result = $this->client->post("https://edu.zmrobo.com/api/curriculum/details",$options);
|
||||
$result = json_decode($result->getBody()->getContents(),true);
|
||||
if($result['code'] == -3){
|
||||
return $this->getCurrDetails($curr_id,$result['sign']);
|
||||
@@ -324,7 +326,6 @@ class Zm extends Command
|
||||
}
|
||||
public function getClassDetails($curr_id,$sign = 'null')
|
||||
{
|
||||
$client = new Client();
|
||||
$options = [
|
||||
'headers'=>[
|
||||
'User-Agent'=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.97 Safari/537.36 Core/1.116.489.400 QQBrowser/13.7.6351.400',
|
||||
@@ -340,7 +341,7 @@ class Zm extends Command
|
||||
'token'=>"7aa22a83fece93ed3e5a3119b085ced9",
|
||||
])
|
||||
];
|
||||
$result = $client->post("https://edu.zmrobo.com/api/class/details",$options);
|
||||
$result = $this->client->post("https://edu.zmrobo.com/api/class/details",$options);
|
||||
$result = json_decode($result->getBody()->getContents(),true);
|
||||
if($result['code'] == -3){
|
||||
return $this->getClassDetails($curr_id,$result['sign']);
|
||||
|
||||
Reference in New Issue
Block a user