Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admit external URI as an input #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>node-ffmpeg</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>org.nodeclipse.ui.NodeNature</nature>
</natures>
</projectDescription>
8 changes: 4 additions & 4 deletions lib/ffmpeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down