我试图访问和下载使用的一些.torrent文件.但没有任何反应,给出https://torrage.comphp curlcurl_error($ch)
$ch = curl_init ('https://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_VERBOSE,true);
$data = curl_exec($ch);
$error = curl_error($ch);
curl_close ($ch);
echo $error;
Run Code Online (Sandbox Code Playgroud)
这给了.
Cannot communicate securely with peer: no common encryption algorithm(s).
Run Code Online (Sandbox Code Playgroud)
如果我尝试像这样的shell
[root@prod1 yum.repos.d]# curl -I https://torrage.com
curl: (35) Cannot communicate securely with peer: no common encryption algorithm(s).
Run Code Online (Sandbox Code Playgroud)
在详细模式下
[root@prod1 yum.repos.d]# curl -v https://torrage.com
* Rebuilt URL to: https://torrage.com/
* Trying 81.17.30.48...
* …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 cURL 从给定的 URL 下载 ZIP 文件。我从供应商那里收到了一个 URL,我应该在其中下载 ZIP 文件。但是每次我尝试下载 ZIP 文件时,我都会看到一个页面,说我没有登录。
我应该从中获取文件的网址如下所示:
https://www.tyre24.com/nl/nl/user/login/userid/USERID/password/PASSWORD/page/L2V4cG9ydC9kb3dubG9hZC90L01nPT0vYy9NVFE9Lw==
Run Code Online (Sandbox Code Playgroud)
在这里您可以看到 USERID 和 PASSWORD 是填充了正确数据的变量。奇怪的是,如果我在浏览器中输入 URL,它似乎可以工作,则 zip 文件正在下载。
但是每次我用 cURL 调用那个 URL 时,我似乎得到一个不正确的登录页面。有人能告诉我我做错了什么吗?
似乎给定的 URL 后面有一个重定向,这就是我放入 cURL 调用的原因: curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
这是我的代码:
set_time_limit(0);
//File to save the contents to
$fp = fopen ('result.zip', 'w+');
$url = "https://www.tyre24.com/nl/nl/user/login/userid/118151/password/5431tyre24/page/L2V4cG9ydC9kb3dubG9hZC90L01nPT0vYy9NVFE9Lw==";
//Here is the file we are downloading, replace spaces with %20
$ch = curl_init(str_replace(" ","%20",$url));
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
//give curl the file pointer so that it can write to …Run Code Online (Sandbox Code Playgroud)