Файловый менеджер - Редактировать - /www/wwwroot/gamenworld.store/downvideo.php
�азад
<?php // 允许所有域名进行跨域请求 header("Access-Control-Allow-Origin: *"); // 允许指定的 HTTP 方法 header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS"); // 允许的请求头 header("Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With"); // 你想要下载的 TikTok 视频 URL $tiktok_url = $_GET['tiktokurl']; // 设置输出文件名(暂时不保存本地) $output_file = "/tmp/tiktok_video.mp4"; // 你可以在临时目录中保存视频 // 构建 `yt-dlp` 命令 $command = "yt-dlp -o \"$output_file\" \"$tiktok_url\""; // 执行命令并获取输出 $output = shell_exec($command); // 检查视频是否下载成功 if ($output && file_exists($output_file)) { // 设置响应头,指示浏览器处理为下载流 header('Content-Type: video/mp4'); header('Content-Disposition: attachment; filename="tiktok_video.mp4"'); header('Content-Length: ' . filesize($output_file)); // 输出视频流 readfile($output_file); // 删除临时文件 unlink($output_file); exit; } else { echo "视频下载失败。"; } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.0.26 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка