git.cweiske.de
/
playVideoOnDreamboxProxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5814409
)
nice message for common error
author
Christian Weiske
<cweiske@cweiske.de>
Mon, 23 Nov 2015 22:37:31 +0000
(23:37 +0100)
committer
Christian Weiske
<cweiske@cweiske.de>
Mon, 23 Nov 2015 22:37:31 +0000
(23:37 +0100)
www/play.php
patch
|
blob
|
history
diff --git
a/www/play.php
b/www/play.php
index 353103517306c40b632a329b7e196c567d7e26e3..0133f5b1c066f5f74b7fcef9cebc0b774e06b013 100644
(file)
--- a/
www/play.php
+++ b/
www/play.php
@@
-41,7
+41,11
@@
function extractVideoUrl($pageUrl, $youtubedlPath)
$lastLine = exec($cmd, $output, $exitCode);
if ($exitCode !== 0) {
$lastLine = exec($cmd, $output, $exitCode);
if ($exitCode !== 0) {
- errorOut('youtube-dl error: ' . $lastLine);
+ if (strpos($lastLine, 'Unsupported URL') !== false) {
+ errorOut('Unsupported URL', '400 Unsupported URL (No video found)');
+ } else {
+ errorOut('youtube-dl error: ' . $lastLine);
+ }
}
return $lastLine;
}
}
return $lastLine;
}
@@
-91,9
+95,9
@@
function errorInput($msg)
exit(1);
}
exit(1);
}
-function errorOut($msg)
+function errorOut($msg
, $httpStatus = '500 Internal Server Error'
)
{
{
- header('HTTP/1.0
500 Internal Server Error'
);
+ header('HTTP/1.0
' . $httpStatus
);
header('Content-type: text/plain');
echo $msg . "\n";
exit(2);
header('Content-type: text/plain');
echo $msg . "\n";
exit(2);