mirror of
				https://gitee.com/ledc/IYUUAutoReseed
				synced 2025-10-31 08:49:48 +00:00 
			
		
		
		
	优化前置检查逻辑
This commit is contained in:
		| @@ -36,6 +36,11 @@ class AutoReseed | |||||||
|      * @var array |      * @var array | ||||||
|      */ |      */ | ||||||
|     public static $noReseed = []; |     public static $noReseed = []; | ||||||
|  |     /** | ||||||
|  | 	 * cookie检查 | ||||||
|  | 	 * @var array | ||||||
|  | 	 */ | ||||||
|  | 	public static $cookieCheck = ['hdchina','hdcity']; | ||||||
|     /** |     /** | ||||||
|      * 缓存路径 |      * 缓存路径 | ||||||
|      * @var string |      * @var string | ||||||
| @@ -131,8 +136,7 @@ class AutoReseed | |||||||
|                     self::$links[$k]['type'] = $v['type']; |                     self::$links[$k]['type'] = $v['type']; | ||||||
|                     self::$links[$k]['rpc'] = $client; |                     self::$links[$k]['rpc'] = $client; | ||||||
|                     $result = $client->status(); |                     $result = $client->status(); | ||||||
|  |                     print $v['type'].':'.$v['host']." Rpc连接 [{$result}] \n"; | ||||||
|                     print $v['type'].':'.$v['host']." Rpc连接 [{$result->result}] \n"; |  | ||||||
|                     // 检查是否转移种子的做种客户端? |                     // 检查是否转移种子的做种客户端? | ||||||
|                     if (isset($v['move']) && $v['move']) { |                     if (isset($v['move']) && $v['move']) { | ||||||
|                         self::$move = array($k,$v['type']); |                         self::$move = array($k,$v['type']); | ||||||
| @@ -287,10 +291,10 @@ class AutoReseed | |||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                     break; |                     break; | ||||||
|                 case 'qBittorrent': |                 case 'qBittorrent':                     | ||||||
|                     $extra_options['paused'] = 'true'; |  | ||||||
|                     $extra_options['autoTMM'] = 'false';	//关闭自动种子管理 |  | ||||||
|                     if ($is_url) { |                     if ($is_url) { | ||||||
|  |                         $extra_options['paused'] = 'true'; | ||||||
|  |                         $extra_options['autoTMM'] = 'false';	//关闭自动种子管理 | ||||||
|                         $result = self::$links[$rpcKey]['rpc']->add($torrent, $save_path, $extra_options);			// 种子URL添加下载任务 |                         $result = self::$links[$rpcKey]['rpc']->add($torrent, $save_path, $extra_options);			// 种子URL添加下载任务 | ||||||
|                     } else { |                     } else { | ||||||
|                         $extra_options['name'] = 'torrents'; |                         $extra_options['name'] = 'torrents'; | ||||||
| @@ -343,238 +347,243 @@ class AutoReseed | |||||||
|     public static function call($hashArray = array()) |     public static function call($hashArray = array()) | ||||||
|     { |     { | ||||||
|         global $configALL; |         global $configALL; | ||||||
|         $resArray = $sites = array(); | 		$resArray = $sites = array(); | ||||||
|         $curl = new Curl(); | 		$curl = new Curl(); | ||||||
|         $curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); | 		$curl->setOpt(CURLOPT_SSL_VERIFYPEER, false); | ||||||
|         // 签名 | 		// 签名 | ||||||
|         $hashArray['timestamp'] = time(); | 		$hashArray['timestamp'] = time(); | ||||||
|         // 爱语飞飞token | 		// 爱语飞飞token | ||||||
|         $hashArray['sign'] = Oauth::getSign(); | 		$hashArray['sign'] = Oauth::getSign(); | ||||||
|         $hashArray['version'] = self::VER; | 		$hashArray['version'] = self::VER; | ||||||
|         // 写日志 | 		// 写请求日志 | ||||||
|         if (true) { | 		if (true) { | ||||||
|             // 文件句柄 | 			// 文件句柄 | ||||||
|             $resource = fopen(self::$cacheDir.'hashString.txt', "wb"); | 			$resource = fopen(self::$cacheDir.'hashString.txt', "wb"); | ||||||
|             // 成功:返回写入字节数,失败返回false | 			// 成功:返回写入字节数,失败返回false | ||||||
|             $worldsnum = fwrite($resource, p($hashArray, false)); | 			$worldsnum = fwrite($resource, p($hashArray, false)); | ||||||
|             fclose($resource); | 			fclose($resource); | ||||||
|         } | 		} | ||||||
|         // 发起请求 | 		// 发起请求 | ||||||
|         echo "正在提交辅种信息…… \n"; | 		echo "正在提交辅种信息…… \n"; | ||||||
|         $res = $curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray); | 		$res = $curl->post(self::$apiUrl . self::$endpoints['reseed'], $hashArray); | ||||||
|         $resArray = json_decode($res->response, true); | 		$resArray = json_decode($res->response, true); | ||||||
|         // 写日志 | 		// 写返回日志 | ||||||
|         if (true) { | 		if(true){ | ||||||
|             // 文件句柄 | 			// 文件句柄 | ||||||
|             $resource = fopen(self::$cacheDir.'reseed.txt', "wb"); | 			$resource = fopen(self::$cacheDir.'reseed.txt', "wb"); | ||||||
|             // 成功:返回写入字节数,失败返回false | 			// 成功:返回写入字节数,失败返回false | ||||||
|             $worldsnum = fwrite($resource, p($resArray, false)); | 			$worldsnum = fwrite($resource, p($resArray, false)); | ||||||
|             fclose($resource); | 			fclose($resource); | ||||||
|         } | 		} | ||||||
|         // 判断返回值 | 		// 判断返回值 | ||||||
|         if (isset($resArray['errmsg']) && ($resArray['errmsg'] == 'ok')) { | 		if ( isset($resArray['errmsg']) && ($resArray['errmsg'] == 'ok') ) { | ||||||
|             echo "辅种信息提交成功!!! \n\n"; | 			echo "辅种信息提交成功!!! \n\n"; | ||||||
|         } else { | 		}else{ | ||||||
|             $errmsg = isset($resArray['errmsg']) ? $resArray['errmsg'] : '远端服务器无响应,请稍后重试!'; | 			$errmsg = isset($resArray['errmsg']) ? $resArray['errmsg'] : '远端服务器无响应,请稍后重试!'; | ||||||
|             echo '-----辅种失败,原因:' .$errmsg. " \n\n"; | 			echo '-----辅种失败,原因:' .$errmsg. " \n\n"; | ||||||
|             exit(1); | 			exit(1); | ||||||
|         } | 		} | ||||||
|         // 可辅种站点信息列表 | 		// 可辅种站点信息 | ||||||
|         $sites = $resArray['sites']; | 		$sites = $resArray['sites']; | ||||||
|         self::$wechatMsg['sitesCount'] = count($sites); | 		#p($sites); | ||||||
|         #p($sites); | 		// 支持站点数量 | ||||||
|         // 按客户端循环辅种 开始 | 		self::$wechatMsg['sitesCount'] = count($sites); | ||||||
|         foreach (self::$links as $k => $v) { | 		// 按客户端循环辅种 开始 | ||||||
|             $reseed = $infohash_Dir = array(); | 		foreach (self::$links as $k => $v) { | ||||||
|             // info_hash 对应的下载目录 | 			$reseed = $infohash_Dir = array(); | ||||||
|             $infohash_Dir = self::$links[$k]['hash']; | 			// info_hash与下载目录对应表 | ||||||
|             if (empty($resArray['clients_'.$k])) { | 			$infohash_Dir = self::$links[$k]['hash']; | ||||||
|                 echo "clients_".$k."没有查询到可辅种数据 \n\n"; | 			#p($infohash_Dir); | ||||||
|                 continue; | 			if (empty($resArray['clients_'.$k])) { | ||||||
|             } | 				echo "clients_".$k."没有查询到可辅种数据 \n\n"; | ||||||
|             #p($infohash_Dir); | 				continue; | ||||||
|             // 当前客户端辅种数据 | 			}			 | ||||||
|             $reseed = $resArray['clients_'.$k]; | 			// 当前客户端可辅种数据 | ||||||
|             foreach ($reseed as $info_hash => $vv) { | 			$reseed = $resArray['clients_'.$k]; | ||||||
|                 // 当前种子哈希对应的目录 | 			foreach ($reseed as $info_hash => $vv) { | ||||||
|                 $downloadDir = $infohash_Dir[$info_hash]; | 				// 当前种子哈希对应的目录 | ||||||
|                 foreach ($vv['torrent'] as $id => $value) { | 				$downloadDir = $infohash_Dir[$info_hash]; | ||||||
|                     // 匹配的辅种数据累加 | 				foreach ($vv['torrent'] as $id => $value) { | ||||||
|                     self::$wechatMsg['reseedCount']++; | 					$_url = $url = ''; | ||||||
|                     // 站点id | 					$download_page = $details_url = ''; | ||||||
|                     $sitesID = $value['sid']; | 					// 匹配的辅种数据累加 | ||||||
|                     $url = $_url = ''; | 					self::$wechatMsg['reseedCount']++; | ||||||
|                     $download_page = $details_url = ''; | 					// 站点id | ||||||
|                     // 页面规则 | 					$sitesID = $value['sid'];					 | ||||||
|                     $download_page = str_replace('{}', $value['torrent_id'], $sites[$sitesID]['download_page']); | 					// 页面规则 | ||||||
|                     $_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$download_page; | 					$download_page = str_replace('{}', $value['torrent_id'], $sites[$sitesID]['download_page']); | ||||||
|                     if (empty($configALL[$sites[$sitesID]['site']]['passkey'])) { | 					$_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$download_page; | ||||||
|                         echo '-------因当前' .$sites[$sitesID]['site']. '站点未设置passkey,已跳过!!' . "\n\n"; | 					/** | ||||||
|                         self::$wechatMsg['reseedSkip']++; | 					 * 前置检测 | ||||||
|                         continue; | 					 */ | ||||||
|                     } | 					// passkey检测 | ||||||
|                     // 种子URL组合方式区分 | 					if ( empty($configALL[$sites[$sitesID]['site']]['passkey']) ) { | ||||||
|                     switch ($sites[$sitesID]['site']) { | 						echo '-------因当前' .$sites[$sitesID]['site']. "站点未设置passkey,已跳过!! \n\n"; | ||||||
|                         case 'ttg': | 						self::$wechatMsg['reseedSkip']++; | ||||||
|                             $url = $_url."/". $configALL[$sites[$sitesID]['site']]['passkey']; | 						continue; | ||||||
|                             break; | 					} | ||||||
|                         case 'm-team': | 					// cookie检测 | ||||||
|                             $ip_type = ''; | 					if ( in_array($sites[$sitesID]['site'], self::$cookieCheck) && empty($configALL[$sites[$sitesID]['site']]['cookie']) ) { | ||||||
|                             if (isset($configALL[$sites[$sitesID]['site']]['ip_type'])) { | 						echo '-------因当前' .$sites[$sitesID]['site']. '站点未设置cookie,已跳过!!' . "\n\n"; | ||||||
|                                 $ip_type = $configALL[$sites[$sitesID]['site']]['ip_type'] == 'ipv6' ? '&ipv6=1' : ''; | 						self::$wechatMsg['reseedSkip']++; | ||||||
|                             } | 						continue; | ||||||
|                             $url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey'] . $ip_type. "&https=1"; | 					} | ||||||
|                             break; | 					// 流控检测 | ||||||
|                         case 'moecat': | 					if ( isset($configALL[$sites[$sitesID]['site']]['limit']) ) { | ||||||
|                             $ip_type = ''; | 						echo "-------因当前" .$sites[$sitesID]['site']. "站点触发流控,已跳过!! {$_url} \n\n"; | ||||||
|                             if (isset($configALL[$sites[$sitesID]['site']]['ip_type'])) { | 						self::$wechatMsg['reseedSkip']++; | ||||||
|                                 $ip_type = $configALL[$sites[$sitesID]['site']]['ip_type'] == 'ipv6' ? '&ipv6=1' : ''; | 						continue; | ||||||
|                             } | 					} | ||||||
|                             $url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey'] . $ip_type. "&https=1"; | 					// 重复做种检测 | ||||||
|                             break; | 					if ( isset($infohash_Dir[$value['info_hash']]) ) { | ||||||
|                         default: | 						echo '-------与客户端现有种子重复:'.$_url."\n\n"; | ||||||
|                             $url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey']; | 						self::$wechatMsg['reseedRepeat']++; | ||||||
|                             break; | 						continue; | ||||||
|                     } | 					} | ||||||
|                     /** | 					// 历史添加检测 | ||||||
|                      * 检查站点是否可以辅种 | 					if ( is_file(self::$cacheHash . $value['info_hash'].'.txt') ) { | ||||||
|                      */ | 						echo '-------当前种子上次辅种已成功添加,已跳过! '.$_url."\n\n"; | ||||||
|                     // 判断是否具有VIP或特殊权限? | 						self::$wechatMsg['reseedPass']++; | ||||||
|                     $is_vip = isset($configALL[$sites[$sitesID]['site']]['is_vip']) && $configALL[$sites[$sitesID]['site']]['is_vip'] ? 1 : 0; | 						continue; | ||||||
|                     if ((in_array($sites[$sitesID]['site'], self::$noReseed)==false) || $is_vip) { | 					} | ||||||
|                         /** | 					/** | ||||||
|                          *  可以辅种 | 					 * 种子URL组合方式区分 | ||||||
|                          */ | 					 */ | ||||||
|                         if (isset($infohash_Dir[$value['info_hash']])) { | 					switch ($sites[$sitesID]['site']) { | ||||||
|                             // 与客户端现有种子重复 | 						case 'ttg': | ||||||
|                             echo '-------与客户端现有种子重复:'.$_url."\n\n"; | 							$url = $_url."/". $configALL[$sites[$sitesID]['site']]['passkey']; | ||||||
|                             self::$wechatMsg['reseedRepeat']++; | 							break; | ||||||
|                             continue; | 						case 'm-team': | ||||||
|                         } else { | 							$ip_type = ''; | ||||||
|                             // 判断上次是否成功添加? | 							if (isset($configALL[$sites[$sitesID]['site']]['ip_type'])) { | ||||||
|                             if (is_file(self::$cacheHash . $value['info_hash'].'.txt')) { | 								$ip_type = $configALL[$sites[$sitesID]['site']]['ip_type'] == 'ipv6' ? '&ipv6=1' : ''; | ||||||
|                                 echo '-------当前种子上次辅种已成功添加,已跳过!'.$_url."\n\n"; | 							} | ||||||
|                                 self::$wechatMsg['reseedPass']++; | 							$url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey'] . $ip_type. "&https=1";						 | ||||||
|                                 continue; | 							break; | ||||||
|                             } | 						case 'moecat': | ||||||
|                             // 种子元数据获取 | 							$ip_type = ''; | ||||||
|                             switch ($sites[$sitesID]['site']) { | 							if (isset($configALL[$sites[$sitesID]['site']]['ip_type'])) { | ||||||
|                                 case 'hdchina': | 								$ip_type = $configALL[$sites[$sitesID]['site']]['ip_type'] == 'ipv6' ? '&ipv6=1' : ''; | ||||||
|                                     if (empty($configALL[$sites[$sitesID]['site']]['cookie'])) { | 							} | ||||||
|                                         echo '-------因当前' .$sites[$sitesID]['site']. '站点未设置cookie,已跳过!!' . "\n\n"; | 							$url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey'] . $ip_type. "&https=1";						 | ||||||
|                                         self::$wechatMsg['reseedSkip']++; | 							break; | ||||||
|                                         break; | 						default: | ||||||
|                                     } | 							$url = $_url."&passkey=". $configALL[$sites[$sitesID]['site']]['passkey']; | ||||||
|                                     if (isset($configALL[$sites[$sitesID]['site']]['limit'])) { | 							break; | ||||||
|                                         echo "当前站点触发人机验证,已加入排除列表 \n"; | 					} | ||||||
|                                     } | 					/** | ||||||
|                                     $cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : ''; | 					 * 检查站点是否可以辅种 | ||||||
|                                     $userAgent = $configALL['default']['userAgent']; | 					 */ | ||||||
|                                     // 拼接URL | 					// 判断是否具有VIP或特殊权限? | ||||||
|                                     $details_page = str_replace('{}', $value['torrent_id'], 'details.php?id={}&hit=1'); | 					$is_vip = isset($configALL[$sites[$sitesID]['site']]['is_vip']) && $configALL[$sites[$sitesID]['site']]['is_vip'] ? 1 : 0; | ||||||
|                                     $details_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$details_page; | 					if ( (in_array($sites[$sitesID]['site'], self::$noReseed)==false) || $is_vip ) { | ||||||
|                                     $details_html = download($details_url, $cookie, $userAgent); | 						/** | ||||||
|                                     print "种子详情页:".$details_url. "\n"; | 						 *  可以辅种 | ||||||
|                                     // 提取种子下载地址 | 						 */ | ||||||
|                                     $download_page = str_replace('{}', '', $sites[$sitesID]['download_page']); | 						// 特殊站点:推送给下载器种子元数据 | ||||||
|                                     $offset = strpos($details_html, $download_page); | 						switch ($sites[$sitesID]['site']) { | ||||||
|                                     $urlTemp = substr($details_html, $offset, 50); | 							case 'hdchina': | ||||||
|                                     // 种子地址 | 								$cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : ''; | ||||||
|                                     $_url = substr($urlTemp, 0, strpos($urlTemp, '">')); | 								$userAgent = $configALL['default']['userAgent']; | ||||||
|                                     $_url = 'https://' .$sites[$sitesID]['base_url']. '/' . $_url; | 								// 拼接URL | ||||||
|                                     print "种子下载页:".$_url. "\n"; | 								$details_page = str_replace('{}', $value['torrent_id'], 'details.php?id={}&hit=1'); | ||||||
|                                     $url = download($_url, $cookie, $userAgent); | 								$details_url = 'https://' .$sites[$sitesID]['base_url']. '/' .$details_page; | ||||||
|                                     if (strpos($url, '系统检测到过多的种子下载请求') != false) { | 								$details_html = download($details_url, $cookie, $userAgent); | ||||||
|                                         echo "触发人机验证 \n"; | 								print "种子详情页:".$details_url. "\n"; | ||||||
|                                         ff($sites[$sitesID]['site']. ' 触发人机验证,请重新设置!'); | 								// 提取种子下载地址 | ||||||
|                                         self::$noReseed[] = 'hdchina'; | 								$download_page = str_replace('{}', '', $sites[$sitesID]['download_page']); | ||||||
|                                         $configALL[$sites[$sitesID]['site']]['limit'] = 1; | 								$offset = strpos($details_html, $download_page); | ||||||
|                                     } | 								$urlTemp = substr($details_html, $offset, 50); | ||||||
|                                     break; | 								// 种子地址 | ||||||
|                                 case 'hdcity': | 								$_url = substr($urlTemp,0,strpos($urlTemp,'">')); | ||||||
|                                     if (empty($configALL[$sites[$sitesID]['site']]['cookie'])) { | 								$_url = 'https://' .$sites[$sitesID]['base_url']. '/' . $_url; | ||||||
|                                         echo '-------因当前' .$sites[$sitesID]['site']. '站点未设置cookie,已跳过!!' . "\n\n"; | 								print "种子下载页:".$_url. "\n"; | ||||||
|                                         self::$wechatMsg['reseedSkip']++; | 								$url = download($_url, $cookie, $userAgent); | ||||||
|                                         break; | 								if(strpos($url,'系统检测到过多的种子下载请求') != false){ | ||||||
|                                     } | 									echo "当前站点触发人机验证,已加入排除列表 \n"; | ||||||
|                                     $cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : ''; | 									ff($sites[$sitesID]['site']. ' 触发人机验证,请重新设置!'); | ||||||
|                                     $userAgent = $configALL['default']['userAgent']; | 									$configALL[$sites[$sitesID]['site']]['limit'] = 1; | ||||||
|                                     print "种子:".$_url. "\n"; | 									self::$noReseed[] = 'hdchina'; | ||||||
|                                     if (isset($configALL[$sites[$sitesID]['site']]['cuhash'])) { | 								} | ||||||
|                                         // 已获取cuhash | 								break; | ||||||
|                                         # code... | 							case 'hdcity': | ||||||
|                                     } else { | 								$cookie = isset($configALL[$sites[$sitesID]['site']]['cookie']) ? $configALL[$sites[$sitesID]['site']]['cookie'] : ''; | ||||||
|                                         // 获取cuhash | 								$userAgent = $configALL['default']['userAgent']; | ||||||
|                                         $html = download('https://' .$sites[$sitesID]['base_url']. '/pt', $cookie, $userAgent); | 								print "种子:".$_url. "\n"; | ||||||
|                                         // 提取种子下载地址 | 								if ( isset($configALL[$sites[$sitesID]['site']]['cuhash']) ) { | ||||||
|                                         $offset = strpos($html, 'cuhash='); | 									// 已获取cuhash | ||||||
|                                         $len = strlen('cuhash='); | 									# code... | ||||||
|                                         $cuhashTemp = substr($html, $offset+$len, 40); | 								}else { | ||||||
|                                         $configALL[$sites[$sitesID]['site']]['cuhash'] = substr($cuhashTemp, 0, strpos($cuhashTemp, '"')); | 									// 获取cuhash | ||||||
|                                     } | 									$html = download('https://' .$sites[$sitesID]['base_url']. '/pt', $cookie, $userAgent); | ||||||
|                                     $url = $_url."&cuhash=". $configALL[$sites[$sitesID]['site']]['cuhash']; | 									// 提取种子下载地址 | ||||||
|                                     // 城市下载种子时会302转向 | 									$offset = strpos($html,'cuhash='); | ||||||
|                                     $url = download($url, $cookie, $userAgent); | 									$len = strlen('cuhash='); | ||||||
|                                     break; | 									$cuhashTemp = substr($html,$offset+$len,40); | ||||||
|                                 default: | 									$configALL[$sites[$sitesID]['site']]['cuhash'] = substr($cuhashTemp,0,strpos($cuhashTemp,'"')); | ||||||
|                                     break; | 								} | ||||||
|                             } | 								$url = $_url."&cuhash=". $configALL[$sites[$sitesID]['site']]['cuhash']; | ||||||
|                             // 把拼接的种子URL,推送给下载器 | 								// 城市下载种子时会302转向 | ||||||
|                             $ret = false; | 								$url = download($url, $cookie, $userAgent); | ||||||
|                             // 成功返回:true | 								break; | ||||||
|                             $ret = self::add($k, $url, $downloadDir); | 							default: | ||||||
|                             // 添加成功的种子,以infohash为文件名,写入缓存 | 								// 默认站点:推送给下载器种子URL链接 | ||||||
|                             if ($ret) { | 								break; | ||||||
|                                 // 成功的种子 | 						} | ||||||
|                                 // 文件句柄 | 						// 把拼接的种子URL,推送给下载器 | ||||||
|                                 $resource = fopen(self::$cacheHash . $value['info_hash'].'.txt', "wb"); | 						$ret = false; | ||||||
|                                 // 成功:返回写入字节数,失败返回false | 						// 成功返回:true | ||||||
|                                 $worldsnum = fwrite($resource, $url); | 						$ret = self::add($k, $url, $downloadDir); | ||||||
|                                 fclose($resource); | 						// 添加成功的种子,以infohash为文件名,写入缓存 | ||||||
|                                 self::$wechatMsg['reseedSuccess']++; | 						if ($ret) { | ||||||
|                                 continue; | 							// 成功的种子 | ||||||
|                             } else { | 							// 文件句柄 | ||||||
|                                 // 失败的种子 | 							$resource = fopen(self::$cacheHash . $value['info_hash'].'.txt', "wb"); | ||||||
|                                 // 站点类型判断 | 							// 成功:返回写入字节数,失败返回false | ||||||
|                                 switch ($sites[$sitesID]['site']) { | 							$worldsnum = fwrite($resource, $url); | ||||||
|                                     case 'hdcity': | 							fclose($resource); | ||||||
|                                         echo '当前' .$sites[$sitesID]['site']. '站点是配置cuhash(不是passkey),添加成功说明配置正确!如果添加任务失败,请查阅常见问题!!' . "\n"; | 							self::$wechatMsg['reseedSuccess']++; | ||||||
|                                         break; | 							continue; | ||||||
|                                     default: | 						}else{ | ||||||
|                                         break; | 							// 失败的种子 | ||||||
|                                 } | 							// 不同站点的错误提示 | ||||||
|                                 // 失败累加 | 							switch ($sites[$sitesID]['site']) { | ||||||
|                                 self::$wechatMsg['reseedError']++; | 								case 'hdcity': | ||||||
|                                 continue; | 									break; | ||||||
|                             } | 								default: | ||||||
|                         } | 									break; | ||||||
|                     } else { | 							} | ||||||
|                         /** | 							// 失败累加 | ||||||
|                          *  不辅种 | 							self::$wechatMsg['reseedError']++; | ||||||
|                          */ | 							continue; | ||||||
|                         echo '-------已跳过不辅种的站点:'.$_url."\n\n"; | 						} | ||||||
|                         // 写入日志文件,供用户手动辅种 | 					}else{ | ||||||
|                         if (!isset($infohash_Dir[$value['info_hash']])) { | 						/** | ||||||
|                             // 站点类型判断 | 						 *  不辅种 | ||||||
|                             switch ($sites[$sitesID]['site']) { | 						 */ | ||||||
|                                 case 'hdchina': | 						echo '-------已跳过不辅种的站点:'.$_url."\n\n"; | ||||||
|                                     $url = $_url; | 						// 写入日志文件,供用户手动辅种 | ||||||
|                                     break; | 						if ( !isset($infohash_Dir[$value['info_hash']]) ) { | ||||||
|                                 default: | 							// 站点类型判断 | ||||||
|                                     break; | 							switch ($sites[$sitesID]['site']) { | ||||||
|                             } | 								case 'hdchina': | ||||||
|                             // 文件句柄 | 									$url = $_url; | ||||||
|                             $resource = fopen(self::$cacheDir . $sites[$sitesID]['site'].'.txt', 'a'); | 									break; | ||||||
|                             // 成功:返回写入字节数,失败返回false | 								default: | ||||||
|                             $worldsnum = fwrite($resource, 'clients_'.$k."\n".$downloadDir."\n".$url."\n".$details_url."\n\n"); | 									break; | ||||||
|                             fclose($resource); | 							} | ||||||
|                         } | 							// 文件句柄 | ||||||
|                     } | 							$resource = fopen(self::$cacheDir . $sites[$sitesID]['site'].'.txt', 'a'); | ||||||
|                 } | 							// 成功:返回写入字节数,失败返回false | ||||||
|             } | 							$worldsnum = fwrite($resource, 'clients_'.$k."\n".$downloadDir."\n".$url."\n".$details_url."\n\n"); | ||||||
|         } | 							fclose($resource); | ||||||
|         // 按客户端循环辅种 结束 | 						} | ||||||
|     } | 					} | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		// 按客户端循环辅种 结束 | ||||||
|  | 	} | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * |      * | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user