mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
BV id adaptations
This commit is contained in:
parent
293b968b13
commit
85f0ade52b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
min/batch-download.min.js
vendored
2
min/batch-download.min.js
vendored
File diff suppressed because one or more lines are too long
@ -12,7 +12,7 @@
|
||||
"auto-draw.min.js": "AE72CF2623DF2D15AD4AF82D125FFAF7EF5B1E6B36D9E9AC646AC98AA6AA8698",
|
||||
"auto-play.min.js": "DC9938AC15DADDC9D88DCA0C9BE64BE142C37D32CB85E42E23DAB2A7378531E5",
|
||||
"bangumi-timeline.vue.min.js": "753B8C96AFB3E6AC4C9507576D12B6CBB207BC1CC3FE5885C419E99C65BCD547",
|
||||
"batch-download.min.js": "A93E6C2030A9C80D8B9187A47D6B19A74BCF93F34C614C96F76F725D5DE0FB0C",
|
||||
"batch-download.min.js": "754CA4B25CE98C10EF70E4BA6DA2E9D9C3633CDE14C82BD8D8D85400A2012627",
|
||||
"biliplus-redirect.min.js": "9882D14DAC5C103212A101A5168883C41B4B3B2737FD5F222DC343D0304FF8AF",
|
||||
"blackboard.min.js": "8BB9CCDE72302AE7DE39D66F9231EFB82BA27DDA799BA4AAAC06F6DE802661BF",
|
||||
"blackboard.vue.min.js": "84A30D5A6F322A3C083FC1100E9FF51233ECD08AFBD89A6449AD2388ACCC8522",
|
||||
@ -70,8 +70,8 @@
|
||||
"download-live-records.min.js": "7EF26D22D22EB75A6B27B78B3DB0E2ADE6004587C11B0C2893CF1CCB3B6FAB6F",
|
||||
"download-subtitle.min.js": "4B99A00FEEA40C6D577AC8BD8DFFD34D91B75E150C7848B965D58B0096DF762C",
|
||||
"download-video.min.css": "8B68CCDADACC3D84BC1AC661C3E46CD3EBEB657CC89F244B05D756B0ECF4069C",
|
||||
"download-video.min.html": "D5542056B00352B37B9BAF05D823832B477FD10E8F6C179A02A4B1ADBB6F0761",
|
||||
"download-video.min.js": "17E76FB8966626D13C0AF0547C91AA94539697BFB52EF0A290C65C7BC730B250",
|
||||
"download-video.min.html": "FF62E93D979BC5AA1D75AFD0A9CD92E03EBC9747A082C9BDE59460FEA63FF983",
|
||||
"download-video.min.js": "0495D0F035A3EC4E4EA9ECE27E0A9A36FA730984CECD0A6EA1EE880F553A1889",
|
||||
"download-video-package.min.js": "B10FF11DE7DFBACEC38F195B8E836511E527215B5E177CB1D223D14F30EB1435",
|
||||
"dpi-img.vue.min.js": "11DF7577B754D8C01E8331E4FDAC9494E72523099845A0D6B0D897849CD841D6",
|
||||
"expand-danmaku.min.js": "B21658C40085AEA8DC49652AE62EB8610BB2EBEAF7A9C9AF69EF3B11E08EEC8D",
|
||||
@ -147,7 +147,7 @@
|
||||
"old-tweets.min.js": "387152B26384B0900985F527112841CC00A48F507EAA8FA634D13FFA83447A72",
|
||||
"online-info-row.vue.min.js": "4707798C1C08F1704142BAEFE43CB4DA3060352A66B0F1A6BFE5A77F8486A195",
|
||||
"outer-watchlater.min.css": "B40E94BADA1A9BC96422777B33150780330763098B539921DA05F9D3BA487424",
|
||||
"outer-watchlater.min.js": "2B4A5A63779B90D68609EAB8CFBE7EDD127773557745A827706591F157B15E0B",
|
||||
"outer-watchlater.min.js": "102BEA3F43A2E35188BE53805C2B9A264282AE29FF685FF521FC6E7038BB0853",
|
||||
"override-navbar.min.css": "E5AA612841281169CA367A238FB934F807900A385CE2298B7352FF3CA4623757",
|
||||
"override-navbar.min.js": "E55F4EF066461D98ADB1C1582A716C8E179DC78DED8E71D3E9757B25444C2C5E",
|
||||
"pako-inflate.min.js": "3C55C3DF869249CDCF8489FBC96DFCA2AB7961554909DD55D39E7133DA074315",
|
||||
@ -218,7 +218,7 @@
|
||||
"video-list.vue.min.js": "9B0FB6AC3D3CD8D0250CBBC787D5BE823C46216CD71B9E8DCAC75AFE1BE5A9EA",
|
||||
"video-story.min.js": "F9D4D2D80997DF5F11BF0CFA4D389B77BDBF1566EA6002E47174B68B440F3C0D",
|
||||
"view-cover.min.js": "E4960587BFC4A219278EC300AFC8983AE4064D6FDBB42093E4EB7590726E229E",
|
||||
"watchlater.min.js": "8C3C74E64A6D1B0FD5A40166FCB19981F86AF0A0E1003586DC591863C2022B18",
|
||||
"watchlater.min.js": "E17424B0B6544385A876D18114A77B8CEA644FFC9F472DB0B1E48C216E5F4583",
|
||||
"watchlater-api.min.js": "0A341429EFB4489594C6670A1FEEF99E7EC2564FF18BCE3A679E98101BA0F2F4",
|
||||
"watchlater-expire-warnings.min.js": "99282802EF8EB87F199BDE88240E1F196CD85C77516E8D5466EB6F1939B908DD"
|
||||
}
|
||||
BIN
min/bundle.zip
BIN
min/bundle.zip
Binary file not shown.
File diff suppressed because one or more lines are too long
2
min/download-video.min.js
vendored
2
min/download-video.min.js
vendored
File diff suppressed because one or more lines are too long
2
min/outer-watchlater.min.js
vendored
2
min/outer-watchlater.min.js
vendored
@ -1 +1 @@
|
||||
(()=>{return(t,i)=>{(async()=>{if(!document.URL.includes("//www.bilibili.com/video/av")){return}await SpinQuery.condition(()=>dq(".video-toolbar .ops .collect"),t=>{return t!==null&&t.innerText!=="--"});const t=dq(".video-toolbar .ops .collect");if(!t){return}t.insertAdjacentHTML("afterend",`\n<span title='稍后再看' class='watchlater' :class="{on: isInWatchlater}" @click="toggle()">\n<i class='mdi mdi-timetable'></i>\n 稍后再看\n<div class='tip' :class="{show: tipShowing}">{{tipText}}</div>\n</span>\n`);const i=dq(".ops .watchlater");const e=dq(".ops .watchlater .tip");if(!i||!e){return}const a=new Vue({el:i,store:store,data:{aid:unsafeWindow.aid,tipText:"",tipShowing:false,tipHandle:0},computed:{...Vuex.mapState(["watchlaterList"]),isInWatchlater(){return this.watchlaterList.includes(parseInt(this.aid))}},methods:{...Vuex.mapActions(["toggleWatchlater"]),showTip(t){this.tipText=t;this.tipShowing=true;if(this.tipHandle){clearTimeout(this.tipHandle)}this.tipHandle=setTimeout(()=>{this.tipShowing=false},2e3)},async toggle(){await this.toggleWatchlater(this.aid);this.showTip(this.isInWatchlater?"已添加至稍后再看":"已从稍后再看移除")}}});Observer.videoChange(()=>{a.aid=unsafeWindow.aid})})()}})();
|
||||
(()=>{return(t,i)=>{(async()=>{if(!document.URL.startsWith("https://www.bilibili.com/video/")){return}await SpinQuery.condition(()=>dq(".video-toolbar .ops .collect"),t=>{return t!==null&&t.innerText!=="--"});const t=dq(".video-toolbar .ops .collect");if(!t){return}t.insertAdjacentHTML("afterend",`\n<span title='稍后再看' class='watchlater' :class="{on: isInWatchlater}" @click="toggle()">\n<i class='mdi mdi-timetable'></i>\n 稍后再看\n<div class='tip' :class="{show: tipShowing}">{{tipText}}</div>\n</span>\n`);const i=dq(".ops .watchlater");const e=dq(".ops .watchlater .tip");if(!i||!e){return}const a=new Vue({el:i,store:store,data:{aid:unsafeWindow.aid,tipText:"",tipShowing:false,tipHandle:0},computed:{...Vuex.mapState(["watchlaterList"]),isInWatchlater(){return this.watchlaterList.includes(parseInt(this.aid))}},methods:{...Vuex.mapActions(["toggleWatchlater"]),showTip(t){this.tipText=t;this.tipShowing=true;if(this.tipHandle){clearTimeout(this.tipHandle)}this.tipHandle=setTimeout(()=>{this.tipShowing=false},2e3)},async toggle(){await this.toggleWatchlater(this.aid);this.showTip(this.isInWatchlater?"已添加至稍后再看":"已从稍后再看移除")}}});Observer.videoChange(()=>{a.aid=unsafeWindow.aid})})()}})();
|
||||
2
min/watchlater.min.js
vendored
2
min/watchlater.min.js
vendored
@ -1 +1 @@
|
||||
(()=>{return(e,t)=>{const i=e=>{const t=e.match(/(av[\d]+)\/p([\d]+)/);if(t){return`https://www.bilibili.com/video/${t[1]}/?p=${t[2]}`}else{return"javascript:;"}};const r=e=>{const t=e.map(e=>{const t=e.getAttribute("href");if(!t){return"javascript:;"}if(t.match(/.*watchlater.*|javascript:;/g)){return i(t)}if(t.indexOf("video/av")!==-1){return t}});e.forEach((e,i)=>{e.setAttribute("href",t[i]);e.setAttribute("target","_blank")})};const a=(...e)=>{for(const t of e){SpinQuery.select(()=>document.querySelectorAll(t),e=>r([...e]))}};SpinQuery.select(".watch-later-list").then(()=>{Observer.childListSubtree("#viewlater-app",()=>{SpinQuery.condition(()=>document.URL.match(/(av[\d]+)\/p([\d]+)/),e=>e&&document.URL.indexOf("watchlater")!==-1,()=>{const e=i(document.URL);if(e!==null){window.location.assign(e)}});SpinQuery.select("#viewlater-app .s-btn[href='#/']",e=>e.remove());a(".av-pic",".av-about>a")})});SpinQuery.select("li.nav-item[report-id*=watchlater]").then(()=>{Observer.childListSubtree("li.nav-item[report-id*=watchlater]",()=>{a(".av-item>a",".av-about>a","div.watch-later-m>ul>div>li>a");SpinQuery.select(".read-more.mr",e=>e.remove());SpinQuery.select(".read-more-grp>.read-more",e=>{e.style.width="auto";e.style.float="none"})})});SpinQuery.select(".van-popper-favorite").then(async e=>{if(!e){return}const t=Observer.childListSubtree(e,()=>{const i=e.querySelector(".play-all");if(i){const e="//www.bilibili.com/watchlater/#/list";Observer.attributes(i,()=>{if(i.getAttribute("href")==="//www.bilibili.com/watchlater/"){i.setAttribute("href",e);i.firstChild.classList.remove("bili-icon_dingdao_bofang");i.firstChild.classList.add("bili-icon_xinxi_yuedushu");i.lastChild.nodeValue="查看全部"}else if(i.getAttribute("href")!==e){i.firstChild.classList.add("bili-icon_dingdao_bofang");i.firstChild.classList.remove("bili-icon_xinxi_yuedushu");i.lastChild.nodeValue="播放全部"}});t.forEach(e=>e.stop())}})})}})();
|
||||
(()=>{return(t,e)=>{const i=t=>{const e=t.match(/(av[\d]+)\/p([\d]+)/i)||t.match(/(BV[\w]+)\/p([\d]+)/i);if(e){return`https://www.bilibili.com/video/${e[1]}/?p=${e[2]}`}else{return"javascript:;"}};const r=t=>{const e=t.map(t=>{const e=t.getAttribute("href");if(!e){return"javascript:;"}if(e.match(/.*watchlater.*|javascript:;/g)){return i(e)}if(e.match(/video\/av|video\/BV/i)){return e}});t.forEach((t,i)=>{t.setAttribute("href",e[i]);t.setAttribute("target","_blank")})};const a=(...t)=>{for(const e of t){SpinQuery.select(()=>document.querySelectorAll(e),t=>r([...t]))}};SpinQuery.select(".watch-later-list").then(()=>{Observer.childListSubtree("#viewlater-app",()=>{SpinQuery.condition(()=>document.URL.match(/(av[\d]+)\/p([\d]+)/i)||document.URL.match(/(BV[\w]+)\/p([\d]+)/i),t=>t&&document.URL.indexOf("watchlater")!==-1,()=>{const t=i(document.URL);if(t!==null){window.location.assign(t)}});SpinQuery.select("#viewlater-app .s-btn[href='#/']",t=>t.remove());a(".av-pic",".av-about>a")})});SpinQuery.select("li.nav-item[report-id*=watchlater]").then(()=>{Observer.childListSubtree("li.nav-item[report-id*=watchlater]",()=>{a(".av-item>a",".av-about>a","div.watch-later-m>ul>div>li>a");SpinQuery.select(".read-more.mr",t=>t.remove());SpinQuery.select(".read-more-grp>.read-more",t=>{t.style.width="auto";t.style.float="none"})})});SpinQuery.select(".van-popper-favorite").then(async t=>{if(!t){return}const e=Observer.childListSubtree(t,()=>{const i=t.querySelector(".play-all");if(i){const t="//www.bilibili.com/watchlater/#/list";Observer.attributes(i,()=>{if(i.getAttribute("href")==="//www.bilibili.com/watchlater/"){i.setAttribute("href",t);i.firstChild.classList.remove("bili-icon_dingdao_bofang");i.firstChild.classList.add("bili-icon_xinxi_yuedushu");i.lastChild.nodeValue="查看全部"}else if(i.getAttribute("href")!==t){i.firstChild.classList.add("bili-icon_dingdao_bofang");i.firstChild.classList.remove("bili-icon_xinxi_yuedushu");i.lastChild.nodeValue="播放全部"}});e.forEach(t=>t.stop())}})})}})();
|
||||
@ -327,7 +327,7 @@ import { store } from './store'
|
||||
case '同时(自动)':
|
||||
{
|
||||
const delayLoads = [
|
||||
'//www.bilibili.com/video/av',
|
||||
'//www.bilibili.com/video/',
|
||||
'//www.bilibili.com/bangumi/play',
|
||||
]
|
||||
if (delayLoads.some(it => document.URL.includes(it))) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
const getRedirectLink = text => {
|
||||
const match = text.match(/(av[\d]+)\/p([\d]+)/)
|
||||
const match = text.match(/(av[\d]+)\/p([\d]+)/i) || text.match(/(BV[\w]+)\/p([\d]+)/i)
|
||||
if (match) {
|
||||
return `https://www.bilibili.com/video/${match[1]}/?p=${match[2]}`
|
||||
} else {
|
||||
@ -16,7 +16,7 @@ const redirectLinks = items => {
|
||||
if (href.match(/.*watchlater.*|javascript:;/g)) {
|
||||
return getRedirectLink(href)
|
||||
}
|
||||
if (href.indexOf('video/av') !== -1) {
|
||||
if (href.match(/video\/av|video\/BV/i)) {
|
||||
return href
|
||||
}
|
||||
})
|
||||
@ -36,7 +36,7 @@ const redirectSelectors = (...selectors) => {
|
||||
SpinQuery.select('.watch-later-list').then(() => {
|
||||
Observer.childListSubtree('#viewlater-app', () => {
|
||||
SpinQuery.condition(
|
||||
() => document.URL.match(/(av[\d]+)\/p([\d]+)/),
|
||||
() => document.URL.match(/(av[\d]+)\/p([\d]+)/i) || document.URL.match(/(BV[\w]+)\/p([\d]+)/i),
|
||||
it => it && document.URL.indexOf('watchlater') !== -1,
|
||||
() => {
|
||||
const url = getRedirectLink(document.URL)
|
||||
|
||||
@ -110,7 +110,7 @@ ${f.url}
|
||||
class VideoEpisodeBatch extends Batch {
|
||||
aid = unsafeWindow.aid!
|
||||
static async test() {
|
||||
if (document.URL.includes('//www.bilibili.com/video/av')) {
|
||||
if (document.URL.startsWith('https://www.bilibili.com/video/')) {
|
||||
return await SpinQuery.select('#multi_page') !== null
|
||||
}
|
||||
return false
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
<div class="items-count">共{{manualInputItems.length}}个视频</div>
|
||||
</div>
|
||||
<div class="manual-input-content">
|
||||
<textarea placeholder="请输入视频链接或av号, 空格/换行分隔" v-model="manualInputText"></textarea>
|
||||
<textarea placeholder="请输入视频链接或av号 (没错, 不能是bv号), 空格/换行分隔" v-model="manualInputText"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="separator"></div>
|
||||
|
||||
@ -1031,7 +1031,7 @@ async function loadPanel() {
|
||||
async checkBatch() {
|
||||
const urls = [
|
||||
'//www.bilibili.com/bangumi',
|
||||
'//www.bilibili.com/video/av',
|
||||
'//www.bilibili.com/video',
|
||||
'//www.bilibili.com/blackboard/bnj2020.html'
|
||||
]
|
||||
if (!urls.some(url => document.URL.includes(url))) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
(async () => {
|
||||
if (!document.URL.includes('//www.bilibili.com/video/av')) {
|
||||
if (!document.URL.startsWith('https://www.bilibili.com/video/')) {
|
||||
return
|
||||
}
|
||||
await SpinQuery.condition(() => dq('.video-toolbar .ops .collect'), it => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user