mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
Debug download MP4
This commit is contained in:
parent
45527fd611
commit
13bd5c202b
1 changed files with 10 additions and 6 deletions
|
@ -6074,8 +6074,8 @@ function downloadHLS($filepath) {
|
||||||
|
|
||||||
if (!empty($output['error'])) {
|
if (!empty($output['error'])) {
|
||||||
$msg = 'downloadHLS was not possible';
|
$msg = 'downloadHLS was not possible';
|
||||||
if(User::isAdmin()){
|
if (User::isAdmin()) {
|
||||||
$msg.='<br>'."m3u8ToMP4($filepath) return empty<br>".nl2br($output['msg']);
|
$msg .= '<br>' . "m3u8ToMP4($filepath) return empty<br>" . nl2br($output['msg']);
|
||||||
}
|
}
|
||||||
_error_log("downloadHLS: m3u8ToMP4($filepath) return empty");
|
_error_log("downloadHLS: m3u8ToMP4($filepath) return empty");
|
||||||
die($msg);
|
die($msg);
|
||||||
|
@ -6118,10 +6118,10 @@ function playHLSasMP4($filepath) {
|
||||||
$output = m3u8ToMP4($filepath);
|
$output = m3u8ToMP4($filepath);
|
||||||
|
|
||||||
if (!empty($output['error'])) {
|
if (!empty($output['error'])) {
|
||||||
|
|
||||||
$msg = 'playHLSasMP4 was not possible';
|
$msg = 'playHLSasMP4 was not possible';
|
||||||
if(User::isAdmin()){
|
if (User::isAdmin()) {
|
||||||
$msg.='<br>'."m3u8ToMP4($filepath) return empty<br>".nl2br($output['msg']);
|
$msg .= '<br>' . "m3u8ToMP4($filepath) return empty<br>" . nl2br($output['msg']);
|
||||||
}
|
}
|
||||||
die($msg);
|
die($msg);
|
||||||
}
|
}
|
||||||
|
@ -6154,8 +6154,12 @@ function m3u8ToMP4($input) {
|
||||||
}
|
}
|
||||||
_error_log("downloadHLS: m3u8ToMP4($input)");
|
_error_log("downloadHLS: m3u8ToMP4($input)");
|
||||||
//var_dump(!preg_match('/^http/i', $input), filesize($input), preg_match('/.m3u8$/i', $input));
|
//var_dump(!preg_match('/^http/i', $input), filesize($input), preg_match('/.m3u8$/i', $input));
|
||||||
if (!preg_match('/^http/i', $input) && (filesize($input) <= 10 || preg_match('/.m3u8$/i', $input))) { // dummy file
|
$ism3u8 = preg_match('/.m3u8$/i', $input);
|
||||||
|
if (!preg_match('/^http/i', $input) && (filesize($input) <= 10 || $ism3u8)) { // dummy file
|
||||||
$filepath = escapeshellcmd(pathToRemoteURL($input, true, true));
|
$filepath = escapeshellcmd(pathToRemoteURL($input, true, true));
|
||||||
|
if ($ism3u8 && !preg_match('/.m3u8$/i', $filepath)) {
|
||||||
|
$filepath = addLastSlash($filepath) . 'index.m3u8';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$filepath = escapeshellcmd($input);
|
$filepath = escapeshellcmd($input);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue