当前位置:首页 > PHP > 正文内容

某自考BAN付费视频下载脚本备份

高老师2年前 (2023-11-03)PHP424

禁止用于非法用途,本站是否自己备份代码用:

<?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);
    }
}


扫描二维码推送至手机访问。

版权声明:本文由高久峰个人博客发布,如需转载请注明出处。

本文链接:https://blog.20230611.cn/post/666.html

分享给朋友:

“某自考BAN付费视频下载脚本备份” 的相关文章

php将html转为pdf,php将html页面导出pdf

php将html转为pdf,php将html页面导出pdf

首先下载wkhtmltox-0.12.4_linux-generic-amd64.tar.xz   (不要下载RPM包,依赖太多,需要x-server支持),并解压,执行测试运行正常tar wkhtmltox-0.12.4_linux-generic-amd64.tar.xzcd...

php使用swoole扩展推送消息

php使用swoole扩展推送消息

通过http推送消息给socket,socket服务再向客户端推送<?php /*  * Socket推送  * 请用守护进程方式启动php msgservice.php &   (socket只...

redis订阅和发布,redis消息订阅与发布, phpredis订阅和发布

redis订阅和发布,redis消息订阅与发布, phpredis订阅和发布

Redis提供了发布订阅功能,可以用于消息的传输,Redis的发布订阅机制包括三个部分,发布者(publisher),订阅者(subscriber)和频道(channel)。 发布者和订阅者都是Redis客户端,Channel则为Redis服务器端,发布者将消息发送到某个的频道,订阅了这个...

php new class

php new class

<?php $member = new class {     public function getInfo()     {    ...

packagist包发布稳定版

packagist包发布稳定版

自己的composer已经发布到packagist,但是无法使用composer require easy-task/easy-task来安装,只能在配置文件使用如下方式安装:"require": {     "easy...

php mcrypt扩展被废弃的解决方案

php mcrypt扩展被废弃的解决方案

使用openssl扩展对应替换mcrypt的函数,(比较麻烦,但是openssl是未来趋势)在新版php中编译mcrypt扩展使用一个纯php代码实现的mcrypt扩展库,git地址为https://github.com/phpseclib/mcrypt_compat,每个mcrypt的方法都已经实...