aboutsummaryrefslogtreecommitdiffstats
path: root/fetchyoutube.js
diff options
context:
space:
mode:
authoranekos2008-11-18 18:01:39 +0000
committeranekos2008-11-18 18:01:39 +0000
commit4245afeff4c224b32462dd85e45882d9d4afd03c (patch)
treeafbac5552e901762ca09cfd32c63f4dbadf526dc /fetchyoutube.js
parentfe3b73d1e345b13239e7a07fa7593b720feca3d6 (diff)
downloadvimperator-plugins-4245afeff4c224b32462dd85e45882d9d4afd03c.tar.bz2
ファイル名の正規化を修正
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24195 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'fetchyoutube.js')
-rw-r--r--fetchyoutube.js11
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: