From 5ec56f32e38c84d827abc8432d6a051cd05c5aff Mon Sep 17 00:00:00 2001 From: simon3000 Date: Wed, 3 Feb 2021 16:55:40 +0800 Subject: [PATCH] fix video --- README.md | 6 +- api.svg | 768 ++++++++++++++++++------------------ src/api/api.bilibili.com.js | 7 +- src/api/data.js | 4 +- 4 files changed, 384 insertions(+), 401 deletions(-) diff --git a/README.md b/README.md index 105e401..89a44c9 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ const biliAPI = require('bili-api') ; (async () => { let up = await biliAPI({ mid: 349991143 }, ['follower']) - up.follower // → 849109 + up.follower // → 849110 })() ``` @@ -150,7 +150,7 @@ const biliAPI = require('bili-api'); allVideos[0] // → { // "comment": 66, // "typeid": 17, - // "play": 11400, + // "play": 11477, // "pic": "//i0.hdslb.com/bfs/archive/59963a9223f6b23b459328ad25683b200f30f8c8.jpg", // "subtitle": "", // "description": "2020年9月26日油管直播节选\n──────────────────────────────────────────\n剪辑:真名看破\n翻译:东方\n时轴:银河猫喵喵\n校对:千里光\n──────────────────────────────────────────\n【日月咪玉】\n推特:https://twitter.com/HizukiMiu\n油管:https://www.youtube.com/channel/UCM6iy_rSgSMbFjx10Z6VVGA\n【樱月花音】\n推特:https://twit", @@ -438,7 +438,7 @@ const biliAPI = require('bili-api'); UP主的视频数 - *前置:* <[navnum](#api_navnum)> + *前置:* <[spaceSearch](#api_spaceSearch)> * ### guardNum diff --git a/api.svg b/api.svg index 30ed33f..9ac29cf 100644 --- a/api.svg +++ b/api.svg @@ -4,774 +4,762 @@ - - + + G - + cluster_api.bilibili.com - -api.bilibili.com + +api.bilibili.com cluster_api.live.bilibili.com - -api.live.bilibili.com + +api.live.bilibili.com cluster_data - -data + +data cluster_input - -input + +input stat - -stat + +stat - + follower - -follower + +follower - + stat->follower - - + + archiveStat - -archiveStat + +archiveStat - + bvid - -bvid + +bvid - + archiveStat->bvid - - + + upstat - -upstat + +upstat - + archiveView - -archiveView + +archiveView - + upstat->archiveView - - + + - + articleView - -articleView + +articleView - + upstat->articleView - - - - - -navnum - -navnum - - - -video - -video - - - -navnum->video - - + + - + info - -info + +info - + uname - -uname + +uname - + info->uname - - + + - + sign - -sign + +sign - + info->sign - - + + - + coins - -coins + +coins - + info->coins - - + + - + face - -face + +face - + info->face - - + + - + topPhoto - -topPhoto + +topPhoto - + info->topPhoto - - + + - + view - -view + +view - + cids - -cids + +cids - + view->cids - - + + - + mid - -mid + +mid - + view->mid - - + + - + cid - -cid + +cid - + view->cid - - + + - + list - -list + +list - + spaceSearch - -spaceSearch + +spaceSearch + + + +video + +video + + + +spaceSearch->video + + - + getSubmitVideosPage - -getSubmitVideosPage + +getSubmitVideosPage - + spaceSearch->getSubmitVideosPage - - + + - + getAllSubmitVideos - -getAllSubmitVideos + +getAllSubmitVideos - + allVideos - -allVideos + +allVideos - + getAllSubmitVideos->allVideos - - + + - + getFollowers - -getFollowers + +getFollowers - + getFollowersPage - -getFollowersPage + +getFollowersPage - + getFollowers->getFollowersPage - - + + - + getAllFollowers - -getAllFollowers + +getAllFollowers - + allFollowers - -allFollowers + +allFollowers - + getAllFollowers->allFollowers - - + + - + search - -search + +search - + search->mid - - + + - + _notice - -_notice + +_notice - + notice - -notice + +notice - + _notice->notice - - + + - + getRoomInfoOld - -getRoomInfoOld + +getRoomInfoOld - + roomStatus - -roomStatus + +roomStatus - + getRoomInfoOld->roomStatus - - + + - + roundStatus - -roundStatus + +roundStatus - + getRoomInfoOld->roundStatus - - + + - + liveStatus - -liveStatus + +liveStatus - + getRoomInfoOld->liveStatus - - + + - + title - -title + +title - + getRoomInfoOld->title - - + + - + online - -online + +online - + getRoomInfoOld->online - - + + - + roomid - -roomid + +roomid - + getRoomInfoOld->roomid - - + + - + topList - -topList + +topList - + guardNum - -guardNum + +guardNum - + topList->guardNum - - + + - + topListPage - -topListPage + +topListPage - + topList->topListPage - - + + - + fullTopList - -fullTopList + +fullTopList - + guards - -guards + +guards - + fullTopList->guards - - + + - + getInfoByRoom - -getInfoByRoom + +getInfoByRoom - + anchorScore - -anchorScore + +anchorScore - + getInfoByRoom->anchorScore - - + + - + liveStartTime - -liveStartTime + +liveStartTime - + getInfoByRoom->liveStartTime - - + + - + getInfoByRoom->mid - - + + - + rankdb - -rankdb + +rankdb - + areaRank - -areaRank + +areaRank - + rankdb->areaRank - - + + - + uname->search - - + + - + topListPage->fullTopList - - + + - + getSubmitVideosPage->getAllSubmitVideos - - + + - + guardLevel - -guardLevel + +guardLevel - + guards->guardLevel - - + + - + getFollowersPage->getAllFollowers - - + + - + roomStatus->roundStatus - - + + - + roomStatus->liveStatus - - + + - + liveStatus->online - - + + mid->stat - - + + mid->upstat - - - - - -mid->navnum - - + + - + mid->info - - + + - + mid->spaceSearch - - + + - + mid->getAllSubmitVideos - - + + - + mid->getFollowers - - + + - + mid->getAllFollowers - - + + - + mid->_notice - - + + - + mid->getRoomInfoOld - - + + - + mid->topList - - + + - + mid->fullTopList - - + + - + mid->rankdb - - + + - + dynamicsRaw - -dynamicsRaw + +dynamicsRaw - + mid->dynamicsRaw - - + + - + aid - -aid + +aid aid->archiveStat - - + + - + aid->aid - - + + - + bvid->view - - + + - + cid->list - - + + - + roomid->topList - - + + - + roomid->fullTopList - - + + - + roomid->getInfoByRoom - - + + - + page - -page + +page - + page->spaceSearch - - + + - + page->getFollowers - - + + - + page->topList - - + + - + SESSDATA - -SESSDATA + +SESSDATA - + SESSDATA->getAllFollowers - - + + - + p - -p + +p - + p->cid - - + + - + dynamics - -dynamics + +dynamics - + dynamicsRaw->dynamics - - + + - + dynamicOffset - -dynamicOffset + +dynamicOffset - + dynamicOffset->dynamicsRaw - - + + diff --git a/src/api/api.bilibili.com.js b/src/api/api.bilibili.com.js index 9e8b769..7b8ac63 100644 --- a/src/api/api.bilibili.com.js +++ b/src/api/api.bilibili.com.js @@ -14,11 +14,6 @@ module.exports = { type: 'json', get: ({ mid }) => `https://api.bilibili.com/x/space/upstat?mid=${mid}` }, - navnum: { - demand: ['mid'], - type: 'json', - get: ({ mid }) => `https://api.bilibili.com/x/space/navnum?mid=${mid}` - }, info: { demand: ['mid'], type: 'json', @@ -38,7 +33,7 @@ module.exports = { demand: ['mid'], type: 'json', optional: ['page'], - get: ({ mid, page = 1 }) => `https://api.bilibili.com/x/space/arc/search?mid=${mid}&ps=100&tid=0&pn=${page}` + get: ({ mid, page = 1 }) => `https://api.bilibili.com/x/space/arc/search?mid=${mid}&ps=100&pn=${page}` }, getAllSubmitVideos: { demand: ['getSubmitVideosPage', 'mid'], diff --git a/src/api/data.js b/src/api/data.js index 2dbe7be..521d115 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -16,8 +16,8 @@ module.exports = { get: ({ info }) => info.data.coins }, video: { - demand: ['navnum'], - get: ({ navnum }) => navnum.data.video + demand: ['spaceSearch'], + get: ({ spaceSearch }) => spaceSearch.data.page.count }, guardNum: { demand: ['topList'],