禁止用于非法用途,本站是否自己备份代码用:
<?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);
}
}首先下载wkhtmltox-0.12.4_linux-generic-amd64.tar.xz (不要下载RPM包,依赖太多,需要x-server支持),并解压,执行测试运行正常tar wkhtmltox-0.12.4_linux-generic-amd64.tar.xzcd...
通过http推送消息给socket,socket服务再向客户端推送<?php /* * Socket推送 * 请用守护进程方式启动php msgservice.php & (socket只...
Redis提供了发布订阅功能,可以用于消息的传输,Redis的发布订阅机制包括三个部分,发布者(publisher),订阅者(subscriber)和频道(channel)。 发布者和订阅者都是Redis客户端,Channel则为Redis服务器端,发布者将消息发送到某个的频道,订阅了这个...
<?php $member = new class { public function getInfo() { ...
自己的composer已经发布到packagist,但是无法使用composer require easy-task/easy-task来安装,只能在配置文件使用如下方式安装:"require": { "easy...
使用openssl扩展对应替换mcrypt的函数,(比较麻烦,但是openssl是未来趋势)在新版php中编译mcrypt扩展使用一个纯php代码实现的mcrypt扩展库,git地址为https://github.com/phpseclib/mcrypt_compat,每个mcrypt的方法都已经实...