aboutsummaryrefslogtreecommitdiffstats
path: root/ldrize_cooperation_fetch_flv.js
diff options
context:
space:
mode:
authordrry2008-11-23 21:08:10 +0000
committerdrry2008-11-23 21:08:10 +0000
commit0687798706c98c3fa09ddc37f7930f76ec057c49 (patch)
tree7098379e50cf36b96652eafbc5ec2a510ee58c40 /ldrize_cooperation_fetch_flv.js
parent8f9b86ff7218860b8c10ffcdd7e7a061d9311958 (diff)
downloadvimperator-plugins-0687798706c98c3fa09ddc37f7930f76ec057c49.tar.bz2
* fixed regexes.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24718 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'ldrize_cooperation_fetch_flv.js')
-rw-r--r--ldrize_cooperation_fetch_flv.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ldrize_cooperation_fetch_flv.js b/ldrize_cooperation_fetch_flv.js
index 28d31ce..fa6ee39 100644
--- a/ldrize_cooperation_fetch_flv.js
+++ b/ldrize_cooperation_fetch_flv.js
@@ -13,7 +13,7 @@ function NiconicoFlvHandler(url, title) {
const nicoApiEndPoint = 'http://www.nicovideo.jp/api/getflv?v=';
const nicoWatchEndPoint = 'http://www.nicovideo.jp/watch/';
let videoId = url.match(/\w{2}\d+/)[0];
- let fileName = title.replace(/[?\\\*\/:<>\|\"]/g, '_') + '.flv';
+ let fileName = title.replace(/[?\\*\/:<>|"]/g, '_') + '.flv';
httpGET(
nicoApiEndPoint + videoId,
@@ -88,7 +88,7 @@ liberator.modules.commands.addUserCommand(
httpGET(
arg.string || liberator.modules.buffer.URL,
function (responseText) {
- let [, title] = responseText.match(/<title>(.*?)<\/title>/i);
+ let [, title] = responseText.match(/<title(?:[ \t\r\n][^>]*)?>([^<]*)<\/title[ \t\n\r]*>/i);
liberator.log(title);
NiconicoFlvHandler(arg.string || liberator.modules.buffer.URL, title);
}