Skip to content

Commit

Permalink
remove lookbehind assertions for firefox #28
Browse files Browse the repository at this point in the history
  • Loading branch information
liqi0816 committed Apr 2, 2018
1 parent bdce423 commit f7838d0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
7 changes: 6 additions & 1 deletion biliTwin.user.js
Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion biliTwinBabelCompiled.user.js
Expand Up @@ -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
});
Expand Down
7 changes: 6 additions & 1 deletion src/biliuserjs/bilimonkey.js
Expand Up @@ -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,
Expand Down

0 comments on commit f7838d0

Please sign in to comment.