禁止用于非法用途,本站是否自己备份代码用:
<?php
function downloadFile($url, $path)
{
$fp = fopen($path, 'w');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch);
curl_close($ch);
fclose($fp);
}
$json = file_get_contents('1.json');
$data = json_decode($json, true);
var_dump($data);
foreach ($data['V'] as $item) {
$folderName = $item['name'];
if (!is_dir($folderName)) {
mkdir($folderName);
}
foreach ($item['videos'] as $video) {
$url = $video['videoUrl'];
$url = str_replace('http://tk.360xxx.com', 'https://s1.v.360xxx.com', $url);
$fileName = $video['videoTitle'] . '.mp4';
$saveLocalFile = $folderName . '/' . $fileName;
downloadFile($url, $saveLocalFile);
}
}为了实现注册机才写的教程,为了批量注册一个网站,注册带有验证码,幸好是文本验证码,但是有session验证,于是POST必须携带cookie。代码如下。<?php class AutoCurl{ ...
if($_SERVER['REQUEST_METHOD'] == 'POST') { echo('This is post '); } elseif ($_SERVER['...
在一个正式项目中操作人员提交239个产品信息进行保存,但是系统却提示没有提交239个产品,于是开启错误信息,显示如下:Warning: Unknown: Input variables exceeded 1000. To incr...
<?php //php7+ define('CONFIG', [ 'MYSQL' => '127.0.0.1',  ...
自己的composer已经发布到packagist,但是无法使用composer require easy-task/easy-task来安装,只能在配置文件使用如下方式安装:"require": { "easy...
最近在编写windows php多线程的东西,从官网下载了PHP的线程安全版,尝试开启curl扩展extension=php_curl.dllphp -m 却提示 PHP Startup: Unable to load dynamic library 'C:\php\ext\php_curl...