1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Debug download MP4

This commit is contained in:
Daniel 2021-10-14 17:18:52 -03:00
parent 45527fd611
commit 13bd5c202b

View file

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