Cut down on unneccessary ffprobe error logging

This commit is contained in:
calzoneman 2015-06-15 08:32:11 -04:00
parent 32d9285560
commit 9451e3978c
1 changed files with 10 additions and 5 deletions

View File

@ -46,7 +46,7 @@ function testUrl(url, cb, redirCount) {
return cb("Too many redirects. Please provide a direct link to the " +
"file");
}
return testUrl(res.headers['location'], cb, redirCount + 1);
return testUrl(res.headers["location"], cb, redirCount + 1);
}
if (res.statusCode !== 200) {
@ -55,8 +55,9 @@ function testUrl(url, cb, redirCount) {
return cb("HTTP " + res.statusCode + " " + message);
}
if (!/^audio|^video/.test(res.headers['content-type'])) {
return cb("Server did not return an audio or video file");
if (!/^audio|^video/.test(res.headers["content-type"])) {
return cb("Server did not return an audio or video file, or sent the " +
"wrong Content-Type");
}
cb();
@ -214,10 +215,14 @@ exports.query = function (filename, cb) {
return cb("Link uses a protocol unsupported by this server's " +
"version of ffmpeg");
Logger.errlog.log(err.stack || err);
// Ignore ffprobe error messages, they are common and most often
// indicate a problem with the remote file, not with this code.
if (!/(av|ff)probe/.test(String(err)))
Logger.errlog.log(err.stack || err);
return cb("Unable to query file data with ffmpeg");
} else {
Logger.errlog.log(err.stack || err);
if (!/(av|ff)probe/.test(String(err)))
Logger.errlog.log(err.stack || err);
return cb("Unable to query file data with ffmpeg");
}
}