From 4245afeff4c224b32462dd85e45882d9d4afd03c Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 18 Nov 2008 18:01:39 +0000 Subject: ファイル名の正規化を修正 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24195 d0d07461-0603-4401-acd4-de1884942a52 --- fetchyoutube.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'fetchyoutube.js') 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: -- cgit v1.2.3