PHP无法运行可下载视频的python脚本

时间:2019-05-20 11:37:03

标签: php python python-3.x

我想要一个PHP脚本来运行以下代码: 感谢您的阅读(或帮助)

PHP可以运行简单的Print('hello world') .py文件,但不会运行以下代码:

#!/usr/bin/env python
from pytube import YouTube
import sys
print('....Video Downloading....')
YouTube(sys.argv[1]).streams.first().download('videos')
print('DONE!')

PHP 命令

$URL = $_GET['url'];
$fi = new FilesystemIterator('videos', FilesystemIterator::SKIP_DOTS);
printf("<br>There were %d Files", iterator_count($fi));
echo "<br><br>DEBUG:<br>";
$command = "/usr/bin/python3.6 main.py $URL";
//$command = 'whoami';
exec($command, $out, $status);
print_r($out);
echo "....".$status;
echo "<br>end DEBUG<br><br>";

0 个答案:

没有答案