mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Add bnj download support
This commit is contained in:
parent
ad53c75572
commit
c452450cde
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": "196BC0C07AF05A2E26E84D85C7CFB5C3E2620C927572C8C22070A1AEBB5B44B3",
|
||||
"batch-download.min.js": "B7ADE150F26243B9529C2F0E2EC06695ACD27678E07902A8E6EABA767BBE3DD0",
|
||||
"batch-download.min.js": "531A7C02901680C031AB0BAE9F1B63F9BFF37186F7DB29453839011C65B567CE",
|
||||
"biliplus-redirect.min.js": "9882D14DAC5C103212A101A5168883C41B4B3B2737FD5F222DC343D0304FF8AF",
|
||||
"blackboard.min.js": "8BB9CCDE72302AE7DE39D66F9231EFB82BA27DDA799BA4AAAC06F6DE802661BF",
|
||||
"blackboard.vue.min.js": "84A30D5A6F322A3C083FC1100E9FF51233ECD08AFBD89A6449AD2388ACCC8522",
|
||||
@ -53,7 +53,6 @@
|
||||
"dark-important.min.css": "8453644F7FC8BB0E9DA401DC161815E2AC198E9B4D7A5A19C29934B672F277B1",
|
||||
"dark-navbar.min.css": "A2D91F11127D165571ACCC53004EDDB118CEE110F9B020D7E0541E1C8FAEA478",
|
||||
"dark-schedule.min.js": "853C446547603F4F0425F19F09F73335C9EC451A790C1C07E5E5B88A09E9B453",
|
||||
"dark-slice-9.min.css": "2493E0DF5E63B5FA8F3005CEBECEB7940AEABF1C8AC70A42B17A61EA0E7376CA",
|
||||
"dark-styles.min.js": "C62AFBB47DDC1E2F3F45D688B0F98394E471A423BE26BF47504D5C7D069ADBA1",
|
||||
"debounce.min.js": "54D33E1273C1F3FE19550BF1844339C3D54D6B01DF8A39C3162D95B93B079CFA",
|
||||
"default-danmaku-settings.min.css": "D9942B184FEDA7B08CFA0C34920E97D7A83B81762DCBF757642EBB60F95FF25D",
|
||||
@ -66,9 +65,9 @@
|
||||
"download-audio.min.js": "1F4536DE4FF302BFD026CA17E028AF8EB037FB6D0CB355692549DECAEAE0E8C9",
|
||||
"download-danmaku.min.js": "87BC2B39D99E029BB602AB2F59A387FC960D5779791524F8C26FBC0278CD8F8E",
|
||||
"download-subtitle.min.js": "4B99A00FEEA40C6D577AC8BD8DFFD34D91B75E150C7848B965D58B0096DF762C",
|
||||
"download-video.min.css": "699C47BE6C007E7338BF6F1FB80C58E0403D04F121A2E10FEE5E4B47DC7DC5D8",
|
||||
"download-video.min.css": "9B7FFAC852999B11DB62B6467CDBA1AEE53B7F3FA6C592185281542B25AF527A",
|
||||
"download-video.min.html": "D662FBB3C6899E75A52D15C59C53FD6966DA6E4CE463BCEFF0008D5BD3796C7F",
|
||||
"download-video.min.js": "FE66E6FAAA6940E9E9A1725671225C872F8A61F48A9437D360AB59C1D126DC22",
|
||||
"download-video.min.js": "1AFC947D3B103FD24DC7119B10E83B9C3A2AB02C4D99EFCAD0BE28D92DD45714",
|
||||
"download-video-package.min.js": "B10FF11DE7DFBACEC38F195B8E836511E527215B5E177CB1D223D14F30EB1435",
|
||||
"dpi-img.vue.min.js": "905DD5D8071437FE1C04C3E156E61E594C676BF3928241CC52BCAFAAA0FFA089",
|
||||
"expand-danmaku.min.js": "B21658C40085AEA8DC49652AE62EB8610BB2EBEAF7A9C9AF69EF3B11E08EEC8D",
|
||||
|
||||
BIN
min/bundle.zip
BIN
min/bundle.zip
Binary file not shown.
2
min/download-video.min.css
vendored
2
min/download-video.min.css
vendored
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
@ -108,17 +108,18 @@ ${f.url}
|
||||
}
|
||||
}
|
||||
class VideoEpisodeBatch extends Batch {
|
||||
aid = unsafeWindow.aid!
|
||||
static async test() {
|
||||
if (!document.URL.includes('/www.bilibili.com/video/av')) {
|
||||
return false
|
||||
if (document.URL.includes('//www.bilibili.com/video/av')) {
|
||||
return await SpinQuery.select('#multi_page') !== null
|
||||
}
|
||||
return await SpinQuery.select('#multi_page') !== null
|
||||
return false
|
||||
}
|
||||
async getItemList() {
|
||||
if (this.itemList.length > 0) {
|
||||
return this.itemList
|
||||
}
|
||||
const api = `https://api.bilibili.com/x/web-interface/view?aid=${unsafeWindow.aid}`
|
||||
const api = `https://api.bilibili.com/x/web-interface/view?aid=${this.aid}`
|
||||
const json = await Ajax.getJson(api)
|
||||
if (json.code !== 0) {
|
||||
Toast.error(`获取视频选集列表失败, message=${json.message}`, '批量下载')
|
||||
@ -137,7 +138,7 @@ class VideoEpisodeBatch extends Batch {
|
||||
ep: page.part
|
||||
},
|
||||
cid: page.cid,
|
||||
aid: unsafeWindow.aid,
|
||||
aid: this.aid,
|
||||
} as BatchItem
|
||||
})
|
||||
return this.itemList
|
||||
@ -177,6 +178,27 @@ class VideoEpisodeBatch extends Batch {
|
||||
return JSON.stringify(result)
|
||||
}
|
||||
}
|
||||
class Bnj2020Batch extends Batch {
|
||||
mainVideo: VideoEpisodeBatch
|
||||
spVideo: VideoEpisodeBatch
|
||||
constructor(config: BatchExtractorConfig) {
|
||||
super(config)
|
||||
// 拜年祭就硬编码 aid 了(
|
||||
this.mainVideo = new VideoEpisodeBatch(config)
|
||||
this.mainVideo.aid = '78976165'
|
||||
this.spVideo = new VideoEpisodeBatch(config)
|
||||
this.spVideo.aid = '78979124'
|
||||
}
|
||||
static async test() {
|
||||
return document.URL.includes('//www.bilibili.com/blackboard/bnj2020.html')
|
||||
}
|
||||
async getItemList() {
|
||||
return (await this.mainVideo.getItemList()).concat(await this.spVideo.getItemList())
|
||||
}
|
||||
async collectData(quality: string | number) {
|
||||
return (await this.mainVideo.collectData(quality)).concat(await this.spVideo.collectData(quality))
|
||||
}
|
||||
}
|
||||
class BangumiBatch extends Batch {
|
||||
static async test() {
|
||||
return document.URL.includes('/www.bilibili.com/bangumi')
|
||||
@ -251,7 +273,7 @@ class BangumiBatch extends Batch {
|
||||
return JSON.stringify(result)
|
||||
}
|
||||
}
|
||||
const extractors = [BangumiBatch, VideoEpisodeBatch]
|
||||
const extractors = [BangumiBatch, VideoEpisodeBatch, Bnj2020Batch]
|
||||
let ExtractorClass: new (config: BatchExtractorConfig) => Batch
|
||||
export class BatchExtractor {
|
||||
config: BatchExtractorConfig
|
||||
|
||||
@ -308,6 +308,7 @@
|
||||
}
|
||||
.selected-count {
|
||||
width: 64px;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
}
|
||||
.aria2-rpc .mdi {
|
||||
|
||||
@ -884,8 +884,9 @@ async function loadPanel() {
|
||||
},
|
||||
async checkBatch() {
|
||||
const urls = [
|
||||
'/www.bilibili.com/bangumi',
|
||||
'/www.bilibili.com/video/av'
|
||||
'//www.bilibili.com/bangumi',
|
||||
'//www.bilibili.com/video/av',
|
||||
'//www.bilibili.com/blackboard/bnj2020.html'
|
||||
]
|
||||
if (!urls.some(url => document.URL.includes(url))) {
|
||||
this.batch = false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user