From 1ee1919c172a0cf835a0d8b6c6481e78aa32b850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E4=B8=89?= <89683694+Tangsan99999@users.noreply.github.com> Date: Thu, 17 Aug 2023 20:11:33 +0800 Subject: [PATCH] Add files via upload --- open/bili_open.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/open/bili_open.js b/open/bili_open.js index c65c7e1..1d44b00 100644 --- a/open/bili_open.js +++ b/open/bili_open.js @@ -53,6 +53,7 @@ async function init(cfg) { siteKey = cfg.skey; siteType = cfg.stype; let extend = cfg.ext; + if (cfg.ext.hasOwnProperty('categories')) extend = cfg.ext.categories; if (cfg.ext.hasOwnProperty('cookie')) cookie = cfg.ext.cookie; if (_.isEmpty(cookie)) await getCookie(); @@ -133,7 +134,7 @@ async function homeVod() { imageUrl = 'https:' + imageUrl; } - vod.vod_id = item.bvid; + vod.vod_id = item.bvid + "@" + item.aid; vod.vod_name = removeTags(item.title); vod.vod_pic = imageUrl; vod.vod_remarks = item.duration.split(':')[0] + '分钟'; @@ -179,7 +180,7 @@ async function category(tid, page, filter, ext) { pic = 'https:' + pic; } - video.vod_id = item.bvid; + video.vod_id = item.bvid + "@" + item.aid; video.vod_name = removeTags(item.title); video.vod_pic = pic; video.vod_remarks = item.duration.split(':')[0] + '分钟'; @@ -201,12 +202,8 @@ async function category(tid, page, filter, ext) { async function detail(ids) { try { - const bvid = ids; - const bvid2aidUrl = `https://api.bilibili.com/x/web-interface/archive/stat?bvid=${bvid}`; - - const bvid2aidResp = JSON.parse(await request(bvid2aidUrl, getHeaders())); - - const aid = bvid2aidResp.data.aid + ''; + const bvid = ids.split("@")[0]; + const aid = ids.split("@")[1]; const detailUrl = `https://api.bilibili.com/x/web-interface/view?aid=${aid}`; const detailData = JSON.parse(await request(detailUrl, getHeaders())).data; @@ -253,7 +250,7 @@ async function detail(ids) { playList.push(playUrl); } - video.vod_play_from = 'external$$$dash$$$mp4'; + video.vod_play_from = 'dash$$$mp4'; //removed external video.vod_play_url = playList.join('#'); video.vod_play_url = [video.vod_play_url, video.vod_play_url, video.vod_play_url].join('$$$');