Skip to content

Commit

Permalink
B1.11: 支持 bangumi.bilibili.com/movie 页面
Browse files Browse the repository at this point in the history
  • Loading branch information
tiansh committed Jan 26, 2016
1 parent b39a0af commit 0488b95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bilibili/bilibili_ASS_Danmaku_Downloader.meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// @include http:https://bilibili.kankanews.com/video/av*
// @updateURL https://tiansh.github.io/us-danmaku/bilibili/bilibili_ASS_Danmaku_Downloader.meta.js
// @downloadURL https://tiansh.github.io/us-danmaku/bilibili/bilibili_ASS_Danmaku_Downloader.user.js
// @version 1.10
// @version 1.11
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @run-at document-start
Expand Down
13 changes: 7 additions & 6 deletions bilibili/bilibili_ASS_Danmaku_Downloader.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
// @namespace https://github.com/tiansh
// @description 以 ASS 格式下载 bilibili 的弹幕
// @include http:https://www.bilibili.com/video/av*
// @include http:https://www.bilibili.tv/video/av*
// @include http:https://bilibili.kankanews.com/video/av*
// @include http:https://bangumi.bilibili.com/movie/*
// @updateURL https://tiansh.github.io/us-danmaku/bilibili/bilibili_ASS_Danmaku_Downloader.meta.js
// @downloadURL https://tiansh.github.io/us-danmaku/bilibili/bilibili_ASS_Danmaku_Downloader.user.js
// @version 1.10
// @version 1.11
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @run-at document-start
// @author 田生
// @copyright 2014+, 田生
// @license Mozilla Public License 2.0; http:https://www.mozilla.org/MPL/2.0/
// @license CC Attribution-ShareAlike 4.0 International; http:https://creativecommons.org/licenses/by-sa/4.0/
// @connect-src comment.bilibili.com
// @connect-src interface.bilibili.com
// ==/UserScript==

/*
Expand Down Expand Up @@ -548,15 +549,15 @@ var getCid = function (callback) {
debug('get cid...');
var cid = null, src = null;
try {
src = document.querySelector('#bofqi iframe').src.replace(/^.*\?/, '');
src = document.querySelector('#bofqi iframe, #moviebofqi iframe').src.replace(/^.*\?/, '');
cid = Number(src.match(/cid=(\d+)/)[1]);
} catch (e) { }
if (!cid) try {
src = document.querySelector('#bofqi embed').getAttribute('flashvars');
src = document.querySelector('#bofqi embed, #moviebofqi embed').getAttribute('flashvars');
cid = Number(src.match(/cid=(\d+)/)[1]);
} catch (e) { }
if (!cid) try {
src = document.querySelector('#bofqi object param[name="flashvars"]').getAttribute('value');
src = document.querySelector('#bofqi object param[name="flashvars"], #moviebofqi object param[name="flashvars"]').getAttribute('value');
cid = Number(src.match(/cid=(\d+)/)[1]);
} catch (e) { }
if (cid) setTimeout(callback, 0, cid);
Expand Down

0 comments on commit 0488b95

Please sign in to comment.