diff --git a/biliTwin.user.js b/biliTwin.user.js index 0246653..fde1620 100644 --- a/biliTwin.user.js +++ b/biliTwin.user.js @@ -2245,7 +2245,12 @@ class BiliMonkey { danmuku, name: index[cid].part || index[cid].index, outputName: res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/) ? - res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/)[0].replace(/(?<=\d+)-\d+(?=(?:\d|-|hd)*\.flv)/, '') + /*** + * see #28 + * Firefox lookbehind assertion not implemented https://bugzilla.mozilla.org/show_bug.cgi?id=1225665 + * try replace /-\d+(?=(?:\d|-|hd)*\.flv)/ => /(?<=\d+)-\d+(?=(?:\d|-|hd)*\.flv)/ in the future + */ + res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/)[0].replace(/-\d+(?=(?:\d|-|hd)*\.flv)/, '') : res.durl[0].url.match(/\d(?:\d|-|hd)*(?=\.mp4)/) ? res.durl[0].url.match(/\d(?:\d|-|hd)*(?=\.mp4)/)[0] : cid, diff --git a/biliTwinBabelCompiled.user.js b/biliTwinBabelCompiled.user.js index 006a213..85400d9 100644 --- a/biliTwinBabelCompiled.user.js +++ b/biliTwinBabelCompiled.user.js @@ -4441,7 +4441,13 @@ var BiliMonkey = function () { }), danmuku: danmuku, name: index[cid].part || index[cid].index, - outputName: res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/) ? res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/)[0].replace(/(?<=\d+)-\d+(?=(?:\d|-|hd)*\.flv)/, '') : res.durl[0].url.match(/\d(?:\d|-|hd)*(?=\.mp4)/) ? res.durl[0].url.match(/\d(?:\d|-|hd)*(?=\.mp4)/)[0] : cid, + outputName: res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/) ? + /*** + * see #28 + * Firefox lookbehind assertion not implemented https://bugzilla.mozilla.org/show_bug.cgi?id=1225665 + * try replace /-\d+(?=(?:\d|-|hd)*\.flv)/ => /(?<=\d+)-\d+(?=(?:\d|-|hd)*\.flv)/ in the future + */ + res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/)[0].replace(/-\d+(?=(?:\d|-|hd)*\.flv)/, '') : res.durl[0].url.match(/\d(?:\d|-|hd)*(?=\.mp4)/) ? res.durl[0].url.match(/\d(?:\d|-|hd)*(?=\.mp4)/)[0] : cid, cid: cid, res: res }); diff --git a/src/biliuserjs/bilimonkey.js b/src/biliuserjs/bilimonkey.js index 487ef18..56bd5d1 100644 --- a/src/biliuserjs/bilimonkey.js +++ b/src/biliuserjs/bilimonkey.js @@ -697,7 +697,12 @@ class BiliMonkey { danmuku, name: index[cid].part || index[cid].index, outputName: res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/) ? - res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/)[0].replace(/(?<=\d+)-\d+(?=(?:\d|-|hd)*\.flv)/, '') + /*** + * see #28 + * Firefox lookbehind assertion not implemented https://bugzilla.mozilla.org/show_bug.cgi?id=1225665 + * try replace /-\d+(?=(?:\d|-|hd)*\.flv)/ => /(?<=\d+)-\d+(?=(?:\d|-|hd)*\.flv)/ in the future + */ + res.durl[0].url.match(/\d+-\d+(?:\d|-|hd)*(?=\.flv)/)[0].replace(/-\d+(?=(?:\d|-|hd)*\.flv)/, '') : res.durl[0].url.match(/\d(?:\d|-|hd)*(?=\.mp4)/) ? res.durl[0].url.match(/\d(?:\d|-|hd)*(?=\.mp4)/)[0] : cid,