From e7b1948f6961497c4bb52379592e9cb1368712d8 Mon Sep 17 00:00:00 2001 From: cgcladera-vancast Date: Mon, 11 Mar 2013 15:31:17 +0100 Subject: [PATCH 1/3] Start contribution --- .project | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .project diff --git a/.project b/.project new file mode 100644 index 0000000..c9de1fe --- /dev/null +++ b/.project @@ -0,0 +1,12 @@ + + + node-ffmpeg + + + + + + + org.nodeclipse.ui.NodeNature + + From a7e914fd99dd459b559eeff1b52ecfa0d333d521 Mon Sep 17 00:00:00 2001 From: cgcladera-vancast Date: Mon, 11 Mar 2013 16:20:16 +0100 Subject: [PATCH 2/3] Admit exteranl URI as an input --- lib/ffmpeg.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ffmpeg.js b/lib/ffmpeg.js index e5e99e9..26331f5 100644 --- a/lib/ffmpeg.js +++ b/lib/ffmpeg.js @@ -196,10 +196,10 @@ var ffmpeg = function (/* inputFilepath, settings, callback */) { throw errors.renderError('input_filepath_must_be_string'); // Get the input filepath var inputFilepath = args[0]; - // Check if file exist - if (!fs.existsSync(inputFilepath)) - throw errors.renderError('fileinput_not_exist'); - + //Check if the input is an external URI + //or is an existing file + if (!/["]?[a-zA-Z0-9\-\.]+:\/\/[a-zA-Z0-9\.\/]+(\s[a-zA-Z0-9]+=[a-zA-Z0-9]+)?["]?$/.test(inputFilepath) && !fs.existsSync(inputFilepath)) + throw errors.renderError('fileinput_not_exist'); // New instance of the base configuration var settings = new configs(); // Callback to call From a28eaa6714825f14e39d7045220586ca4b5600bb Mon Sep 17 00:00:00 2001 From: cgcladera-vancast Date: Wed, 27 Mar 2013 15:41:45 +0100 Subject: [PATCH 3/3] Improved URI regexp --- lib/ffmpeg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ffmpeg.js b/lib/ffmpeg.js index 26331f5..c5e1bfb 100644 --- a/lib/ffmpeg.js +++ b/lib/ffmpeg.js @@ -198,7 +198,7 @@ var ffmpeg = function (/* inputFilepath, settings, callback */) { var inputFilepath = args[0]; //Check if the input is an external URI //or is an existing file - if (!/["]?[a-zA-Z0-9\-\.]+:\/\/[a-zA-Z0-9\.\/]+(\s[a-zA-Z0-9]+=[a-zA-Z0-9]+)?["]?$/.test(inputFilepath) && !fs.existsSync(inputFilepath)) + if (!/["]?[a-zA-Z0-9\-\.\-:_]+:\/\/[a-zA-Z0-9\.\/\-:_]+(\s[a-zA-Z0-9\-_]+=[a-zA-Z0-9\-_]+)?["]?$/.test(inputFilepath) && !fs.existsSync(inputFilepath)) throw errors.renderError('fileinput_not_exist'); // New instance of the base configuration var settings = new configs();