Hallo.
Ich habe hier ein sxcript das soll ein youtube video downloaden mittels dem Programm youtube-dl. Leider bekomme ich eine Fehlermeldung die ich nicht lösen kann.
die fehlermeldung die da kommt ist folgende
Ich habe hier ein sxcript das soll ein youtube video downloaden mittels dem Programm youtube-dl. Leider bekomme ich eine Fehlermeldung die ich nicht lösen kann.
PHP-Code:
<?php
$url = 'http://www.youtube.com/watch?v=coq9klG41R8';
$template = '/home/heiko/www/YTD/1.tmp';
$string = ('youtube-dl --output=/home/heiko/www/YTD/testfile.flv '.($url));
$descriptorspec = array(
0 => array("pipe", "r"), // stdin
1 => array("pipe", "w"), // stdout
2 => array("pipe", "w"), // stderr
);
@set_time_limit(0); // Timelimit auf 0 setzen
$id = 0; // mit 0 vorbelegen
if (isset($_GET['id'])) {
$id = (int) $_GET['id']; // id aus GET an die Variable $id zuweisen und mit (int) zu einer Zahl typisieren ("casten")
}
if ($id == 100) {
$VLink=$_POST['VLink'];
// $output=shell_exec("youtube-dl --output=home/heiko/www/YTD/testfile.flv -x --audio-format mp3 --audio-quality 320k $VLink");
$process = proc_open("youtube-dl --output=/home/heiko/www/YTD/testfile.flv -x --audio-format mp3 --audio-quality 320k $VLink", $descriptorspec, $pipes);
echo "<pre>$process</pre>";
$stdout = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$stderr = stream_get_contents($pipes[2]);
fclose($pipes[2]);
$ret = proc_close($process);
echo json_encode(array('status' => $ret, 'errors' => $stderr,
'url_orginal'=>$url, 'output' => $stdout,
'command' => $string));
}
else {
?>
<h1>Video Link</h1>
<form action="index.php?id=100" method="post">
<input name="VLink" size="40" type="text">
<input name="abschicken" type="submit" value="Abschicken">
</form>
<?php
}
?>
Code:
Resource id #6 {"status":1,"errors":"ERROR: unable to open for writing: [Errno 13] Permission denied: '\/home\/heiko\/www\/YTD\/testfile.flv.part'\n","url_orginal":"http:\/\/www.youtube.com\/watch?v=coq9klG41R8","output":"[youtube] Setting language\n[youtube] TVtIxv9oLF0: Downloading webpage\n[youtube] TVtIxv9oLF0: Downloading video info webpage\n[youtube] TVtIxv9oLF0: Extracting video information\n","command":"youtube-dl --output=\/home\/heiko\/www\/YTD\/testfile.flv http:\/\/www.youtube.com\/watch?v=coq9klG41R8"}
Kommentar