mirror of
				https://gitee.com/ledc/IYUUAutoReseed
				synced 2025-10-31 00:39:50 +00:00 
			
		
		
		
	修复添加种子元数据时,传入扩展参数失效的bug
This commit is contained in:
		| @@ -292,9 +292,9 @@ class AutoReseed | |||||||
|                     } |                     } | ||||||
|                     break; |                     break; | ||||||
|                 case 'qBittorrent':  |                 case 'qBittorrent':  | ||||||
|                     if ($is_url) { |  | ||||||
|                     $extra_options['paused'] = 'true'; |                     $extra_options['paused'] = 'true'; | ||||||
|                     $extra_options['autoTMM'] = 'false';	//关闭自动种子管理                    |                     $extra_options['autoTMM'] = 'false';	//关闭自动种子管理                    | ||||||
|  |                     if ($is_url) {                         | ||||||
|                         $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'; | ||||||
|   | |||||||
| @@ -266,7 +266,7 @@ class qBittorrent implements AbstractClientInterface | |||||||
|         // 拼接文件流 |         // 拼接文件流 | ||||||
|         foreach ($param as $name => $content) { |         foreach ($param as $name => $content) { | ||||||
|             $data .= "--" . $this->delimiter . $eol; |             $data .= "--" . $this->delimiter . $eol; | ||||||
|             $data .= 'Content-Disposition: form-data; name' . '="' .$name. '"' . "\r\n\r\n"; |             $data .= 'Content-Disposition: form-data; name="' .$name. '"' . $eol . $eol; | ||||||
|             $data .= $content . $eol; |             $data .= $content . $eol; | ||||||
|         } |         } | ||||||
|         $data .= "--" . $this->delimiter . "--" . $eol; |         $data .= "--" . $this->delimiter . "--" . $eol; | ||||||
| @@ -281,17 +281,21 @@ class qBittorrent implements AbstractClientInterface | |||||||
|         $this->delimiter = uniqid(); |         $this->delimiter = uniqid(); | ||||||
|         $eol = "\r\n"; |         $eol = "\r\n"; | ||||||
|         $data = ''; |         $data = ''; | ||||||
|         $torrents = $param['torrents']; |  | ||||||
|         unset($param['torrents']); |  | ||||||
|         // 拼接文件流 |         // 拼接文件流 | ||||||
|         $data .= "--" . $this->delimiter . $eol |         $data .= "--" . $this->delimiter . $eol; | ||||||
|         . 'Content-Disposition: form-data; '; |         $data .= 'Content-Disposition: form-data; name="' .$param['name']. '"; filename="'.$param['filename'].'"' . $eol; | ||||||
|  |         $data .= 'Content-Type: application/x-bittorrent' . $eol . $eol; | ||||||
|  |         $data .= $param['torrents'] . $eol; | ||||||
|  |         unset($param['name']); | ||||||
|  |         unset($param['filename']); | ||||||
|  |         unset($param['torrents']); | ||||||
|  |         if (!empty($param)) { | ||||||
|             foreach ($param as $name => $content) { |             foreach ($param as $name => $content) { | ||||||
|             $data.= $name . '="' . $content.'"; '; |                 $data .= "--" . $this->delimiter . $eol; | ||||||
|  |                 $data .= 'Content-Disposition: form-data; name="' . $name . '"' . $eol . $eol; | ||||||
|  |                 $data .= $content . $eol; | ||||||
|  |             } | ||||||
|         }         |         }         | ||||||
|         $data .= $eol; |  | ||||||
|         $data .= 'Content-Type: application/x-bittorrent'."\r\n\r\n"; |  | ||||||
|         $data .= $torrents . $eol; |  | ||||||
|         $data .= "--" . $this->delimiter . "--" . $eol; |         $data .= "--" . $this->delimiter . "--" . $eol; | ||||||
|         return $data; |         return $data; | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user