diff options
-rw-r--r-- | fetchyoutube.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fetchyoutube.js b/fetchyoutube.js index a2824ab..69ea3b6 100644 --- a/fetchyoutube.js +++ b/fetchyoutube.js @@ -50,14 +50,12 @@ let file; if (filepath) { - filepath = io.expandPath(filepath); - file = io.getFile(filepath); - if (file.isDirectory()) - file.appendRelativePath(title + '.mp4'); + file = io.getFile(io.expandPath(filepath)); } else { file = dm.userDownloadsDirectory; - file.appendRelativePath(title + '.mp4'); } + if (file.isDirectory()) + file.appendRelativePath(fixFilename(title) + '.mp4'); if (file.exists()) return liberator.echoerr('The file already exists! -> ' + file.path); file = makeFileURI(file); @@ -69,7 +67,6 @@ wbp.saveURI(makeURL(url), null, null, null, null, file); liberator.echo('maybe downloading started'); } - //fetch(); commands.addUserCommand( ['fetchyoutube', 'fetchyt'], @@ -79,6 +76,8 @@ true ); + // fetch({}); + })(); // vim:sw=2 ts=2 et si fdm=marker: |