@ybgnb/bili-api 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3228 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Qa=Object.create;var He=Object.defineProperty;var Ha=Object.getOwnPropertyDescriptor;var pt=(n,i)=>(i=Symbol[n])?i:Symbol.for("Symbol."+n),fe=n=>{throw TypeError(n)};var Ka=(n,i,e)=>i in n?He(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e;var ot=(n,i)=>He(n,"name",{value:i,configurable:!0});var m=n=>[,,,Qa(n?.[pt("metadata")]??null)],ut=["class","method","getter","setter","accessor","field","value","get","set"],ge=n=>n!==void 0&&typeof n!="function"?fe("Function expected"):n,Ga=(n,i,e,t,s)=>({kind:ut[n],name:i,metadata:t,addInitializer:r=>e._?fe("Already initialized"):s.push(ge(r||null))}),l=(n,i)=>Ka(i,pt("metadata"),n[3]),c=(n,i,e,t)=>{for(var s=0,r=n[i>>1],p=r&&r.length;s<p;s++)i&1?r[s].call(e):t=r[s].call(e,t);return t},a=(n,i,e,t,s,r)=>{var p,d,q,b,P,g=i&7,be=!!(i&8),U=!!(i&16),Ve=g>3?n.length+1:g?be?1:2:0,it=ut[g+5],at=g>3&&(n[Ve-1]=[]),$a=n[Ve]||(n[Ve]=[]),S=g&&(!U&&!be&&(s=s.prototype),g<5&&(g>3||!U)&&Ha(g<4?s:{get[e](){return rt(this,r)},set[e](v){return nt(this,r,v)}},e));g?U&&g<4&&ot(r,(g>2?"set ":g>1?"get ":"")+e):ot(s,e);for(var $e=t.length-1;$e>=0;$e--)b=Ga(g,e,q={},n[3],$a),g&&(b.static=be,b.private=U,P=b.access={has:U?v=>Ja(s,v):v=>e in v},g^3&&(P.get=U?v=>(g^1?rt:Xa)(v,s,g^4?r:S.get):v=>v[e]),g>2&&(P.set=U?(v,Qe)=>nt(v,s,Qe,g^4?r:S.set):(v,Qe)=>v[e]=Qe)),d=(0,t[$e])(g?g<4?U?r:S[it]:g>4?void 0:{get:S.get,set:S.set}:s,b),q._=1,g^4||d===void 0?ge(d)&&(g>4?at.unshift(d):g?U?r=d:S[it]=d:s=d):typeof d!="object"||d===null?fe("Object expected"):(ge(p=d.get)&&(S.get=p),ge(p=d.set)&&(S.set=p),ge(p=d.init)&&at.unshift(p));return g||l(n,s),S&&He(s,e,S),U?g^4?r:S:s};var Ke=(n,i,e)=>i.has(n)||fe("Cannot "+e),Ja=(n,i)=>Object(i)!==i?fe('Cannot use the "in" operator on this value'):n.has(i),rt=(n,i,e)=>(Ke(n,i,"read from private field"),e?e.call(n):i.get(n));var nt=(n,i,e,t)=>(Ke(n,i,"write to private field"),t?t.call(n,e):i.set(n,e),e),Xa=(n,i,e)=>(Ke(n,i,"access private method"),e);import mo from"md5";function o(){return function(n,i){let e=String(i.name);return function(...t){let s=this.constructor.name;try{return n.call(this,...t)}catch(r){if(typeof this.handleError=="function")this.handleError(r,s,e);else throw console.error(`${s}.${e} \u672A\u77E5\u5F02\u5E38`,r),r}}}}var w=class extends Error{constructor(i,e,t){super(e||"\u64CD\u4F5C\u5931\u8D25"),this.name="BiliError",this.rawError=t instanceof Error?t:new Error(String(t));let{timeout:s,userAgent:r,context:p}=i;this.clientConfig={timeout:s,userAgent:r,context:p?.userCookie?{userCookie:p?.userCookie}:void 0}}},Pe=class extends w{constructor(i,e,t,s){super(i,t,s),this.name="BiliApiError";let{url:r,method:p,query:d,data:q,skipWbiSign:b,autoCsrf:P}=e;this.requestOptions={url:r,method:p,query:d,data:q,skipWbiSign:b,autoCsrf:P}}},te=class extends Pe{constructor(e,t,s,r,p){super(e,t,r||s.statusText||`HTTP ${s.status}`,p);this.status=0;this.name="BiliApiHttpError",this.status=s.status}},xe=class extends Pe{constructor(i,e,t,s,r){super(i,e,s||t.message,r),this.name="BiliApiBusinessError",this.responseCode=t.code??-1,this.responseData=t.data}};import{createAbortError as lt,isCanceledError as Za}from"@ybgnb/utils";async function mt(n,i,e){let t={updateRequestContext:!0,autoRefresh:!0,pollIntervalMs:1233,...e},s=AbortSignal.timeout(180*1e3),r=t.signal?AbortSignal.any([t.signal,s]):s,p=b=>new Promise(P=>setTimeout(P,b)),d=b=>{try{i.onStatusChange(b)}catch(P){n.logger.error("[QRCodeLogin] onStatusChange callback error:",P)}},q=async b=>{try{await i.onQRCodeReceived(b)}catch(P){n.logger.error("[QRCodeLogin] onQRCodeReceived callback error:",P)}};try{for(;!r.aborted;){d("\u6B63\u5728\u83B7\u53D6\u767B\u5F55\u4E8C\u7EF4\u7801...");let b=await n.getLoginQRCode(e);if(!b?.url||!b?.qrcode_key)throw new Error("\u672A\u80FD\u83B7\u53D6\u6709\u6548\u7684\u4E8C\u7EF4\u7801\u6570\u636E");await q(b.url),d("\u8BF7\u4F7F\u7528\u624B\u673A App \u626B\u7801\u767B\u5F55..."),await p(2e3);let P=!1;for(;!r.aborted&&!P;){let g=await n.getQRCodeLoginResult(b.qrcode_key,e);switch(d(g.message),g.code){case 0:return d("\u626B\u7801\u6210\u529F\uFF0C\u6B63\u5728\u540C\u6B65\u7528\u6237\u4FE1\u606F..."),i.cookieProvider&&(await p(1e3),g.setCookie=await i.cookieProvider()),await n.initLoginSession(g.setCookie,t.updateRequestContext,e);case 86038:if(t.autoRefresh)d("\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548\uFF0C\u6B63\u5728\u81EA\u52A8\u5237\u65B0..."),P=!0;else throw new w(n.clientConfig,"\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548");break;default:await p(t.pollIntervalMs);break}}}}catch(b){if(t.signal?.aborted)throw d("\u53D6\u6D88\u767B\u5F55"),lt("\u53D6\u6D88\u767B\u5F55");if(r.aborted||Za(b)){let P="\u767B\u5F55\u8D85\u65F6";throw d(P),new Error(P)}throw b}throw r.aborted?lt():new Error("\u767B\u5F55\u6D41\u7A0B\u5F02\u5E38\u7EC8\u6B62")}function ct(n){if(!n)throw new Error("setCookie \u4E3A\u7A7A");let i=[],e,t;for(let s of n)if(s){let r=s.slice(0,s.indexOf(";")+1);i.push(r),r.startsWith("bili_jct=")&&(e=r.slice(9,-1)),r.startsWith("DedeUserID=")&&(t=r.slice(11,-1))}if(!e||!t)throw new Error("setCookie \u89E3\u6790\u9519\u8BEF\uFF0C\u4E0D\u5B58\u5728 bili_jct/uid");return{uid:Number(t),cookie:i.join(" "),bili_jct:e}}var ne=class{constructor(i){this.api=i}get clientConfig(){return this.api.clientConfig}get logger(){return this.api.logger}get request(){return this.api.request}get get(){return this.api.get}get post(){return this.api.post}get save(){return this.api.save}get currUserUid(){let i=this.api.clientConfig.context?.userCookie.uid;if(i===void 0)throw new w(this.clientConfig,"\u7528\u6237\u672A\u767B\u5F55");return i}};import{getErrorMessage as dt}from"@ybgnb/utils";var u=class extends ne{constructor(i){super(i),this.createPager=i.createPager}throwError(i,e){throw new w(this.clientConfig,dt(i),e)}handleError(i,e,t){if(i instanceof w)this.logger.error(`${e}.${t} \u51FA\u73B0\u9519\u8BEF`,i);else{let s=new w(this.clientConfig,dt(i),i);this.logger.error(`${e}.${t} \u51FA\u73B0\u9519\u8BEF`,s)}throw i}resolveVideoId(i){return i.aid!==void 0?{aid:i.aid}:{bvid:i.bvid}}};var gt,ft,yt,Rt,ht,bt,Pt,xt,_t,wt,j,B=class extends(wt=u,_t=[o()],xt=[o()],Pt=[o()],bt=[o()],ht=[o()],Rt=[o()],yt=[o()],ft=[o()],gt=[o()],wt){constructor(){super(...arguments);c(j,5,this)}getLoginQRCode(e){return this.get("https://passport.bilibili.com/x/passport-login/web/qrcode/generate",e)}async getQRCodeLoginResult(e,t){let s=await this.get("https://passport.bilibili.com/x/passport-login/web/qrcode/poll",{query:{qrcode_key:e},skipWbiSign:!0,returnFormat:"RawResponse",...t});return{...(await s.json()).data,setCookie:s.headers.getSetCookie()}}async loginWithQRCode(e,t){return mt(this,e,t)}getBuvids(e){return this.get("https://api.bilibili.com/x/frontend/finger/spi",e)}getMyInfo(e,t){return this.get("https://api.bilibili.com/x/space/myinfo",{cookie:e,...t})}async initLoginSession(e,t=!0,s){this.logger.info("\u521D\u59CB\u5316\u7528\u6237\u6570\u636E...");let r=ct(e),{b_3:p,b_4:d}=await this.getBuvids(s);r.cookie=`${r.cookie} buvid3=${encodeURIComponent(p)}; buvid4=${encodeURIComponent(d)}; `;let q={userCookie:r};return t&&(this.clientConfig.context=q),this.logger.info(`\u5DF2\u5B8C\u6210\u7528\u6237\u767B\u5F55\uFF1A${r.uid}`),q}async getUserCard(e,t){return await this.get("https://api.bilibili.com/x/web-interface/card",{query:e,...t})}async getUserCards(e,t){let s=await this.get("https://api.vc.bilibili.com/account/v1/user/cards",{query:{uids:e.join(",")},...t});return e.map(r=>s.find(p=>p.mid===r)??null)}async getUpStat(e,t){return await this.get("https://api.bilibili.com/x/space/upstat",{query:{mid:e},...t})}};j=m(wt),a(j,1,"getLoginQRCode",_t,B),a(j,1,"getQRCodeLoginResult",xt,B),a(j,1,"loginWithQRCode",Pt,B),a(j,1,"getBuvids",bt,B),a(j,1,"getMyInfo",ht,B),a(j,1,"initLoginSession",Rt,B),a(j,1,"getUserCard",yt,B),a(j,1,"getUserCards",ft,B),a(j,1,"getUpStat",gt,B),l(j,B);var Fo={None:0,Followed:2,Mutual:6,Blocked:128},ye={PackageCharge:1,PersonalSpace:11,Video:14,Comment:15,VideoEnd:17,H5Recommend:58,H5FollowList:106,H5FansList:107,Article:115,PrivateMessage:118,Search:120,VideoFollowBtn:164,H5CommonFollow:167,CreatorIncentive:192,ActivityPage:222,JointVideo:229,LikeDetail:235,FollowBarrage:245,BlockList:116},K={FOLLOW:{code:1,name:"\u5173\u6CE8",reSrc:ye.PersonalSpace},UNFOLLOW:{code:2,name:"\u53D6\u5173",reSrc:ye.H5FollowList},BLOCK:{code:5,name:"\u62C9\u9ED1",reSrc:ye.Comment},UNBLOCK:{code:6,name:"\u53D6\u6D88\u62C9\u9ED1",reSrc:ye.BlockList},REMOVE_FAN:{code:7,name:"\u8E22\u51FA\u7C89\u4E1D",reSrc:ye.H5FansList}};var y=class{constructor(i){this.options=i;i.pageParams&&(i.pageNum=this.parsePageNum(i.pageParams))}};import{isEmptyArr as eo}from"@ybgnb/utils";var pe=class extends y{hasNextPage(i,e,t){return!(this.options.total!==void 0&&(e.length>=this.options.total||(i-1)*this.options.pageSize>=this.options.total)||t!==null&&(t.data===null||eo(t.data)||this.getList(t).length<this.options.pageSize))}parsePageNum(i){if(i)return i.pn}updateNextPageParams(i,e,t,s){e.ps=this.options.pageSize,e.pn=i}getList(i){return i.data}};import{isEmptyArr as to}from"@ybgnb/utils";var G=class n extends pe{static isPageDataWithTotalResponse(i){return i!==null&&typeof i.data=="object"&&i.data!==null&&"total"in i.data&&"list"in i.data}hasNextPage(i,e,t){return!(!super.hasNextPage(i,e,t)||t!==null&&(!n.isPageDataWithTotalResponse(t)||t.data.total<=e.length||to(t.data.list)))}getList(i){return n.isPageDataWithTotalResponse(i)?i.data.list:[]}};import{sleep as _e}from"@ybgnb/utils";var Dt,At,Ot,qt,Bt,Ct,vt,kt,Nt,Mt,zt,Tt,St,jt,It,Ft,Et,Lt,Ut,Yt,Wt,Vt,$t,Qt,Ht,Kt,Gt,Jt,R,f=class extends(Jt=u,Gt=[o()],Kt=[o()],Ht=[o()],Qt=[o()],$t=[o()],Vt=[o()],Wt=[o()],Yt=[o()],Ut=[o()],Lt=[o()],Et=[o()],Ft=[o()],It=[o()],jt=[o()],St=[o()],Tt=[o()],zt=[o()],Mt=[o()],Nt=[o()],kt=[o()],vt=[o()],Ct=[o()],Bt=[o()],qt=[o()],Ot=[o()],At=[o()],Dt=[o()],Jt){constructor(){super(...arguments);c(R,5,this)}get userService(){return this.api.client.user}buildRelationPager(e,t,s){return this.createPager("https://api.bilibili.com/x/relation/tag",new pe({pageSize:200,total:typeof e=="object"?e.count:void 0,...t}),{query:{tagid:typeof e=="object"?e.tagid:e},...s})}async fetchRelationPage(e,t,s){return await this.buildRelationPager(e,t,s).fetchNext()}async fetchRelationPageWithNextParams(e,t,s){return await this.buildRelationPager(e,t,s).fetchPageWithNextParams()}async fetchRelationAll(e,t,s,r){return await this.buildRelationPager(e,t,r).fetchAllPage(s)}async getRelation(e,t){return this.get("https://api.bilibili.com/x/space/wbi/acc/relation",{query:{mid:e,web_location:"333.1387"},...t})}getFollowTags(e){return this.get("https://api.bilibili.com/x/relation/tags",e)}getFollowingsByTag(e,t,s,r){return this.fetchRelationAll(e,t,s,r)}createFollowTag(e,t){return this.save("https://api.bilibili.com/x/relation/tag/create",{data:{tag:e},...t})}updateFollowTag(e,t){return this.save("https://api.bilibili.com/x/relation/tag/update",{data:e,...t})}deleteFollowTag(e,t){return this.save("https://api.bilibili.com/x/relation/tag/del",{data:{tagid:`${e}`},...t})}async getFollowsGroupedByTag(e,t,s){let r=await this.getFollowTags(s);for(let p of r)p.list=await this.getFollowingsByTag(p,e,t,s);return r}buildFollowingsPager(e,t,s){if(!e&&!this.currUserUid)throw new w(this.clientConfig,"uid \u4E3A\u7A7A");return this.createPager("https://api.bilibili.com/x/relation/followings",new G({pageSize:24,...t}),{query:{vmid:e??this.currUserUid,order:"desc"},...s})}async fetchFollowingsPage(e,t,s){return await this.buildFollowingsPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildFollowingsPager(e,t,s).fetchPageWithNextParams()}async fetchFollowingsAll(e,t,s,r){return await this.buildFollowingsPager(e,t,r).fetchAllPage(s)}async followUser(e,t){await this.modify(e,K.FOLLOW,!0,t)}async unFollowUser(e,t){await this.modify(e,K.UNFOLLOW,!0,t)}copyUsersToTag(e,t,s){return this.save("https://api.bilibili.com/x/relation/tags/copyUsers",{data:{fids:e.join(","),tagids:t.join(",")},...s})}buildFansPager(e,t,s){if(!e&&!this.currUserUid)throw new w(this.clientConfig,"uid \u4E3A\u7A7A");return this.createPager("https://api.bilibili.com/x/relation/fans",new G({pageSize:24,...t}),{query:{vmid:e??this.currUserUid,order:"desc"},...s})}async fetchFansPage(e,t,s){return await this.buildFansPager(e,t,s).fetchNext()}async fetchFansPageWithNextParams(e,t,s){return await this.buildFansPager(e,t,s).fetchPageWithNextParams()}async fetchFansAll(e,t,s,r){return await this.buildFansPager(e,t,r).fetchAllPage(s)}async removeFan(e,t){await this.modify(e,K.REMOVE_FAN,!0,t)}async getStat(e,t){return await this.get("https://api.bilibili.com/x/relation/stat",{query:{vmid:e},...t})}async avoidRiskControl(e,t){await this.get("https://api.bilibili.com/x/web-interface/wbi/search/all/v2",{query:{__refresh__:"true",_extra:"",context:"",page:"1",page_size:"42",order:"",pubtime_begin_s:"0",pubtime_end_s:"0",duration:"",from_source:"",from_spmid:"333.337",platform:"pc",highlight:"1",single_column:"0",keyword:`UID: ${e}`,ad_resource:"5646",source_tag:"3"},...t,logRequestParams:!1}),await _e(666,t?.signal),await this.getRelation(e),await _e(50,t?.signal),await this.getStat(e,t),await _e(50,t?.signal),await this.userService.getUpStat(e,t),await _e(666,t?.signal)}async modify(e,t,s=!0,r){s&&await this.avoidRiskControl(e,r),await this.save("https://api.bilibili.com/x/relation/modify",{query:{statistics:'{"appId":100,"platform":5}',...t.code!==K.BLOCK.code?{"x-bili-device-req-json":'{"platform":"web","device":"pc","spmid":"333.1387"}'}:{}},data:{fid:String(e),act:String(t.code),re_src:t.reSrc.toString(),spmid:"333.1387",extend_content:`{"entity":"query","entity_id":"${e}"}`,gaia_source:"web_main",...t.code!==K.BLOCK.code?{is_from_frontend_component:"true"}:{}},ignoreBusinessError:!1,...r})}async blockUser(e,t){await this.modify(e,K.BLOCK,!1,t)}async unBlockUser(e,t){await this.modify(e,K.UNBLOCK,!0,t)}buildBlocksPager(e,t){return this.createPager("https://api.bilibili.com/x/relation/blacks",new G({pageSize:50,...e}),{...t})}async fetchBlocksPage(e,t){return await this.buildBlocksPager(e,t).fetchNext()}async fetchBlocksPageWithNextParams(e,t){return await this.buildBlocksPager(e,t).fetchPageWithNextParams()}async fetchBlocksAll(e,t,s){return await this.buildBlocksPager(e,s).fetchAllPage(t)}};R=m(Jt),a(R,1,"fetchRelationPage",Gt,f),a(R,1,"fetchRelationPageWithNextParams",Kt,f),a(R,1,"fetchRelationAll",Ht,f),a(R,1,"getRelation",Qt,f),a(R,1,"getFollowTags",$t,f),a(R,1,"getFollowingsByTag",Vt,f),a(R,1,"createFollowTag",Wt,f),a(R,1,"updateFollowTag",Yt,f),a(R,1,"deleteFollowTag",Ut,f),a(R,1,"getFollowsGroupedByTag",Lt,f),a(R,1,"fetchFollowingsPage",Et,f),a(R,1,"fetchPageWithNextParams",Ft,f),a(R,1,"fetchFollowingsAll",It,f),a(R,1,"followUser",jt,f),a(R,1,"unFollowUser",St,f),a(R,1,"copyUsersToTag",Tt,f),a(R,1,"fetchFansPage",zt,f),a(R,1,"fetchFansPageWithNextParams",Mt,f),a(R,1,"fetchFansAll",Nt,f),a(R,1,"getStat",kt,f),a(R,1,"avoidRiskControl",vt,f),a(R,1,"modify",Ct,f),a(R,1,"blockUser",Bt,f),a(R,1,"unBlockUser",qt,f),a(R,1,"fetchBlocksPage",Ot,f),a(R,1,"fetchBlocksPageWithNextParams",At,f),a(R,1,"fetchBlocksAll",Dt,f),l(R,f);var we=class extends y{hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s.cursor.ps===0||s.cursor.max===0)return!1}return!0}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s===null)e.ps=this.options.pageSize,e.max=0,e.view_at=0,e.business=e.business??"";else{let r=s.data.cursor;e.ps=r.ps,e.max=r.max,e.view_at=r.view_at,e.business=r.business}}getList(i){return i.data.list}};var Xt,Zt,es,ts,ss,is,as,os,rs,Y,k=class extends(rs=u,os=[o()],as=[o()],is=[o()],ss=[o()],ts=[o()],es=[o()],Zt=[o()],Xt=[o()],rs){constructor(){super(...arguments);c(Y,5,this)}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/web-interface/history/cursor",new we({pageSize:20,...t}),{query:{business:e??""},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,r){return await this.buildPager(e,t,r).fetchAllPage(s)}deleteHistory(e,t){return this.save("https://api.bilibili.com/x/v2/history/delete",{data:{kid:e},...t})}clearHistory(e){return this.save("https://api.bilibili.com/x/v2/history/clear",{...e})}setHistoryShadow(e,t){return this.save("https://api.bilibili.com/x/v2/history/shadow/set",{data:{switch:e},...t})}getHistoryShadow(e){return this.get("https://api.bilibili.com/x/v2/history/shadow",{...e})}report(e,t){return this.save("https://api.bilibili.com/x/v2/history/report",{data:{...e,platform:"web"},...t})}};Y=m(rs),a(Y,1,"fetchPage",os,k),a(Y,1,"fetchPageWithNextParams",as,k),a(Y,1,"fetchAll",is,k),a(Y,1,"deleteHistory",ss,k),a(Y,1,"clearHistory",ts,k),a(Y,1,"setHistoryShadow",es,k),a(Y,1,"getHistoryShadow",Zt,k),a(Y,1,"report",Xt,k),l(Y,k);var ns,ps,us,ls,ms,cs,ds,gs,fs,ys,Rs,N,A=class extends(Rs=u,ys=[o()],fs=[o()],gs=[o()],ds=[o()],cs=[o()],ms=[o()],ls=[o()],us=[o()],ps=[o()],ns=[o()],Rs){constructor(){super(...arguments);c(N,5,this)}getSettings(e){return this.get("https://api.vc.bilibili.com/link_setting/v1/link_setting/get",{query:{msg_notify:1,show_unfollowed_msg:1,build:0,mobi_app:"web"},...e})}updateSettings(e,t){return this.save("https://api.vc.bilibili.com/link_setting/v1/link_setting/set",{data:{...e,build:0,mobi_app:"web"},...t})}getBlockWords(e){return this.get("https://api.vc.bilibili.com/x/im/link_setting/get_block_words",{query:{build:0,mobi_app:"web"},...e})}addBlockWord(e,t){return this.save("https://api.vc.bilibili.com/x/im/link_setting/add_block_word",{data:{content:e,build:0,mobi_app:"web"},...t})}delBlockWord(e,t){return this.save("https://api.vc.bilibili.com/x/im/link_setting/del_block_word",{data:{content:e,build:0,mobi_app:"web"},...t})}getAutoReplyRules(e,t){return this.get("https://api.vc.bilibili.com/x/im/auto_reply/get_reply_text",{query:{"type[]":e,build:0,mobi_app:"web"},...t})}setAutoReplyRule(e,t){return this.save("https://api.vc.bilibili.com/x/im/auto_reply/set_reply_text",{data:{build:0,mobi_app:"web",...e},...t})}delAutoReplyRule(e,t){return this.save("https://api.vc.bilibili.com/x/im/auto_reply/del_reply_text",{data:{id:e,build:0,mobi_app:"web"},...t})}getSystemSettings(e){return this.get("https://api.vc.bilibili.com/link_setting/v1/link_setting/get_sys_setting",{query:{build:0,mobi_app:"web"},...e})}canShowCreateGroupIcon(e){return this.get("https://api.vc.bilibili.com/link_group/v1/member/show_create_group_icon",{query:{build:0,mobi_app:"web"},...e})}};N=m(Rs),a(N,1,"getSettings",ys,A),a(N,1,"updateSettings",fs,A),a(N,1,"getBlockWords",gs,A),a(N,1,"addBlockWord",ds,A),a(N,1,"delBlockWord",cs,A),a(N,1,"getAutoReplyRules",ms,A),a(N,1,"setAutoReplyRule",ls,A),a(N,1,"delAutoReplyRule",us,A),a(N,1,"getSystemSettings",ps,A),a(N,1,"canShowCreateGroupIcon",ns,A),l(N,A);var De=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){return!(t!==null&&(t.data==null||t.data.cursor.is_end))}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let r=s.data.cursor;e.id=r.id,e.reply_time=r.time}}getList(i){return i.data.items}};var Ae=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){return!(t!==null&&(t.data==null||t.data.cursor.is_end))}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let r=s.data.cursor;e.id=r.id,e.at_time=r.time}}getList(i){return i.data.items}};var Oe=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){return!(t!==null&&(t.data==null||t.data.total.cursor.is_end))}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let r=s.data.total.cursor;e.id=r.id,e.like_time=r.time}}getList(i){return i.data.total.items}};import{isEmptyArr as so}from"@ybgnb/utils";var qe=class extends y{constructor(i){super({pageSize:17,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s==null||so(s))return!1}return!0}parsePageNum(i){}updateNextPageParams(i,e,t,s){t!=null&&t.length>0&&(e.cursor=t[t.length-1].cursor)}getList(i){return i.data}};var hs,bs,Ps,xs,_s,ws,Ds,As,Os,qs,Bs,Cs,vs,ks,Ns,Ms,zs,Ts,Ss,js,x,h=class extends(js=u,Ss=[o()],Ts=[o()],zs=[o()],Ms=[o()],Ns=[o()],ks=[o()],vs=[o()],Cs=[o()],Bs=[o()],qs=[o()],Os=[o()],As=[o()],Ds=[o()],ws=[o()],_s=[o()],xs=[o()],Ps=[o()],bs=[o()],hs=[o()],js){constructor(){super(...arguments);c(x,5,this)}getUnreadCount(e){return this.get("https://api.vc.bilibili.com/x/im/web/msgfeed/unread",{query:{build:0,mobi_app:"web"},...e})}delMessage(e,t,s){return this.save("https://api.bilibili.com/x/msgfeed/del",{data:{tp:t,id:e,build:0,mobi_app:"web",platform:"web"},...s})}buildBasePager(e,t,s){return this.createPager(`https://api.bilibili.com/x/msgfeed/${e}`,t,{query:{platform:"web",build:0,mobi_app:"web",web_location:"333.40164"},...s})}buildReplyPager(e,t){return this.buildBasePager("reply",new De(e),t)}buildAtPager(e,t){return this.buildBasePager("at",new Ae(e),t)}buildLikePager(e,t){return this.buildBasePager("like",new Oe(e),t)}async fetchReplyPage(e,t){return await this.buildReplyPager(e,t).fetchNext()}async fetchReplyPageWithNextParams(e,t){return await this.buildReplyPager(e,t).fetchPageWithNextParams()}async fetchReplyAll(e,t,s){return await this.buildReplyPager(e,s).fetchAllPage(t)}delReplyMessage(e,t){return this.delMessage(e,1,t)}async fetchAtPage(e,t){return await this.buildAtPager(e,t).fetchNext()}async fetchAtPageWithNextParams(e,t){return await this.buildAtPager(e,t).fetchPageWithNextParams()}async fetchAtAll(e,t,s){return await this.buildAtPager(e,s).fetchAllPage(t)}delAtMessage(e,t){return this.delMessage(e,2,t)}async fetchLikePage(e,t){return await this.buildLikePager(e,t).fetchNext()}async fetchLikePageWithNextParams(e,t){return await this.buildLikePager(e,t).fetchPageWithNextParams()}async fetchLikeAll(e,t,s){return await this.buildLikePager(e,s).fetchAllPage(t)}setLikeMsgState(e,t,s){return this.save("https://api.bilibili.com/x/msgfeed/notice",{data:{tp:0,id:e,notice_state:t,build:0,mobi_app:"web",platform:"web"},...s})}delLikeMessage(e,t){return this.delMessage(e,0,t)}buildSystemPager(e,t){return this.createPager("https://message.bilibili.com/x/sys-msg/query_notify_list",new qe(e),{query:{page_size:20,build:0,platform:"web",mobi_app:"web",data_type:"web",has_up:"1",source_platform:"web",web_location:"333.40164"},...t})}async fetchSystemPage(e,t){return await this.buildSystemPager(e,t).fetchNext()}async fetchSystemPageWithNextParams(e,t){return await this.buildSystemPager(e,t).fetchPageWithNextParams()}async fetchSystemAll(e,t,s){return await this.buildSystemPager(e,s).fetchAllPage(t)}delSysMessages(e,t){return this.save("https://message.bilibili.com/x/sys-msg/del_notify_list",{query:{build:0,mobi_app:"web",csrf:this.clientConfig.context?.userCookie.bili_jct??""},data:JSON.stringify({station_ids:e.filter(s=>s.is_station===1).map(s=>s.id),ids:e.filter(s=>s.is_station!==1).map(s=>s.id),type:4,build:0,mobi_app:"web"}),...t})}};x=m(js),a(x,1,"getUnreadCount",Ss,h),a(x,1,"delMessage",Ts,h),a(x,1,"fetchReplyPage",zs,h),a(x,1,"fetchReplyPageWithNextParams",Ms,h),a(x,1,"fetchReplyAll",Ns,h),a(x,1,"delReplyMessage",ks,h),a(x,1,"fetchAtPage",vs,h),a(x,1,"fetchAtPageWithNextParams",Cs,h),a(x,1,"fetchAtAll",Bs,h),a(x,1,"delAtMessage",qs,h),a(x,1,"fetchLikePage",Os,h),a(x,1,"fetchLikePageWithNextParams",As,h),a(x,1,"fetchLikeAll",Ds,h),a(x,1,"setLikeMsgState",ws,h),a(x,1,"delLikeMessage",_s,h),a(x,1,"fetchSystemPage",xs,h),a(x,1,"fetchSystemPageWithNextParams",Ps,h),a(x,1,"fetchSystemAll",bs,h),a(x,1,"delSysMessages",hs,h),l(x,h);var Be=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s.has_more===0||s.session_list==null||s.session_list.length===0)return!1}return!0}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let r=s.data.session_list;r!=null&&(e.end_ts=r[r.length-1].session_ts)}}getList(i){return i.data.session_list}};var Is,Fs,Es,Ls,Us,Ys,Ws,Vs,V,M=class extends(Vs=u,Ws=[o()],Ys=[o()],Us=[o()],Ls=[o()],Es=[o()],Fs=[o()],Is=[o()],Vs){constructor(){super(...arguments);c(V,5,this)}getUnreadCount(e){return this.get("https://api.vc.bilibili.com/session_svr/v1/session_svr/single_unread",{query:{build:0,mobi_app:"web"},...e})}getMyGroupUnreadCount(e){return this.get("https://api.vc.bilibili.com/session_svr/v1/session_svr/my_group_unread",{query:{build:0,mobi_app:"web"},...e})}buildPager(e,t,s){let r=e?.session_type??1;return this.createPager("https://api.vc.bilibili.com/session_svr/v1/session_svr/get_sessions",new Be(t),{query:{...e,session_type:r,group_fold:r===1?"2":"1",size:r!==1?1:void 0,unfollow_fold:"0",sort_rule:"1",platform:"web",build:0,mobi_app:"web",web_location:"333.40164"},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,r){return await this.buildPager(e,t,r).fetchAllPage(s)}async setSessionRead(e,t){await this.save("https://api.vc.bilibili.com/session_svr/v1/session_svr/update_ack",{data:{talker_id:e.talker_id,session_type:e.session_type,ack_seqno:e.ack_seqno,build:0,mobi_app:"web"},...t})}async delSession(e,t){await this.save("https://api.vc.bilibili.com/session_svr/v1/session_svr/remove_session",{data:{talker_id:e.talker_id,session_type:e.session_type,build:0,mobi_app:"web"},...t})}};V=m(Vs),a(V,1,"getUnreadCount",Ws,M),a(V,1,"getMyGroupUnreadCount",Ys,M),a(V,1,"fetchPage",Us,M),a(V,1,"fetchPageWithNextParams",Ls,M),a(V,1,"fetchAll",Es,M),a(V,1,"setSessionRead",Fs,M),a(V,1,"delSession",Is,M),l(V,M);var Ce=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s.count<=e.length||s.list.length===0)return!1}return!0}parsePageNum(i){if(i)return i.pn}updateNextPageParams(i,e,t,s){e.ps=this.options.pageSize,e.pn=i}getList(i){return i.data.list}};var $s,Qs,Hs,Ks,Gs,Js,Xs,Zs,ei,ti,I,C=class extends(ti=u,ei=[o()],Zs=[o()],Xs=[o()],Js=[o()],Gs=[o()],Ks=[o()],Hs=[o()],Qs=[o()],$s=[o()],ti){constructor(){super(...arguments);c(I,5,this)}buildPager(e,t){return this.createPager("https://api.bilibili.com/x/v2/history/toview/web",new Ce(e),{query:{viewed:0,asc:!1,key:"",need_split:!0,build:0,platform:"web",mobi_app:"web"},...t})}async fetchPage(e,t){return await this.buildPager(e,t).fetchNext()}async fetchPageWithNextParams(e,t){return await this.buildPager(e,t).fetchPageWithNextParams()}async fetchAll(e,t,s){return await this.buildPager(e,s).fetchAllPage(t)}async addToView(e,t){await this.save("https://api.bilibili.com/x/v2/history/toview/add",{data:{aid:e},...t})}async addAllToView(e,t){await this.save("https://space.bilibili.com/ajax/channel/addAllToView",{data:{...typeof e=="string"?{bvid:e}:{aid:e}},...t})}async delToView(e,t){await this.save("https://api.bilibili.com/x/v2/history/toview/v2/dels",{data:{resources:e.join(",")},...t})}async clearToView(e,t){await this.save("https://api.bilibili.com/x/v2/history/toview/clear",{data:{clean_type:e},...t})}async moveFavFolder(e,t){await this.save("https://api.bilibili.com/x/v2/history/toview/move",{data:{resources:e.join(","),tar_media_id:t}})}async getTotal(e){let t=await this.get("https://api.bilibili.com/x/v3/fav/folder/list4navigate?web_location=333.1007",e);try{return t[1].mediaListResponse.count}catch{return}}};I=m(ti),a(I,1,"fetchPage",ei,C),a(I,1,"fetchPageWithNextParams",Zs,C),a(I,1,"fetchAll",Xs,C),a(I,1,"addToView",Js,C),a(I,1,"addAllToView",Gs,C),a(I,1,"delToView",Ks,C),a(I,1,"clearToView",Hs,C),a(I,1,"moveFavFolder",Qs,C),a(I,1,"getTotal",$s,C),l(I,C);var J=class extends y{constructor(e,t="list",s="has_more",r){super(e);this.listKey=t;this.hasMoreKey=s;this.countKey=r}hasNextPage(e,t,s){return s!==null&&s.data?s.data.has_more:!0}parsePageNum(e){if(e)return e.pn}updateNextPageParams(e,t,s,r){t.ps=this.options.pageSize,t.pn=e}getList(e){return e.data[this.listKey]}getTotal(e){if(this.countKey&&e)return e.data[this.countKey]}};var si,ii,ai,oi,ri,ni,pi,ui,li,mi,ci,di,gi,fi,yi,D,_=class extends(yi=u,fi=[o()],gi=[o()],di=[o()],ci=[o()],mi=[o()],li=[o()],ui=[o()],pi=[o()],ni=[o()],ri=[o()],oi=[o()],ai=[o()],ii=[o()],si=[o()],yi){constructor(){super(...arguments);c(D,5,this)}async getFavFolders(e,t,s){return await this.get("https://api.bilibili.com/x/v3/fav/folder/created/list-all",{query:{up_mid:e??this.currUserUid,...t?{rid:t}:{},web_location:"333.1387"},...s})??{list:[],count:0}}async getFavFolderMeta(e,t){return await this.get("https://api.bilibili.com/x/v3/fav/folder/info",{query:{media_id:e},...t})}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/v3/fav/resource/list",new J({pageSize:40,...t},"medias"),{query:{...e,platform:"web",web_location:"333.1387"},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,r){let p=this.buildPager(e,t,r),d=await p.fetchAllPage(s);if(!p.lastApiResponse?.data.info)throw new w(this.clientConfig,`\u6536\u85CF\u5939[${e.media_id}]\u4E0D\u5B58\u5728`);return{info:p.lastApiResponse?.data.info,medias:d,has_more:!1}}async getFavIds(e,t){return await this.get("https://api.bilibili.com/x/v3/fav/resource/ids",{query:{media_id:e},...t})}async addFavFolder(e,t){return await this.save("https://api.bilibili.com/x/v3/fav/folder/add",{data:{...e},...t})}async updateFavFolder(e,t){let{id:s,...r}=e;return await this.save("https://api.bilibili.com/x/v3/fav/folder/edit",{data:{...r,media_id:s},...t})}async delFavFolder(e,t){await this.save("https://api.bilibili.com/x/v3/fav/folder/del",{data:{media_ids:e.join(",")},...t})}async copyFavItems(e,t,s,r,p){await this.save("https://api.bilibili.com/x/v3/fav/resource/copy",{data:{src_media_id:e,tar_media_id:t,mid:s,resources:r,platform:"web"},...p})}async moveFavItems(e,t,s,r,p){await this.save("https://api.bilibili.com/x/v3/fav/resource/move",{data:{src_media_id:e,tar_media_id:t,mid:s,resources:r,platform:"web"},...p})}async batchDelFavItems(e,t,s){await this.save("https://api.bilibili.com/x/v3/fav/resource/batch-del",{data:{media_id:e,resources:t,platform:"web"},...s})}async cleanFavItems(e,t){await this.save("https://api.bilibili.com/x/v3/fav/resource/clean",{data:{media_id:e,platform:"web"},...t})}async favVideo(e,t,s,r){return await this.save("https://api.bilibili.com/x/v3/fav/resource/deal",{data:{rid:e,add_media_ids:t.join(","),del_media_ids:s.join(","),type:"2",platform:"web",eab_x:"1",ramval:"10",ga:"1",gaia_source:"web_normal"},...r})}};D=m(yi),a(D,1,"getFavFolders",fi,_),a(D,1,"getFavFolderMeta",gi,_),a(D,1,"fetchPage",di,_),a(D,1,"fetchPageWithNextParams",ci,_),a(D,1,"fetchAll",mi,_),a(D,1,"getFavIds",li,_),a(D,1,"addFavFolder",ui,_),a(D,1,"updateFavFolder",pi,_),a(D,1,"delFavFolder",ni,_),a(D,1,"copyFavItems",ri,_),a(D,1,"moveFavItems",oi,_),a(D,1,"batchDelFavItems",ai,_),a(D,1,"cleanFavItems",ii,_),a(D,1,"favVideo",si,_),l(D,_);var Ri,hi,bi,Pi,xi,_i,se,W=class extends(_i=u,xi=[o()],Pi=[o()],bi=[o()],hi=[o()],Ri=[o()],_i){constructor(){super(...arguments);c(se,5,this)}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/v3/fav/folder/collected/list",new J({pageSize:50,...t},void 0,void 0,"count"),{query:{up_mid:e??this.currUserUid,platform:"web",web_location:"333.1387"},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,r){return await this.buildPager(e,t,r).fetchAllPage(s)}async add(e,t){await this.save("https://api.bilibili.com/x/v3/fav/season/fav",{data:{season_id:e,platform:"web"},...t})}async del(e,t){await this.save("https://api.bilibili.com/x/v3/fav/season/unfav",{data:{season_id:e,platform:"web"},...t})}};se=m(_i),a(se,1,"fetchPage",xi,W),a(se,1,"fetchPageWithNextParams",Pi,W),a(se,1,"fetchAll",bi,W),a(se,1,"add",hi,W),a(se,1,"del",Ri,W),l(se,W);var ve=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){return t!==null&&t.data?t.data.has_more:!0}parsePageNum(i){if(i)return i.page}updateNextPageParams(i,e,t,s){e.page=i,e.page_size=this.options.pageSize}getList(i){return i.data.items}};import{sleepRandom as io}from"@ybgnb/utils";var wi,Di,Ai,Oi,qi,Bi,Ci,X,F=class extends(Ci=u,Bi=[o()],qi=[o()],Oi=[o()],Ai=[o()],Di=[o()],wi=[o()],Ci){constructor(){super(...arguments);c(X,5,this)}buildPager(e,t){return this.createPager("https://api.bilibili.com/x/polymer/web-dynamic/v1/opus/feed/fav",new ve(e),{query:{platform:"web",web_location:"333.1387"},...t})}async fetchPage(e,t){return await this.buildPager(e,t).fetchNext()}async fetchPageWithNextParams(e,t){return await this.buildPager(e,t).fetchPageWithNextParams()}async fetchAll(e,t,s){return await this.buildPager(e,s).fetchAllPage(t)}async del(e,t){await this.post("https://api.bilibili.com/x/community/cosmo/interface/simple_action",{query:{csrf:this.clientConfig.context?.userCookie.bili_jct,gaia_source:"main_web"},data:JSON.stringify({"":{spmid:"444.42.0.0",from:"unknown",from_spmid:"333.1387.0.0"},action:4,entity:{object_id_str:e,type:{biz:2}}}),...t})}async addByCvId(e,t){await this.save("https://api.bilibili.com/x/article/favorites/add",{data:{id:e},...t})}async addByOpusId(e,t){let s=await this.get("https://api.bilibili.com/x/polymer/web-dynamic/v1/opus/detail",{query:{id:e},...t});await io(200,300),await this.addByCvId(s.fallback.id)}};X=m(Ci),a(X,1,"fetchPage",Bi,F),a(X,1,"fetchPageWithNextParams",qi,F),a(X,1,"fetchAll",Oi,F),a(X,1,"del",Ai,F),a(X,1,"addByCvId",Di,F),a(X,1,"addByOpusId",wi,F),l(X,F);var dn={anime:{name:"\u6211\u7684\u8FFD\u756A",type:"1"},tv:{name:"\u6211\u7684\u8FFD\u5267",type:"2"}},ue={all:0,to_watch:1,watching:2,watched:3};var vi,ki,Ni,Mi,zi,Ti,Si,Z,E=class extends(Si=u,Ti=[o()],zi=[o()],Mi=[o()],Ni=[o()],ki=[o()],vi=[o()],Si){constructor(){super(...arguments);c(Z,5,this)}buildPager(e,t,s=ue.all,r,p){return this.createPager("https://api.bilibili.com/x/space/bangumi/follow/list",new G({pageSize:24,...r}),{query:{vmid:e??this.currUserUid,type:t,follow_status:s,platform:"web",web_location:"333.1387"},...p})}async fetchPage(e,t,s=ue.all,r,p){return await this.buildPager(e,t,s,r,p).fetchNext()}async fetchPageWithNextParams(e,t,s=ue.all,r,p){return await this.buildPager(e,t,s,r,p).fetchPageWithNextParams()}async fetchAll(e,t,s=ue.all,r,p,d){return await this.buildPager(e,t,s,r,d).fetchAllPage(p)}async fetchMyAll(e,t=ue.all,s,r,p){return this.fetchAll(this.currUserUid,e,t,s,r,p)}async add(e,t){await this.save("https://api.bilibili.com/pgc/web/follow/add",{data:{season_id:e,platform:"web"},...t})}async del(e,t){await this.save("https://api.bilibili.com/pgc/web/follow/del",{data:{season_id:e,platform:"web"},...t})}};Z=m(Si),a(Z,1,"fetchPage",Ti,E),a(Z,1,"fetchPageWithNextParams",zi,E),a(Z,1,"fetchAll",Mi,E),a(Z,1,"fetchMyAll",Ni,E),a(Z,1,"add",ki,E),a(Z,1,"del",vi,E),l(Z,E);import{isEmptyArr as ao}from"@ybgnb/utils";var ke=class extends y{constructor(i){super({pageSize:40,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data,r=s.page;if(ao(s.list.vlist)||r.count<=e.length||r.count<=r.pn*r.ps)return!1}return!0}parsePageNum(i){if(i)return i.pn}updateNextPageParams(i,e,t,s){e.ps=this.options.pageSize,e.pn=i}getList(i){return i.data.list.vlist}};var ji,Ii,Fi,Ei,Re,ee=class extends(Ei=u,Fi=[o()],Ii=[o()],ji=[o()],Ei){constructor(){super(...arguments);c(Re,5,this)}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/space/wbi/arc/search",new ke(t),{query:{...e,platform:"web"},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,r){let p=this.buildPager(e,t,r);return await p.fetchAllPage(s),p.lastApiResponse.data.list.vlist=p.list,p.lastApiResponse.data}};Re=m(Ei),a(Re,1,"fetchPage",Fi,ee),a(Re,1,"fetchPageWithNextParams",Ii,ee),a(Re,1,"fetchAll",ji,ee),l(Re,ee);var Li,Ui,Yi,Wi,Vi,le,L=class extends(Vi=u,Wi=[o()],Yi=[o()],Ui=[o()],Li=[o()],Vi){constructor(){super(...arguments);c(le,5,this)}getOnlineCount(e,t){return this.get("https://api.bilibili.com/x/player/online/total",{query:{...this.resolveVideoId(e),cid:e.cid},...t})}getParts(e,t){return this.get("https://api.bilibili.com/x/player/pagelist",{query:{...this.resolveVideoId(e)},...t})}async getOwnParts(e,t){let s=await this.get("https://member.bilibili.com/x/vupre/web/archive/view",{query:{topic_grey:"1",bvid:e},...t});return s?.videos&&Array.isArray(s.videos)?s.videos:[]}getInfo(e,t){return this.get("https://api.bilibili.com/x/web-interface/wbi/view",{query:{...this.resolveVideoId(e)},...t})}};le=m(Vi),a(le,1,"getOnlineCount",Wi,L),a(le,1,"getParts",Yi,L),a(le,1,"getOwnParts",Ui,L),a(le,1,"getInfo",Li,L),l(le,L);var Ne=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s.has_more!==void 0)return s.has_more}return!0}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let r=s.data;e.offset=r.offset}}getList(i){return i.data.items}};var $i,Qi,Hi,Ki,Gi,me,$=class extends(Gi=u,Ki=[o()],Hi=[o()],Qi=[o()],$i=[o()],Gi){constructor(){super(...arguments);c(me,5,this)}buildDynamicPager(e,t,s){return this.createPager("https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all",new Ne(t),{query:{...e,platform:"web",build:0,mobi_app:"web",web_location:"333.1365"},...s})}async fetchDynamicPage(e,t,s){return await this.buildDynamicPager(e,t,s).fetchNext()}async fetchDynamicPageWithNextParams(e,t,s){return await this.buildDynamicPager(e,t,s).fetchPageWithNextParams()}async fetchDynamicAll(e,t,s,r){return await this.buildDynamicPager(e,t,r).fetchAllPage(s)}async newUpdatesCount(e,t){return(await this.get("https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all/update",{query:{...e,web_location:"333.1365"},...t})).update_num}};me=m(Gi),a(me,1,"fetchDynamicPage",Ki,$),a(me,1,"fetchDynamicPageWithNextParams",Hi,$),a(me,1,"fetchDynamicAll",Qi,$),a(me,1,"newUpdatesCount",$i,$),l(me,$);var Ji,Xi,Zi,ea,ta,sa,ia,aa,Q,z=class extends(aa=u,ia=[o()],sa=[o()],ta=[o()],ea=[o()],Zi=[o()],Xi=[o()],Ji=[o()],aa){constructor(){super(...arguments);c(Q,5,this);this._videoInfoService=null}get videoInfoService(){return this._videoInfoService||(this._videoInfoService=new L(this.api)),this._videoInfoService}getRelation(e,t){return this.get("https://api.bilibili.com/x/web-interface/archive/relation",{query:{...this.resolveVideoId(e)},returnFormat:"ApiResponse",ignoreBusinessError:!0,...t})}like(e,t){return this.save("https://api.bilibili.com/x/web-interface/archive/like",{data:{...this.resolveVideoId(e),like:e.like?"1":"2"},...t})}async hasLike(e,t){return await this.get("https://api.bilibili.com/x/web-interface/archive/has/like",{query:{...this.resolveVideoId(e)},...t})===1}dislike(e,t){return this.save("https://app.biliapi.net/x/v2/view/dislike",{data:{aid:e.avid,dislike:e.dislike?"0":"1"},...t})}async coin(e,t){let s=e.bvid;return s||(s=(await this.videoInfoService.getInfo(e)).bvid),this.save("https://api.bilibili.com/x/web-interface/coin/add",{data:{bvid:s,multiply:e.multiply,select_like:e.select_like??0,cross_domain:!0,from_spmid:"333.337.search-card.all.click",spmid:"333.788.0.0",statistics:'{"appId":100,"platform":5}',eab_x:2,ramval:0,source:"web_normal",ga:1},returnFormat:"ApiResponse",ignoreBusinessError:!0,...t,referer:`https://www.bilibili.com/video/${s}/?spm_id_from=333.1391.0.0`})}triple(e,t){return this.save("https://api.bilibili.com/x/web-interface/archive/like/triple",{data:{...this.resolveVideoId(e)},...t})}share(e,t){return this.save("https://api.bilibili.com/x/web-interface/share/add",{data:{...this.resolveVideoId(e),eab_x:1,ramval:316,source:"web_normal",ga:1},...t})}};Q=m(aa),a(Q,1,"getRelation",ia,z),a(Q,1,"like",sa,z),a(Q,1,"hasLike",ta,z),a(Q,1,"dislike",ea,z),a(Q,1,"coin",Zi,z),a(Q,1,"triple",Xi,z),a(Q,1,"share",Ji,z),l(Q,z);var oa,ra,Ge,ce=class extends(ra=u,oa=[o()],ra){constructor(){super(...arguments);c(Ge,5,this)}heartbeat(e,t,s){let r={params:{},body:{}},p=(q,b,P)=>{r.body[q]=r.params[P||"w"+q]=t[q]??e[P||"w"+q]??b};p("start_ts",Math.floor(Date.now()/1e3)),p("mid",this.currUserUid),p("aid",0),p("dt",2),p("realtime",0),p("played_time",0,"w_playedtime"),p("real_played_time",0),p("video_duration",180),p("last_play_progress_time",0);let d="https://www.bilibili.com/?spm_id_from=333.1365.0.0";return this.save("https://api.bilibili.com/x/click-interface/web/heartbeat",{query:{...r.params,web_location:1315873,...e},data:{quality:80,type:3,outer:0,statistics:'{"appId":100,"platform":5,"abtest":"","version":""}',max_play_progress_time:r.body.last_play_progress_time+r.body.played_time,refer_url:d,...r.body,mobi_app:"web",device:"web",platform:"web",cur_language_vt:"{}",perfer_type:"{}",play_mode:"1",spmid:"333.788.0.0",from_spmid:"333.1007.tianma.1-2-2.click",session:crypto.randomUUID().replace(/-/g,""),extra:'{"player_version":"4.8.36","play_method":3,"play_volume":1,"auto_play":0}',...t},init:{headers:{referer:d}},...s})}};Ge=m(ra),a(Ge,1,"heartbeat",oa,ce),l(Ge,ce);var na,pa,ua,Me,ie=class extends(ua=u,pa=[o()],na=[o()],ua){constructor(){super(...arguments);c(Me,5,this)}getDailyTaskStatus(e){return this.get("https://api.bilibili.com/x/member/web/exp/reward",e)}getCoinTodayExp(e){return this.get("https://api.bilibili.com/x/web-interface/coin/today/exp",e)}};Me=m(ua),a(Me,1,"getDailyTaskStatus",pa,ie),a(Me,1,"getCoinTodayExp",na,ie),l(Me,ie);var ze=class extends J{constructor(e,t="list",s){super(e,t);this.hasMoreKey=s}hasNextPage(e,t,s){return s!==null&&s.data?s.data[this.hasMoreKey]:!0}};var la,ma,ca,da,ga,de,H=class extends(ga=u,da=[o()],ca=[o()],ma=[o()],la=[o()],ga){constructor(){super(...arguments);c(de,5,this)}buildPopularPager(e,t){return this.createPager("https://api.bilibili.com/x/web-interface/popular",new ze({pageSize:20,...e},"list","no_more"),{query:{},...t})}async fetchPopularPage(e,t){return await this.buildPopularPager(e,t).fetchNext()}async fetchPageWithNextParams(e,t){return await this.buildPopularPager(e,t).fetchPageWithNextParams()}getPopularSeriesList(e){return this.get("https://api.bilibili.com/x/web-interface/popular/series/list",{...e})}getPopularSeriesInfo(e,t){return this.get("https://api.bilibili.com/x/web-interface/popular/series/one",{query:{number:e},...t})}};de=m(ga),a(de,1,"fetchPopularPage",da,H),a(de,1,"fetchPageWithNextParams",ca,H),a(de,1,"getPopularSeriesList",ma,H),a(de,1,"getPopularSeriesInfo",la,H),l(de,H);var fa,ya,Ra,Te,ae=class extends(Ra=u,ya=[o()],fa=[o()],Ra){constructor(){super(...arguments);c(Te,5,this)}getNavNum(e,t){return this.get("https://api.bilibili.com/x/space/navnum",{query:{mid:e},...t})}getFavNum(e,t){return this.get("https://api.bilibili.com/x/space/fav/nav",{query:{mid:e},...t})}};Te=m(Ra),a(Te,1,"getNavNum",ya,ae),a(Te,1,"getFavNum",fa,ae),l(Te,ae);var ha,ba,Pa,Se,oe=class extends(Pa=u,ba=[o()],ha=[o()],Pa){constructor(){super(...arguments);c(Se,5,this)}getSpaceSettings(e){return this.get("https://api.bilibili.com/x/space/setting",{query:{web_location:"333.1387",mid:this.currUserUid},...e})}updatePrivacy(e,t){let s=Object.keys(e)[0],r=e[s];return this.save("https://api.bilibili.com/x/space/privacy/modify",{data:{field:s,value:r},...t})}};Se=m(Pa),a(Se,1,"getSpaceSettings",ba,oe),a(Se,1,"updatePrivacy",ha,oe),l(Se,oe);import{createLogger as oo}from"@ybgnb/utils";var xa=(n="info")=>({timeout:5e3,userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36",referer:"https://space.bilibili.com/10000",logLevel:n,logger:oo(n,(i,...e)=>{console[i](`[${new Date().toLocaleString()}]`,...e)}),autoMixinKey:!1}),Je={method:"GET",skipWbiSign:!1,autoCsrf:!0,logRequestParams:!0},_a={...Je,returnFormat:"ApiResponseData",ignoreBusinessError:!1};import{sleepRandom as wa}from"@ybgnb/utils";var Da,Aa,Oa,je,re=class extends(Oa=u,Aa=[o()],Da=[o()],Oa){constructor(){super(...arguments);c(je,5,this)}get userService(){return this.api.client.user}getPlayUrl(e,t){return this.get("https://api.bilibili.com/x/player/wbi/playurl",{query:{fnval:1,fourk:1,high_quality:1,gaia_source:"view-card ",...e},init:{headers:{referer:`https://www.bilibili.com/video/${e.bvid}/?spm_id_from=333.1391.0.0`}},...t})}async getBestQualityUrl(e,t){let s=await this.getPlayUrl({...e,fnval:4048,qn:129},t);if(s.quality===s.accept_quality[0])return s;let r=s.accept_quality[0];await wa(100,200);let p=await this.userService.getMyInfo(void 0,t);return await wa(100,200),p.vip.type===0&&s.accept_quality[0]>=80&&(r=80),this.getPlayUrl({...e,qn:r},t)}};je=m(Oa),a(je,1,"getPlayUrl",Aa,re),a(je,1,"getBestQualityUrl",Da,re),l(je,re);import{isEmptyArr as ro}from"@ybgnb/utils";var Ie=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data,r=s.page;if(ro(s.replies)||r.count<=e.length||r.count<=r.num*r.size)return!1}return!0}updateNextPageParams(i,e,t,s){e.ps=this.options.pageSize,e.pn=i}getList(i){return i.data.replies}parsePageNum(i){if(i?.pn)return i?.pn}};import{isEmptyArr as no}from"@ybgnb/utils";var Fe=class extends y{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data,r=s.cursor;if(no(s.replies)||r.is_end)return!1}return!0}updateNextPageParams(i,e,t,s){if(s){let r=s.data;e.pagination_str=`{"offset":"${r.cursor.pagination_reply.next_offset}"}`}}getList(i){return i.data.replies}parsePageNum(i){}};var qa,Ba,Ca,va,ka,Na,Ma,za,Ta,Sa,ja,T,O=class extends(ja=u,Sa=[o()],Ta=[o()],za=[o()],Ma=[o()],Na=[o()],ka=[o()],va=[o()],Ca=[o()],Ba=[o()],qa=[o()],ja){constructor(){super(...arguments);c(T,5,this)}buildSubReplyPager(e,t,s){return this.createPager("https://api.bilibili.com/x/v2/reply/reply",new Ie({...t}),{query:{...e,platform:"web",web_location:"333.1369"},...s,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async fetchSubReplyPage(e,t,s){return await this.buildSubReplyPager(e,t,s).fetchNext()}async fetchSubPageWithNextParams(e,t,s){return await this.buildSubReplyPager(e,t,s).fetchPageWithNextParams()}async fetchSubReplyAll(e,t,s,r){return await this.buildSubReplyPager(e,t,r).fetchAllPage(s)}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/v2/reply/wbi/main",new Fe({...t}),{query:{...e,plat:1,seek_rpid:"",web_location:"1315875"},...s,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,r){return await this.buildPager(e,t,r).fetchAllPage(s)}async del(e,t){await this.save("https://api.bilibili.com/x/v2/reply/del",{data:{...e},...t,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async like(e,t){await this.save("https://api.bilibili.com/x/v2/reply/action",{data:{action:"1",...e,statistics:'{"appId":100,"platform":5}'},...t,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async hate(e,t){await this.save("https://api.bilibili.com/x/v2/reply/hate",{data:{action:"1",...e,statistics:'{"appId":100,"platform":5}'},...t,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async add(e,t){return await this.save("https://api.bilibili.com/x/v2/reply/add",{data:{...e,plat:"1",at_name_to_mid:"{}",gaia_source:"main_web",statistics:'{"appId":100,"platform":5}'},...t,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}};T=m(ja),a(T,1,"fetchSubReplyPage",Sa,O),a(T,1,"fetchSubPageWithNextParams",Ta,O),a(T,1,"fetchSubReplyAll",za,O),a(T,1,"fetchPage",Ma,O),a(T,1,"fetchPageWithNextParams",Na,O),a(T,1,"fetchAll",ka,O),a(T,1,"del",va,O),a(T,1,"like",Ca,O),a(T,1,"hate",Ba,O),a(T,1,"add",qa,O),l(T,O);var Ee=class{get logger(){return this.config.logger}constructor(i){this.config={...xa(i?.logLevel),...i??{}},this.api=new Ue(this),this.createPager=this.api.createPager,this.request=this.api.request,this.user=new B(this.api),this.userExp=new ie(this.api),this.relation=new f(this.api),this.history=new k(this.api),this.session=new M(this.api),this.sessionSettings=new A(this.api),this.message=new h(this.api),this.toview=new C(this.api),this.fav=new _(this.api),this.favCollection=new W(this.api),this.favOpus=new F(this.api),this.followBangumi=new E(this.api),this.spaceVideo=new ee(this.api),this.spaceStatus=new ae(this.api),this.spaceSettings=new oe(this.api),this.dynamic=new $(this.api),this.videoInfo=new L(this.api),this.videoAction=new z(this.api),this.videoReport=new ce(this.api),this.videoRanking=new H(this.api),this.videoPlayer=new re(this.api),this.comment=new O(this.api),Le.setAutoRefresh(this.config.autoMixinKey)}updateRequestContext(i){this.config.context=i}};var Xe=null,Ze=()=>(Xe||(Xe=new Ee),Xe);var he,Ye=null,Ea=0,et,Ia=1440*60*1e3,La=!1,Le={get:async()=>he||(Ye||(Ye=lo().catch(()=>{Ye=null})),await Ye,he),setAutoRefresh(n){La=n}};function po(n,i){return Math.floor(n/Ia)!==Math.floor(i/Ia)}var uo=[46,47,18,2,53,8,23,32,15,50,10,31,58,3,45,35,27,43,5,49,33,9,42,19,29,28,14,39,12,38,41,13,37,48,7,16,24,55,40,61,26,17,0,1,60,51,30,4,22,25,54,21,56,59,6,63,57,62,11,36,20,34,44,52],tt=(n,i)=>{let e=n+i;return uo.map(t=>e[t]).join("").slice(0,32)},lo=async()=>{await Fa(),et||clearInterval(et),La&&(et=setInterval(()=>{po(Ea,Date.now())&&Fa()},3e5))},Fa=async()=>{try{let n=Date.now(),i=(await(await fetch("https://api.bilibili.com/x/web-interface/nav")).json()).data,e=r=>new URL(r).pathname.split("/").pop().replace(/\.[^.]+$/,""),t=e(i.wbi_img.img_url),s=e(i.wbi_img.sub_url);he=tt(t,s),Ze().logger.info(`\u521D\u59CB\u5316 imgKey=${t} subKey=${s} mixinKey=${he}`),Ea=n}catch(n){throw Ze().logger.error("\u521D\u59CB\u5316 MixinKey \u5931\u8D25",n),n}};import{encodeURLParams as st}from"@ybgnb/utils";async function Ua(n,i){let e=Math.floor(Date.now()/1e3),t=i??await Le.get();return`${st(n)}&w_rid=${mo(st({...n,wts:e})+t)}&wts=${e}`}async function Ya(n,i,e){try{return i||Object.keys(n).length===0?`${st(n)}`:e?`${await Ua(n,tt(e.imgKey,e.subKey))}`:`${await Ua(n)}`}catch{throw new Error("\u67E5\u8BE2\u53C2\u6570\u65E0\u6548")}}import{mergeQueryParams as co,parseUrl as go,sleep as fo}from"@ybgnb/utils";var We=class extends ne{constructor(e,t,s){super(e);this.list=[];this.lastApiResponse=null;this.pageStrategy=t,t.options.pageNum!==void 0?this.nextPageNum=t.options.pageNum:this.nextPageNum=1;let{baseUrl:r,searchParams:p}=go(s.url);this.requestParams=Object.assign(co(p,s.query)),this.requestOptions={...s,url:r,query:this.requestParams,returnFormat:"ApiResponse"}}mergeRequestOptions(e){this.requestParams={...this.requestParams,...e?.query},this.requestOptions={...this.requestOptions,...e,query:this.requestParams,returnFormat:"ApiResponse"}}async fetchNext(e){if(this.mergeRequestOptions(e),!this.pageStrategy.hasNextPage(this.nextPageNum,this.list,this.lastApiResponse))return null;this.pageStrategy.updateNextPageParams(this.nextPageNum,this.requestParams,this.list,this.lastApiResponse),this.lastApiResponse===null&&(this.nextPageNum===1||this.nextPageNum===this.pageStrategy.options.pageNum)&&Object.assign(this.requestParams,this.pageStrategy.options.pageParams);let t=await this.get(this.requestOptions.url,this.requestOptions);if(this.lastApiResponse=t,t.data==null)return null;this.nextPageNum++;let s=this.pageStrategy.getList(t)??[];return s.length<=0?null:(this.list.push(...s),s)}async fetchPageWithNextParams(e){return{items:await this.fetchNext(e),nextParams:this.getNextPageParams(),hasNext:this.pageStrategy.hasNextPage(this.nextPageNum,this.list,this.lastApiResponse),pageSize:this.pageStrategy.options.pageSize,total:this.pageStrategy.getTotal?.(this.lastApiResponse)??void 0}}getRequestDelay(e){return typeof e?.delay=="function"?e.delay(this.nextPageNum):typeof e?.delay=="number"?e.delay:1122}async fetchAllPage(e,t){for(this.mergeRequestOptions(t),this.nextPageNum=1,this.list=[],this.lastApiResponse=null;!this.requestOptions.signal?.aborted;){let s=await this.fetchNext(t);if(s===null||e&&await e(s,this.list)===!1)break;await fo(this.getRequestDelay(t),this.requestOptions.signal)}return this.list}getNextPageParams(){let e={};return this.pageStrategy.updateNextPageParams(this.nextPageNum,e,this.list,this.lastApiResponse),e}getPageSize(){return this.pageStrategy.options.pageSize}};import{mergeQueryParams as yo,parseUrl as Ro,createAbortError as Wa,isCanceledError as ho,getErrorMessage as bo}from"@ybgnb/utils";var Ue=class{constructor(i){this.client=i;this.logApiSuccess=(i,e,t,s)=>{if(e==="RawResponse")this.logger.info(`${i} \u8BF7\u6C42\u6210\u529F`);else{let r=s||this.isDebug?JSON.stringify(t):"";e==="ApiResponse"?this.logger.info(`${i} \u8BF7\u6C42\u6210\u529F`,r):this.logger.info(`${i} \u8BF7\u6C42\u6210\u529F`,r)}};this.logApiError=(i,e)=>{ho(e)?this.logger.info(`${i} [${bo(e)}]`):e instanceof te?this.logger.info(`${i} [http error]\uFF1A${e.message}(${e.status})`):e instanceof w?this.logger.info(`${i} ${e.message}`):this.logger.info(`${i} \u51FA\u73B0\u672A\u77E5\u9519\u8BEF`,e)};this.buildFinalUrl=async(i,e)=>{let{baseUrl:t,searchParams:s}=Ro(i.url),r=yo(s,i.query),p=await Ya(r,i.skipWbiSign,i.wbiSignKeys);return i.logRequestParams?this.logger.info(`${e} \u8BF7\u6C42\u4E2D ${p}`):this.logger.info(`${e} \u8BF7\u6C42\u4E2D...`),p&&p.length>0?`${t}?${p}`:t};this.buildRequestBody=async i=>{let e=i.data;if(e)if(typeof e=="object"){if(!(e instanceof Blob)){if(!(e instanceof URLSearchParams)){if(!(e instanceof FormData)){let t={};Object.keys(e).forEach(function(s){if(e!=null){let r=e[s];r!=null&&(t[s]=String(r))}}),e=new URLSearchParams(t)}}}}else typeof e=="string"&&(i.init={...i.init},i.init.headers={...i.init.headers,"Content-Type":"application/json"});return i.method==="POST"&&e&&i.autoCsrf&&e instanceof URLSearchParams&&e.set("csrf",this.clientConfig.context?.userCookie.bili_jct??""),e};this.buildRequestInit=async(i,e)=>{let{context:t,userAgent:s,timeout:r,referer:p}=this.clientConfig;return{signal:i?.signal?AbortSignal.any([i?.signal,AbortSignal.timeout(r)]):AbortSignal.timeout(r),method:i.method,body:e,...i?.init??{},credentials:"include",headers:{"User-Agent":s,origin:"https://t.bilibili.com",cookie:i.cookie?.cookie||t?.userCookie.cookie||"",Referer:i.referer??(typeof p=="function"?p(i.url):p),...i?.init?.headers??{}}}};this.executeRequest=async(i,e)=>{i.url=await this.buildFinalUrl(i,e);let t=await this.buildRequestBody(i);t&&this.logger.debug(`${e} \u8BF7\u6C42\u4F53`,JSON.stringify(t));let s=await this.buildRequestInit(i,t);return await(this.clientConfig.fetcher??fetch)(i.url,s)};this.request=async(i,e)=>{if(e?.signal?.aborted)throw Wa();let t={..._a,url:i,...e},s=this.buildLogPrefix(t);try{let r=await this.executeRequest(t,s);if(!r.ok)throw new te(this.clientConfig,t,r);if(t.returnFormat==="RawResponse")return this.logApiSuccess(s,"RawResponse",r,t.logResponseData),r;let p;try{p=await r.json()}catch(d){throw new te(this.clientConfig,t,r,"\u89E3\u6790\u54CD\u5E94\u6570\u636E\u9519\u8BEF",d)}if(!t.ignoreBusinessError&&p.code!==0)throw new xe(this.clientConfig,t,p);return t.returnFormat==="ApiResponse"?(this.logApiSuccess(s,"ApiResponse",p,t.logResponseData),p):(this.logApiSuccess(s,"ApiResponseData",p.data,t.logResponseData),p.data)}catch(r){throw this.logApiError(s,r),r}};this.fetchRaw=async(i,e)=>{if(e?.signal?.aborted)throw Wa();let t={...Je,url:i,...e},s=this.buildLogPrefix(t),r=t.responseType;try{let p=await this.executeRequest(t,s);if(!p.ok)throw new te(this.clientConfig,t,p);return this.logApiSuccess(s,"RawResponse",p,t.logResponseData),r==="json"?await p.json():r==="text"?await p.text():r==="blob"?await p.blob():r==="arrayBuffer"?await p.arrayBuffer():await p.formData()}catch(p){throw this.logApiError(s,p),p}};this.fetchText=async(i,e)=>this.fetchRaw(i,{...e,responseType:"text"});this.fetchBlob=async(i,e)=>this.fetchRaw(i,{...e,responseType:"blob"});this.fetchArrayBuffer=async(i,e)=>this.fetchRaw(i,{...e,responseType:"arrayBuffer"});this.fetchFormData=async(i,e)=>this.fetchRaw(i,{...e,responseType:"formData"});this.get=async(i,e)=>this.request(i,{...e,method:"GET"});this.post=async(i,e)=>this.request(i,{...e,method:"POST"});this.save=async(i,e)=>this.request(i,{...e,method:"POST",skipWbiSign:!1,autoCsrf:!0});this.createPager=(i,e,t)=>new We(this,e,{url:i,...t})}get clientConfig(){return this.client.config}get logger(){return this.clientConfig.logger}get isDebug(){return this.clientConfig.logLevel==="debug"}buildLogPrefix(i){let e=this.clientConfig.context?.userCookie.uid;return`[bili API]${e?` [${e}]`:""} ${i.method} ${new URL(i.url).pathname}`}};var Ou=".bilibili.com",qu=["SESSDATA","bili_jct","DedeUserID","DedeUserID__ckMd5","sid","buvid3","buvid4"];function Cu(n){switch(n.attr&3){case 0:return"default_public";case 1:return"default_private";case 2:return"other_public";case 3:return"other_private";default:return"default_public"}}function vu(n){let i=n.attr&3;return i===0||i===1?5e4-n.media_count:1e3-n.media_count}var Va=class extends u{};var zu={archive:{type:"archive",name:"\u7A3F\u4EF6"},pgc:{type:"pgc",name:"\u5267\u96C6"},live:{type:"live",name:"\u76F4\u64AD"},articleList:{type:"article-list",name:"\u6587\u96C6"},article:{type:"article",name:"\u4E13\u680F"}};var Su={phone:[1,3,5,7],web:[2],pad:[4,6],tv:[33],other:[0]};var Iu={DYNAMIC_TYPE_NONE:{type:"DYNAMIC_TYPE_NONE",description:"\u65E0\u6548\u52A8\u6001"},DYNAMIC_TYPE_FORWARD:{type:"DYNAMIC_TYPE_FORWARD",description:"\u52A8\u6001\u8F6C\u53D1"},DYNAMIC_TYPE_AV:{type:"DYNAMIC_TYPE_AV",description:"\u6295\u7A3F\u89C6\u9891"},DYNAMIC_TYPE_PGC:{type:"DYNAMIC_TYPE_PGC",description:"\u5267\u96C6\uFF08\u756A\u5267\u3001\u7535\u5F71\u3001\u7EAA\u5F55\u7247\uFF09"},DYNAMIC_TYPE_COURSES:{type:"DYNAMIC_TYPE_COURSES",description:""},DYNAMIC_TYPE_WORD:{type:"DYNAMIC_TYPE_WORD",description:"\u7EAF\u6587\u5B57\u52A8\u6001"},DYNAMIC_TYPE_DRAW:{type:"DYNAMIC_TYPE_DRAW",description:"\u5E26\u56FE\u52A8\u6001"},DYNAMIC_TYPE_ARTICLE:{type:"DYNAMIC_TYPE_ARTICLE",description:"\u6295\u7A3F\u4E13\u680F"},DYNAMIC_TYPE_MUSIC:{type:"DYNAMIC_TYPE_MUSIC",description:"\u97F3\u4E50"},DYNAMIC_TYPE_COMMON_SQUARE:{type:"DYNAMIC_TYPE_COMMON_SQUARE",description:"\u88C5\u626E / \u5267\u96C6\u70B9\u8BC4 / \u666E\u901A\u5206\u4EAB"},DYNAMIC_TYPE_COMMON_VERTICAL:{type:"DYNAMIC_TYPE_COMMON_VERTICAL",description:""},DYNAMIC_TYPE_LIVE:{type:"DYNAMIC_TYPE_LIVE",description:"\u76F4\u64AD\u95F4\u5206\u4EAB"},DYNAMIC_TYPE_MEDIALIST:{type:"DYNAMIC_TYPE_MEDIALIST",description:"\u6536\u85CF\u5939"},DYNAMIC_TYPE_COURSES_SEASON:{type:"DYNAMIC_TYPE_COURSES_SEASON",description:"\u8BFE\u7A0B"},DYNAMIC_TYPE_COURSES_BATCH:{type:"DYNAMIC_TYPE_COURSES_BATCH",description:""},DYNAMIC_TYPE_AD:{type:"DYNAMIC_TYPE_AD",description:""},DYNAMIC_TYPE_APPLET:{type:"DYNAMIC_TYPE_APPLET",description:""},DYNAMIC_TYPE_SUBSCRIPTION:{type:"DYNAMIC_TYPE_SUBSCRIPTION",description:""},DYNAMIC_TYPE_LIVE_RCMD:{type:"DYNAMIC_TYPE_LIVE_RCMD",description:"\u76F4\u64AD\u5F00\u64AD"},DYNAMIC_TYPE_BANNER:{type:"DYNAMIC_TYPE_BANNER",description:""},DYNAMIC_TYPE_UGC_SEASON:{type:"DYNAMIC_TYPE_UGC_SEASON",description:"\u5408\u96C6\u66F4\u65B0"},DYNAMIC_TYPE_SUBSCRIPTION_NEW:{type:"DYNAMIC_TYPE_SUBSCRIPTION_NEW",description:""}};var Eu={AUTHOR_TYPE_NONE:"",AUTHOR_TYPE_NORMAL:"\u666E\u901A\u66F4\u65B0",AUTHOR_TYPE_PGC:"\u5267\u96C6\u66F4\u65B0",AUTHOR_TYPE_UGC_SEASON:"\u5408\u96C6\u66F4\u65B0"};var Wu={reply_video:{name:"\u8BC4\u8BBA",type:"reply",id:1},reply_dynamic:{name:"\u52A8\u6001",type:"dynamic",id:11},reply_comment:{name:"\u8BC4\u8BBA",type:"reply",id:17},reply_article:{name:"\u8BC4\u8BBA",type:"reply",id:12},like_reply:{name:"\u8BC4\u8BBA",type:"reply",id:0},like_dynamic:{name:"\u52A8\u6001",type:"dynamic",id:0}};var $u={followed:1,keys:2,recv:3,voyage:5};var Hu={unknown:{code:0,name:"\u672A\u77E5\u6765\u6E90"},ios:{code:1,name:"iOS"},android:{code:2,name:"Android"},h5:{code:3,name:"H5"},pc_client:{code:4,name:"PC\u5BA2\u6237\u7AEF"},official_push_msg:{code:5,name:"\u5B98\u65B9\u63A8\u9001\u6D88\u606F"},push_notify_msg:{code:6,name:"\u63A8\u9001/\u901A\u77E5\u6D88\u606F"},web:{code:7,name:"Web"},auto_reply_followed:{code:8,name:"\u81EA\u52A8\u56DE\u590D - \u88AB\u5173\u6CE8\u56DE\u590D"},auto_reply_recv:{code:9,name:"\u81EA\u52A8\u56DE\u590D - \u6536\u5230\u6D88\u606F\u56DE\u590D"},auto_reply_keyword:{code:10,name:"\u81EA\u52A8\u56DE\u590D - \u5173\u952E\u8BCD\u56DE\u590D"},auto_reply_voyage:{code:11,name:"\u81EA\u52A8\u56DE\u590D - \u5927\u822A\u6D77\u4E0A\u8239\u56DE\u590D"},up_gift_msg:{code:12,name:"\u81EA\u52A8\u63A8\u9001 - UP\u4E3B\u8D60\u8A00"},fans_group_system:{code:13,name:"\u7C89\u4E1D\u56E2\u7CFB\u7EDF\u63D0\u793A"},system:{code:16,name:"\u7CFB\u7EDF"},mutual_follow:{code:17,name:"\u4E92\u76F8\u5173\u6CE8"},system_hint:{code:18,name:"\u7CFB\u7EDF\u63D0\u793A"},ai:{code:19,name:"AI"}};var Gu={fav_video:"\u516C\u5F00\u6211\u7684\u6536\u85CF",user_info:"\u516C\u5F00\u6211\u7684\u751F\u65E5\u3001\u4E2A\u4EBA\u6807\u7B7E",comic:"\u516C\u5F00\u6211\u7684\u8FFD\u6F2B(\u4EC5APP)",bangumi:"\u516C\u5F00\u8FFD\u756A\u8FFD\u5267",disable_show_school:"\u516C\u5F00\u5B66\u6821\u4FE1\u606F",dress_up:"\u516C\u5F00\u62E5\u6709\u7684\u7C89\u4E1D\u88C5\u626E\uFF08\u4EC5APP\uFF09",coins_video:"\u516C\u5F00\u6700\u8FD1\u6295\u5E01\u7684\u89C6\u9891",played_game:"\u516C\u5F00\u6700\u8FD1\u73A9\u8FC7\u7684\u6E38\u620F",channel:"\u6295\u7A3F\u89C6\u9891\u5217\u8868\u4E2D\u5C55\u73B0\u76F4\u64AD\u56DE\u653E",likes_video:"\u516C\u5F00\u6700\u8FD1\u70B9\u8D5E\u7684\u89C6\u9891",close_space_medal:"\u516C\u5F00\u4F69\u6234\u7684\u7C89\u4E1D\u52CB\u7AE0",lesson_video:"\u6295\u7A3F\u89C6\u9891\u5217\u8868\u4E2D\u5C55\u73B0\u8BFE\u5802\u89C6\u9891",disable_following:"\u7981\u6B62\u516C\u5F00\u6211\u7684\u5173\u6CE8\u5217\u8868",only_show_wearing:"\u52CB\u7AE0\u5899\u516C\u5F00\u663E\u793A\u6240\u6709\u7C89\u4E1D\u52CB\u7AE0",charge_video:"\u6295\u7A3F\u89C6\u9891\u5217\u8868\u4E2D\u5C55\u73B0\u5305\u6708\u5145\u7535\u4E13\u5C5E\u89C6\u9891",disable_show_fans:"\u7981\u6B62\u516C\u5F00\u6211\u7684\u7C89\u4E1D\u5217\u8868",bbq:"\u516C\u5F00\u8F7B\u89C6\u9891\uFF1F",groups:"\u5708\u5B50\uFF1F",live_playback:"\u516C\u5F00\u6211\u7684\u76F4\u64AD\u56DE\u653E\uFF1F",tags:"\u516C\u5F00\u8BA2\u9605\u6807\u7B7E\uFF1F"};var Xu={NORMAL:0,BLOCKED:1};var el={NONE:0,MONTH:1,YEAR:2},tl={NONE:0,YES:1};export{Ae as AtMsgPageStrategy,Eu as AuthorTypeMap,$u as AutoReplyTypeMap,Ou as BILIBILI_COOKIE_DOMAIN,Ue as BaseApi,y as BasePageStrategy,u as BaseService,xe as BiliApiBusinessError,Pe as BiliApiError,te as BiliApiHttpError,Ee as BiliClient,w as BiliError,zu as BusinessMap,o as CatchError,O as CommentService,Su as DeviceTypeCodeMap,Ne as DynamicPageStrategy,$ as DynamicService,Iu as DynamicTypeMap,W as FavCollectionService,ve as FavOpusPageStrategy,F as FavOpusService,_ as FavService,E as FollowBangumiService,ue as FollowBangumiStatusMap,dn as FollowBangumiTypeMap,J as HasMorePageStrategy,we as HistoryPageStrategy,k as HistoryService,Oe as LikeMsgPageStrategy,pe as ListPageStrategy,Wu as MessageBusinessMap,h as MessageService,Hu as MsgSourceMap,We as PageApi,Gu as PrivacySettingsMap,K as RelationActMap,Fo as RelationAttributeMap,f as RelationService,ye as RelationSourceMap,De as ReplyMsgPageStrategy,Fe as ReplyPageStrategy,G as ResponseWithTotalStrategy,Be as SessionPageStrategy,M as SessionService,A as SessionSettingsService,Xu as SilenceStatusMap,oe as SpaceSettingsService,ae as SpaceStatusService,ke as SpaceVPageStrategy,ee as SpaceVideoService,ze as SpecifyHasMorePageStrategy,Ie as SubReplyPageStrategy,qe as SystemMsgPageStrategy,Ce as ToViewPageStrategy,C as ToViewService,qu as USER_COOKIE_NAMES,ie as UserExpService,B as UserService,z as VideoActionService,L as VideoInfoService,re as VideoPlayerService,H as VideoRankingService,ce as VideoReportService,Va as VideoUploadService,tl as VipStatusMap,el as VipTypeMap,ne as WithApi,_a as defaultApiRequestOptions,Je as defaultBaseRequestOptions,tt as generateMixinKey,Ze as getCommonBiliClient,xa as getDefaultClientConfig,vu as getFavFolderRemaining,Cu as getFavFolderType,Ya as handleUrlParams,mt as loginUserWithQRCode,Le as mixinKeyStore,ct as parseUserCookie,Ua as wbiSign};
|
|
1
|
+
var Ha=Object.create;var He=Object.defineProperty;var $a=Object.getOwnPropertyDescriptor;var ct=(n,i)=>(i=Symbol[n])?i:Symbol.for("Symbol."+n),he=n=>{throw TypeError(n)};var eo=(n,i,e)=>i in n?He(n,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[i]=e;var lt=(n,i)=>He(n,"name",{value:i,configurable:!0});var g=n=>[,,,Ha(n?.[ct("metadata")]??null)],gt=["class","method","getter","setter","accessor","field","value","get","set"],Re=n=>n!==void 0&&typeof n!="function"?he("Function expected"):n,to=(n,i,e,t,s)=>({kind:gt[n],name:i,metadata:t,addInitializer:a=>e._?he("Already initialized"):s.push(Re(a||null))}),c=(n,i)=>eo(i,ct("metadata"),n[3]),d=(n,i,e,t)=>{for(var s=0,a=n[i>>1],p=a&&a.length;s<p;s++)i&1?a[s].call(e):t=a[s].call(e,t);return t},o=(n,i,e,t,s,a)=>{var p,b,w,x,D,y=i&7,De=!!(i&8),j=!!(i&16),Ke=y>3?n.length+1:y?De?1:2:0,nt=gt[y+5],pt=y>3&&(n[Ke-1]=[]),Qa=n[Ke]||(n[Ke]=[]),Z=y&&(!j&&!De&&(s=s.prototype),y<5&&(y>3||!j)&&$a(y<4?s:{get[e](){return mt(this,a)},set[e](v){return ut(this,a,v)}},e));y?j&&y<4&<(a,(y>2?"set ":y>1?"get ":"")+e):lt(s,e);for(var Te=t.length-1;Te>=0;Te--)x=to(y,e,w={},n[3],Qa),y&&(x.static=De,x.private=j,D=x.access={has:j?v=>so(s,v):v=>e in v},y^3&&(D.get=j?v=>(y^1?mt:io)(v,s,y^4?a:Z.get):v=>v[e]),y>2&&(D.set=j?(v,Qe)=>ut(v,s,Qe,y^4?a:Z.set):(v,Qe)=>v[e]=Qe)),b=(0,t[Te])(y?y<4?j?a:Z[nt]:y>4?void 0:{get:Z.get,set:Z.set}:s,x),w._=1,y^4||b===void 0?Re(b)&&(y>4?pt.unshift(b):y?j?a=b:Z[nt]=b:s=b):typeof b!="object"||b===null?he("Object expected"):(Re(p=b.get)&&(Z.get=p),Re(p=b.set)&&(Z.set=p),Re(p=b.init)&&pt.unshift(p));return y||c(n,s),Z&&He(s,e,Z),j?y^4?a:Z:s};var $e=(n,i,e)=>i.has(n)||he("Cannot "+e),so=(n,i)=>Object(i)!==i?he('Cannot use the "in" operator on this value'):n.has(i),mt=(n,i,e)=>($e(n,i,"read from private field"),e?e.call(n):i.get(n));var ut=(n,i,e,t)=>($e(n,i,"write to private field"),t?t.call(n,e):i.set(n,e),e),io=(n,i,e)=>($e(n,i,"access private method"),e);import Vo from"md5";function r(){return function(n,i){let e=String(i.name);return function(...t){let s=this.constructor.name;try{return n.call(this,...t)}catch(a){if(typeof this.handleError=="function")this.handleError(a,s,e);else throw console.error(`${s}.${e} \u672A\u77E5\u5F02\u5E38`,a),a}}}}var S=class extends Error{constructor(i,e,t){super(e||"\u64CD\u4F5C\u5931\u8D25"),this.name="BiliError",this.rawError=t instanceof Error?t:new Error(String(t));let{timeout:s,userAgent:a,context:p}=i;this.clientConfig={timeout:s,userAgent:a,context:p?.userCookie?{userCookie:p?.userCookie}:void 0}}},Pe=class extends S{constructor(i,e,t,s){super(i,t,s),this.name="BiliApiError";let{url:a,method:p,query:b,data:w,skipWbiSign:x,autoCsrf:D}=e;this.requestOptions={url:a,method:p,query:b,data:w,skipWbiSign:x,autoCsrf:D}}},ae=class extends Pe{constructor(e,t,s,a,p){super(e,t,a||s.statusText||`HTTP ${s.status}`,p);this.status=0;this.name="BiliApiHttpError",this.status=s.status}},Be=class extends Pe{constructor(i,e,t,s,a){super(i,e,s||t.message,a),this.name="BiliApiBusinessError",this.responseCode=t.code??-1,this.responseData=t.data}};import{createAbortError as dt,isCanceledError as ao}from"@ybgnb/utils";async function bt(n,i,e){let t={updateRequestContext:!0,autoRefresh:!0,pollIntervalMs:1233,...e},s=AbortSignal.timeout(180*1e3),a=t.signal?AbortSignal.any([t.signal,s]):s,p=x=>new Promise(D=>setTimeout(D,x)),b=x=>{try{i.onStatusChange(x)}catch(D){n.logger.error("[QRCodeLogin] onStatusChange callback error:",D)}},w=async x=>{try{await i.onQRCodeReceived(x)}catch(D){n.logger.error("[QRCodeLogin] onQRCodeReceived callback error:",D)}};try{for(;!a.aborted;){b("\u6B63\u5728\u83B7\u53D6\u767B\u5F55\u4E8C\u7EF4\u7801...");let x=await n.getLoginQRCode(e);if(!x?.url||!x?.qrcode_key)throw new Error("\u672A\u80FD\u83B7\u53D6\u6709\u6548\u7684\u4E8C\u7EF4\u7801\u6570\u636E");await w(x.url),b("\u8BF7\u4F7F\u7528\u624B\u673A App \u626B\u7801\u767B\u5F55..."),await p(2e3);let D=!1;for(;!a.aborted&&!D;){let y=await n.getQRCodeLoginResult(x.qrcode_key,e);switch(b(y.message),y.code){case 0:return b("\u626B\u7801\u6210\u529F\uFF0C\u6B63\u5728\u540C\u6B65\u7528\u6237\u4FE1\u606F..."),i.cookieProvider&&(await p(1e3),y.setCookie=await i.cookieProvider()),await n.initLoginSession(y.setCookie,t.updateRequestContext,e);case 86038:if(t.autoRefresh)b("\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548\uFF0C\u6B63\u5728\u81EA\u52A8\u5237\u65B0..."),D=!0;else throw new S(n.clientConfig,"\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548");break;default:await p(t.pollIntervalMs);break}}}}catch(x){if(t.signal?.aborted)throw b("\u53D6\u6D88\u767B\u5F55"),dt("\u53D6\u6D88\u767B\u5F55");if(a.aborted||ao(x)){let D="\u767B\u5F55\u8D85\u65F6";throw b(D),new Error(D)}throw x}throw a.aborted?dt():new Error("\u767B\u5F55\u6D41\u7A0B\u5F02\u5E38\u7EC8\u6B62")}function yt(n){if(!n)throw new Error("setCookie \u4E3A\u7A7A");let i=[],e,t;for(let s of n)if(s){let a=s.slice(0,s.indexOf(";")+1);i.push(a),a.startsWith("bili_jct=")&&(e=a.slice(9,-1)),a.startsWith("DedeUserID=")&&(t=a.slice(11,-1))}if(!e||!t)throw new Error("setCookie \u89E3\u6790\u9519\u8BEF\uFF0C\u4E0D\u5B58\u5728 bili_jct/uid");return{uid:Number(t),cookie:i.join(" "),bili_jct:e}}var me=class{constructor(i){this.api=i}get clientConfig(){return this.api.clientConfig}get logger(){return this.api.logger}get request(){return this.api.request}get get(){return this.api.get}get post(){return this.api.post}get save(){return this.api.save}get currUserUid(){let i=this.api.clientConfig.context?.userCookie.uid;if(i===void 0)throw new S(this.clientConfig,"\u7528\u6237\u672A\u767B\u5F55");return i}};import{getErrorMessage as Rt}from"@ybgnb/utils";var u=class extends me{constructor(i){super(i),this.createPager=i.createPager}throwError(i,e){throw new S(this.clientConfig,Rt(i),e)}handleError(i,e,t){if(i instanceof S)this.logger.error(`${e}.${t} \u51FA\u73B0\u9519\u8BEF`,i);else{let s=new S(this.clientConfig,Rt(i),i);this.logger.error(`${e}.${t} \u51FA\u73B0\u9519\u8BEF`,s)}throw i}resolveVideoId(i){return i.aid!==void 0?{aid:i.aid}:{bvid:i.bvid}}};var ht,ft,At,xt,Dt,Pt,Bt,St,wt,Ct,F,G=class extends(Ct=u,wt=[r()],St=[r()],Bt=[r()],Pt=[r()],Dt=[r()],xt=[r()],At=[r()],ft=[r()],ht=[r()],Ct){constructor(){super(...arguments);d(F,5,this)}getLoginQRCode(e){return this.get("https://passport.bilibili.com/x/passport-login/web/qrcode/generate",e)}async getQRCodeLoginResult(e,t){let s=await this.get("https://passport.bilibili.com/x/passport-login/web/qrcode/poll",{query:{qrcode_key:e},skipWbiSign:!0,returnFormat:"RawResponse",...t});return{...(await s.json()).data,setCookie:s.headers.getSetCookie()}}async loginWithQRCode(e,t){return bt(this,e,t)}getBuvids(e){return this.get("https://api.bilibili.com/x/frontend/finger/spi",e)}getMyInfo(e,t){return this.get("https://api.bilibili.com/x/space/myinfo",{cookie:e,...t})}async initLoginSession(e,t=!0,s){this.logger.info("\u521D\u59CB\u5316\u7528\u6237\u6570\u636E...");let a=yt(e),{b_3:p,b_4:b}=await this.getBuvids(s);a.cookie=`${a.cookie} buvid3=${encodeURIComponent(p)}; buvid4=${encodeURIComponent(b)}; `;let w={userCookie:a};return t&&(this.clientConfig.context=w),this.logger.info(`\u5DF2\u5B8C\u6210\u7528\u6237\u767B\u5F55\uFF1A${a.uid}`),w}async getUserCard(e,t){return await this.get("https://api.bilibili.com/x/web-interface/card",{query:e,...t})}async getUserCards(e,t){let s=await this.get("https://api.vc.bilibili.com/account/v1/user/cards",{query:{uids:e.join(",")},...t});return e.map(a=>s.find(p=>p.mid===a)??null)}async getUpStat(e,t){return await this.get("https://api.bilibili.com/x/space/upstat",{query:{mid:e},...t})}};F=g(Ct),o(F,1,"getLoginQRCode",wt,G),o(F,1,"getQRCodeLoginResult",St,G),o(F,1,"loginWithQRCode",Bt,G),o(F,1,"getBuvids",Pt,G),o(F,1,"getMyInfo",Dt,G),o(F,1,"initLoginSession",xt,G),o(F,1,"getUserCard",At,G),o(F,1,"getUserCards",ft,G),o(F,1,"getUpStat",ht,G),c(F,G);var nr={None:0,Followed:2,Mutual:6,Blocked:128},fe={PackageCharge:1,PersonalSpace:11,Video:14,Comment:15,VideoEnd:17,H5Recommend:58,H5FollowList:106,H5FansList:107,Article:115,PrivateMessage:118,Search:120,VideoFollowBtn:164,H5CommonFollow:167,CreatorIncentive:192,ActivityPage:222,JointVideo:229,LikeDetail:235,FollowBarrage:245,BlockList:116},H={FOLLOW:{code:1,name:"\u5173\u6CE8",reSrc:fe.PersonalSpace},UNFOLLOW:{code:2,name:"\u53D6\u5173",reSrc:fe.H5FollowList},BLOCK:{code:5,name:"\u62C9\u9ED1",reSrc:fe.Comment},UNBLOCK:{code:6,name:"\u53D6\u6D88\u62C9\u9ED1",reSrc:fe.BlockList},REMOVE_FAN:{code:7,name:"\u8E22\u51FA\u7C89\u4E1D",reSrc:fe.H5FansList}};var h=class{constructor(i){this.options=i;i.pageParams&&(i.pageNum=this.parsePageNum(i.pageParams))}};import{isEmptyArr as oo}from"@ybgnb/utils";var ue=class extends h{hasNextPage(i,e,t){return!(this.options.total!==void 0&&(e.length>=this.options.total||(i-1)*this.options.pageSize>=this.options.total)||t!==null&&(t.data===null||oo(t.data)||this.getList(t).length<this.options.pageSize))}parsePageNum(i){if(i)return i.pn}updateNextPageParams(i,e,t,s){e.ps=this.options.pageSize,e.pn=i}getList(i){return i.data}};import{isEmptyArr as ro}from"@ybgnb/utils";var $=class n extends ue{static isPageDataWithTotalResponse(i){return i!==null&&typeof i.data=="object"&&i.data!==null&&"total"in i.data&&"list"in i.data}hasNextPage(i,e,t){return!(!super.hasNextPage(i,e,t)||t!==null&&(!n.isPageDataWithTotalResponse(t)||t.data.total<=e.length||ro(t.data.list)))}getList(i){return n.isPageDataWithTotalResponse(i)?i.data.list:[]}};import{sleep as Se}from"@ybgnb/utils";var kt,Yt,Gt,Wt,vt,Et,Vt,_t,Nt,Mt,It,Zt,Ft,Ot,qt,Xt,Lt,jt,zt,Ut,Jt,Kt,Tt,Qt,Ht,$t,es,ts,f,R=class extends(ts=u,es=[r()],$t=[r()],Ht=[r()],Qt=[r()],Tt=[r()],Kt=[r()],Jt=[r()],Ut=[r()],zt=[r()],jt=[r()],Lt=[r()],Xt=[r()],qt=[r()],Ot=[r()],Ft=[r()],Zt=[r()],It=[r()],Mt=[r()],Nt=[r()],_t=[r()],Vt=[r()],Et=[r()],vt=[r()],Wt=[r()],Gt=[r()],Yt=[r()],kt=[r()],ts){constructor(){super(...arguments);d(f,5,this)}get userService(){return this.api.client.user}buildRelationPager(e,t,s){return this.createPager("https://api.bilibili.com/x/relation/tag",new ue({pageSize:200,total:typeof e=="object"?e.count:void 0,...t}),{query:{tagid:typeof e=="object"?e.tagid:e},...s})}async fetchRelationPage(e,t,s){return await this.buildRelationPager(e,t,s).fetchNext()}async fetchRelationPageWithNextParams(e,t,s){return await this.buildRelationPager(e,t,s).fetchPageWithNextParams()}async fetchRelationAll(e,t,s,a){return await this.buildRelationPager(e,t,a).fetchAllPage(s)}async getRelation(e,t){return this.get("https://api.bilibili.com/x/space/wbi/acc/relation",{query:{mid:e,web_location:"333.1387"},...t})}getFollowTags(e){return this.get("https://api.bilibili.com/x/relation/tags",e)}getFollowingsByTag(e,t,s,a){return this.fetchRelationAll(e,t,s,a)}createFollowTag(e,t){return this.save("https://api.bilibili.com/x/relation/tag/create",{data:{tag:e},...t})}updateFollowTag(e,t){return this.save("https://api.bilibili.com/x/relation/tag/update",{data:e,...t})}deleteFollowTag(e,t){return this.save("https://api.bilibili.com/x/relation/tag/del",{data:{tagid:`${e}`},...t})}async getFollowsGroupedByTag(e,t,s){let a=await this.getFollowTags(s);for(let p of a)p.list=await this.getFollowingsByTag(p,e,t,s);return a}buildFollowingsPager(e,t,s){if(!e&&!this.currUserUid)throw new S(this.clientConfig,"uid \u4E3A\u7A7A");return this.createPager("https://api.bilibili.com/x/relation/followings",new $({pageSize:24,...t}),{query:{vmid:e??this.currUserUid,order:"desc"},...s})}async fetchFollowingsPage(e,t,s){return await this.buildFollowingsPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildFollowingsPager(e,t,s).fetchPageWithNextParams()}async fetchFollowingsAll(e,t,s,a){return await this.buildFollowingsPager(e,t,a).fetchAllPage(s)}async followUser(e,t){await this.modify(e,H.FOLLOW,!0,t)}async unFollowUser(e,t){await this.modify(e,H.UNFOLLOW,!0,t)}copyUsersToTag(e,t,s){return this.save("https://api.bilibili.com/x/relation/tags/copyUsers",{data:{fids:e.join(","),tagids:t.join(",")},...s})}buildFansPager(e,t,s){if(!e&&!this.currUserUid)throw new S(this.clientConfig,"uid \u4E3A\u7A7A");return this.createPager("https://api.bilibili.com/x/relation/fans",new $({pageSize:24,...t}),{query:{vmid:e??this.currUserUid,order:"desc"},...s})}async fetchFansPage(e,t,s){return await this.buildFansPager(e,t,s).fetchNext()}async fetchFansPageWithNextParams(e,t,s){return await this.buildFansPager(e,t,s).fetchPageWithNextParams()}async fetchFansAll(e,t,s,a){return await this.buildFansPager(e,t,a).fetchAllPage(s)}async removeFan(e,t){await this.modify(e,H.REMOVE_FAN,!0,t)}async getStat(e,t){return await this.get("https://api.bilibili.com/x/relation/stat",{query:{vmid:e},...t})}async avoidRiskControl(e,t){await this.get("https://api.bilibili.com/x/web-interface/wbi/search/all/v2",{query:{__refresh__:"true",_extra:"",context:"",page:"1",page_size:"42",order:"",pubtime_begin_s:"0",pubtime_end_s:"0",duration:"",from_source:"",from_spmid:"333.337",platform:"pc",highlight:"1",single_column:"0",keyword:`UID: ${e}`,ad_resource:"5646",source_tag:"3"},...t,logRequestParams:!1}),await Se(666,t?.signal),await this.getRelation(e),await Se(50,t?.signal),await this.getStat(e,t),await Se(50,t?.signal),await this.userService.getUpStat(e,t),await Se(666,t?.signal)}async modify(e,t,s=!0,a){s&&await this.avoidRiskControl(e,a),await this.save("https://api.bilibili.com/x/relation/modify",{query:{statistics:'{"appId":100,"platform":5}',...t.code!==H.BLOCK.code?{"x-bili-device-req-json":'{"platform":"web","device":"pc","spmid":"333.1387"}'}:{}},data:{fid:String(e),act:String(t.code),re_src:t.reSrc.toString(),spmid:"333.1387",extend_content:`{"entity":"query","entity_id":"${e}"}`,gaia_source:"web_main",...t.code!==H.BLOCK.code?{is_from_frontend_component:"true"}:{}},ignoreBusinessError:!1,...a})}async blockUser(e,t){await this.modify(e,H.BLOCK,!1,t)}async unBlockUser(e,t){await this.modify(e,H.UNBLOCK,!0,t)}buildBlocksPager(e,t){return this.createPager("https://api.bilibili.com/x/relation/blacks",new $({pageSize:50,...e}),{...t})}async fetchBlocksPage(e,t){return await this.buildBlocksPager(e,t).fetchNext()}async fetchBlocksPageWithNextParams(e,t){return await this.buildBlocksPager(e,t).fetchPageWithNextParams()}async fetchBlocksAll(e,t,s){return await this.buildBlocksPager(e,s).fetchAllPage(t)}};f=g(ts),o(f,1,"fetchRelationPage",es,R),o(f,1,"fetchRelationPageWithNextParams",$t,R),o(f,1,"fetchRelationAll",Ht,R),o(f,1,"getRelation",Qt,R),o(f,1,"getFollowTags",Tt,R),o(f,1,"getFollowingsByTag",Kt,R),o(f,1,"createFollowTag",Jt,R),o(f,1,"updateFollowTag",Ut,R),o(f,1,"deleteFollowTag",zt,R),o(f,1,"getFollowsGroupedByTag",jt,R),o(f,1,"fetchFollowingsPage",Lt,R),o(f,1,"fetchPageWithNextParams",Xt,R),o(f,1,"fetchFollowingsAll",qt,R),o(f,1,"followUser",Ot,R),o(f,1,"unFollowUser",Ft,R),o(f,1,"copyUsersToTag",Zt,R),o(f,1,"fetchFansPage",It,R),o(f,1,"fetchFansPageWithNextParams",Mt,R),o(f,1,"fetchFansAll",Nt,R),o(f,1,"getStat",_t,R),o(f,1,"avoidRiskControl",Vt,R),o(f,1,"modify",Et,R),o(f,1,"blockUser",vt,R),o(f,1,"unBlockUser",Wt,R),o(f,1,"fetchBlocksPage",Gt,R),o(f,1,"fetchBlocksPageWithNextParams",Yt,R),o(f,1,"fetchBlocksAll",kt,R),c(f,R);var we=class extends h{hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s.cursor.ps===0||s.cursor.max===0)return!1}return!0}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s===null)e.ps=this.options.pageSize,e.max=0,e.view_at=0,e.business=e.business??"";else{let a=s.data.cursor;e.ps=a.ps,e.max=a.max,e.view_at=a.view_at,e.business=a.business}}getList(i){return i.data.list}};var ss,is,as,os,rs,ns,ps,ls,ms,z,E=class extends(ms=u,ls=[r()],ps=[r()],ns=[r()],rs=[r()],os=[r()],as=[r()],is=[r()],ss=[r()],ms){constructor(){super(...arguments);d(z,5,this)}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/web-interface/history/cursor",new we({pageSize:20,...t}),{query:{business:e??""},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,a){return await this.buildPager(e,t,a).fetchAllPage(s)}deleteHistory(e,t){return this.save("https://api.bilibili.com/x/v2/history/delete",{data:{kid:e},...t})}clearHistory(e){return this.save("https://api.bilibili.com/x/v2/history/clear",{...e})}setHistoryShadow(e,t){return this.save("https://api.bilibili.com/x/v2/history/shadow/set",{data:{switch:e},...t})}getHistoryShadow(e){return this.get("https://api.bilibili.com/x/v2/history/shadow",{...e})}report(e,t){return this.save("https://api.bilibili.com/x/v2/history/report",{data:{...e,platform:"web"},...t})}};z=g(ms),o(z,1,"fetchPage",ls,E),o(z,1,"fetchPageWithNextParams",ps,E),o(z,1,"fetchAll",ns,E),o(z,1,"deleteHistory",rs,E),o(z,1,"clearHistory",os,E),o(z,1,"setHistoryShadow",as,E),o(z,1,"getHistoryShadow",is,E),o(z,1,"report",ss,E),c(z,E);var us,cs,gs,ds,bs,ys,Rs,hs,fs,As,xs,_,k=class extends(xs=u,As=[r()],fs=[r()],hs=[r()],Rs=[r()],ys=[r()],bs=[r()],ds=[r()],gs=[r()],cs=[r()],us=[r()],xs){constructor(){super(...arguments);d(_,5,this)}getSettings(e){return this.get("https://api.vc.bilibili.com/link_setting/v1/link_setting/get",{query:{msg_notify:1,show_unfollowed_msg:1,build:0,mobi_app:"web"},...e})}updateSettings(e,t){return this.save("https://api.vc.bilibili.com/link_setting/v1/link_setting/set",{data:{...e,build:0,mobi_app:"web"},...t})}getBlockWords(e){return this.get("https://api.vc.bilibili.com/x/im/link_setting/get_block_words",{query:{build:0,mobi_app:"web"},...e})}addBlockWord(e,t){return this.save("https://api.vc.bilibili.com/x/im/link_setting/add_block_word",{data:{content:e,build:0,mobi_app:"web"},...t})}delBlockWord(e,t){return this.save("https://api.vc.bilibili.com/x/im/link_setting/del_block_word",{data:{content:e,build:0,mobi_app:"web"},...t})}getAutoReplyRules(e,t){return this.get("https://api.vc.bilibili.com/x/im/auto_reply/get_reply_text",{query:{"type[]":e,build:0,mobi_app:"web"},...t})}setAutoReplyRule(e,t){return this.save("https://api.vc.bilibili.com/x/im/auto_reply/set_reply_text",{data:{build:0,mobi_app:"web",...e},...t})}delAutoReplyRule(e,t){return this.save("https://api.vc.bilibili.com/x/im/auto_reply/del_reply_text",{data:{id:e,build:0,mobi_app:"web"},...t})}getSystemSettings(e){return this.get("https://api.vc.bilibili.com/link_setting/v1/link_setting/get_sys_setting",{query:{build:0,mobi_app:"web"},...e})}canShowCreateGroupIcon(e){return this.get("https://api.vc.bilibili.com/link_group/v1/member/show_create_group_icon",{query:{build:0,mobi_app:"web"},...e})}};_=g(xs),o(_,1,"getSettings",As,k),o(_,1,"updateSettings",fs,k),o(_,1,"getBlockWords",hs,k),o(_,1,"addBlockWord",Rs,k),o(_,1,"delBlockWord",ys,k),o(_,1,"getAutoReplyRules",bs,k),o(_,1,"setAutoReplyRule",ds,k),o(_,1,"delAutoReplyRule",gs,k),o(_,1,"getSystemSettings",cs,k),o(_,1,"canShowCreateGroupIcon",us,k),c(_,k);var Ce=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){return!(t!==null&&(t.data==null||t.data.cursor.is_end))}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let a=s.data.cursor;e.id=a.id,e.reply_time=a.time}}getList(i){return i.data.items}};var ke=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){return!(t!==null&&(t.data==null||t.data.cursor.is_end))}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let a=s.data.cursor;e.id=a.id,e.at_time=a.time}}getList(i){return i.data.items}};var Ye=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){return!(t!==null&&(t.data==null||t.data.total.cursor.is_end))}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let a=s.data.total.cursor;e.id=a.id,e.like_time=a.time}}getList(i){return i.data.total.items}};import{isEmptyArr as no}from"@ybgnb/utils";var Ge=class extends h{constructor(i){super({pageSize:17,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s==null||no(s))return!1}return!0}parsePageNum(i){}updateNextPageParams(i,e,t,s){t!=null&&t.length>0&&(e.cursor=t[t.length-1].cursor)}getList(i){return i.data}};var Ds,Ps,Bs,Ss,ws,Cs,ks,Ys,Gs,Ws,vs,Es,Vs,_s,Ns,Ms,Is,Zs,Fs,Os,P,A=class extends(Os=u,Fs=[r()],Zs=[r()],Is=[r()],Ms=[r()],Ns=[r()],_s=[r()],Vs=[r()],Es=[r()],vs=[r()],Ws=[r()],Gs=[r()],Ys=[r()],ks=[r()],Cs=[r()],ws=[r()],Ss=[r()],Bs=[r()],Ps=[r()],Ds=[r()],Os){constructor(){super(...arguments);d(P,5,this)}getUnreadCount(e){return this.get("https://api.vc.bilibili.com/x/im/web/msgfeed/unread",{query:{build:0,mobi_app:"web"},...e})}delMessage(e,t,s){return this.save("https://api.bilibili.com/x/msgfeed/del",{data:{tp:t,id:e,build:0,mobi_app:"web",platform:"web"},...s})}buildBasePager(e,t,s){return this.createPager(`https://api.bilibili.com/x/msgfeed/${e}`,t,{query:{platform:"web",build:0,mobi_app:"web",web_location:"333.40164"},...s})}buildReplyPager(e,t){return this.buildBasePager("reply",new Ce(e),t)}buildAtPager(e,t){return this.buildBasePager("at",new ke(e),t)}buildLikePager(e,t){return this.buildBasePager("like",new Ye(e),t)}async fetchReplyPage(e,t){return await this.buildReplyPager(e,t).fetchNext()}async fetchReplyPageWithNextParams(e,t){return await this.buildReplyPager(e,t).fetchPageWithNextParams()}async fetchReplyAll(e,t,s){return await this.buildReplyPager(e,s).fetchAllPage(t)}delReplyMessage(e,t){return this.delMessage(e,1,t)}async fetchAtPage(e,t){return await this.buildAtPager(e,t).fetchNext()}async fetchAtPageWithNextParams(e,t){return await this.buildAtPager(e,t).fetchPageWithNextParams()}async fetchAtAll(e,t,s){return await this.buildAtPager(e,s).fetchAllPage(t)}delAtMessage(e,t){return this.delMessage(e,2,t)}async fetchLikePage(e,t){return await this.buildLikePager(e,t).fetchNext()}async fetchLikePageWithNextParams(e,t){return await this.buildLikePager(e,t).fetchPageWithNextParams()}async fetchLikeAll(e,t,s){return await this.buildLikePager(e,s).fetchAllPage(t)}setLikeMsgState(e,t,s){return this.save("https://api.bilibili.com/x/msgfeed/notice",{data:{tp:0,id:e,notice_state:t,build:0,mobi_app:"web",platform:"web"},...s})}delLikeMessage(e,t){return this.delMessage(e,0,t)}buildSystemPager(e,t){return this.createPager("https://message.bilibili.com/x/sys-msg/query_notify_list",new Ge(e),{query:{page_size:20,build:0,platform:"web",mobi_app:"web",data_type:"web",has_up:"1",source_platform:"web",web_location:"333.40164"},...t})}async fetchSystemPage(e,t){return await this.buildSystemPager(e,t).fetchNext()}async fetchSystemPageWithNextParams(e,t){return await this.buildSystemPager(e,t).fetchPageWithNextParams()}async fetchSystemAll(e,t,s){return await this.buildSystemPager(e,s).fetchAllPage(t)}delSysMessages(e,t){return this.save("https://message.bilibili.com/x/sys-msg/del_notify_list",{query:{build:0,mobi_app:"web",csrf:this.clientConfig.context?.userCookie.bili_jct??""},data:JSON.stringify({station_ids:e.filter(s=>s.is_station===1).map(s=>s.id),ids:e.filter(s=>s.is_station!==1).map(s=>s.id),type:4,build:0,mobi_app:"web"}),...t})}};P=g(Os),o(P,1,"getUnreadCount",Fs,A),o(P,1,"delMessage",Zs,A),o(P,1,"fetchReplyPage",Is,A),o(P,1,"fetchReplyPageWithNextParams",Ms,A),o(P,1,"fetchReplyAll",Ns,A),o(P,1,"delReplyMessage",_s,A),o(P,1,"fetchAtPage",Vs,A),o(P,1,"fetchAtPageWithNextParams",Es,A),o(P,1,"fetchAtAll",vs,A),o(P,1,"delAtMessage",Ws,A),o(P,1,"fetchLikePage",Gs,A),o(P,1,"fetchLikePageWithNextParams",Ys,A),o(P,1,"fetchLikeAll",ks,A),o(P,1,"setLikeMsgState",Cs,A),o(P,1,"delLikeMessage",ws,A),o(P,1,"fetchSystemPage",Ss,A),o(P,1,"fetchSystemPageWithNextParams",Bs,A),o(P,1,"fetchSystemAll",Ps,A),o(P,1,"delSysMessages",Ds,A),c(P,A);var We=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s.has_more===0||s.session_list==null||s.session_list.length===0)return!1}return!0}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let a=s.data.session_list;a!=null&&(e.end_ts=a[a.length-1].session_ts)}}getList(i){return i.data.session_list}};var qs,Xs,Ls,js,zs,Us,Js,Ks,J,N=class extends(Ks=u,Js=[r()],Us=[r()],zs=[r()],js=[r()],Ls=[r()],Xs=[r()],qs=[r()],Ks){constructor(){super(...arguments);d(J,5,this)}getUnreadCount(e){return this.get("https://api.vc.bilibili.com/session_svr/v1/session_svr/single_unread",{query:{build:0,mobi_app:"web"},...e})}getMyGroupUnreadCount(e){return this.get("https://api.vc.bilibili.com/session_svr/v1/session_svr/my_group_unread",{query:{build:0,mobi_app:"web"},...e})}buildPager(e,t,s){let a=e?.session_type??1;return this.createPager("https://api.vc.bilibili.com/session_svr/v1/session_svr/get_sessions",new We(t),{query:{...e,session_type:a,group_fold:a===1?"2":"1",size:a!==1?1:void 0,unfollow_fold:"0",sort_rule:"1",platform:"web",build:0,mobi_app:"web",web_location:"333.40164"},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,a){return await this.buildPager(e,t,a).fetchAllPage(s)}async setSessionRead(e,t){await this.save("https://api.vc.bilibili.com/session_svr/v1/session_svr/update_ack",{data:{talker_id:e.talker_id,session_type:e.session_type,ack_seqno:e.ack_seqno,build:0,mobi_app:"web"},...t})}async delSession(e,t){await this.save("https://api.vc.bilibili.com/session_svr/v1/session_svr/remove_session",{data:{talker_id:e.talker_id,session_type:e.session_type,build:0,mobi_app:"web"},...t})}};J=g(Ks),o(J,1,"getUnreadCount",Js,N),o(J,1,"getMyGroupUnreadCount",Us,N),o(J,1,"fetchPage",zs,N),o(J,1,"fetchPageWithNextParams",js,N),o(J,1,"fetchAll",Ls,N),o(J,1,"setSessionRead",Xs,N),o(J,1,"delSession",qs,N),c(J,N);var ve=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s.count<=e.length||s.list.length===0)return!1}return!0}parsePageNum(i){if(i)return i.pn}updateNextPageParams(i,e,t,s){e.ps=this.options.pageSize,e.pn=i}getList(i){return i.data.list}};var Ts,Qs,Hs,$s,ei,ti,si,ii,ai,oi,O,W=class extends(oi=u,ai=[r()],ii=[r()],si=[r()],ti=[r()],ei=[r()],$s=[r()],Hs=[r()],Qs=[r()],Ts=[r()],oi){constructor(){super(...arguments);d(O,5,this)}buildPager(e,t){return this.createPager("https://api.bilibili.com/x/v2/history/toview/web",new ve(e),{query:{viewed:0,asc:!1,key:"",need_split:!0,build:0,platform:"web",mobi_app:"web"},...t})}async fetchPage(e,t){return await this.buildPager(e,t).fetchNext()}async fetchPageWithNextParams(e,t){return await this.buildPager(e,t).fetchPageWithNextParams()}async fetchAll(e,t,s){return await this.buildPager(e,s).fetchAllPage(t)}async addToView(e,t){await this.save("https://api.bilibili.com/x/v2/history/toview/add",{data:{aid:e},...t})}async addAllToView(e,t){await this.save("https://space.bilibili.com/ajax/channel/addAllToView",{data:{...typeof e=="string"?{bvid:e}:{aid:e}},...t})}async delToView(e,t){await this.save("https://api.bilibili.com/x/v2/history/toview/v2/dels",{data:{resources:e.join(",")},...t})}async clearToView(e,t){await this.save("https://api.bilibili.com/x/v2/history/toview/clear",{data:{clean_type:e},...t})}async moveFavFolder(e,t){await this.save("https://api.bilibili.com/x/v2/history/toview/move",{data:{resources:e.join(","),tar_media_id:t}})}async getTotal(e){let t=await this.get("https://api.bilibili.com/x/v3/fav/folder/list4navigate?web_location=333.1007",e);try{return t[1].mediaListResponse.count}catch{return}}};O=g(oi),o(O,1,"fetchPage",ai,W),o(O,1,"fetchPageWithNextParams",ii,W),o(O,1,"fetchAll",si,W),o(O,1,"addToView",ti,W),o(O,1,"addAllToView",ei,W),o(O,1,"delToView",$s,W),o(O,1,"clearToView",Hs,W),o(O,1,"moveFavFolder",Qs,W),o(O,1,"getTotal",Ts,W),c(O,W);var ee=class extends h{constructor(e,t="list",s="has_more",a){super(e);this.listKey=t;this.hasMoreKey=s;this.countKey=a}hasNextPage(e,t,s){return s!==null&&s.data?s.data.has_more:!0}parsePageNum(e){if(e)return e.pn}updateNextPageParams(e,t,s,a){t.ps=this.options.pageSize,t.pn=e}getList(e){return e.data[this.listKey]}getTotal(e){if(this.countKey&&e)return e.data[this.countKey]}};var ri,ni,pi,li,mi,ui,ci,gi,di,bi,yi,Ri,hi,fi,Ai,C,B=class extends(Ai=u,fi=[r()],hi=[r()],Ri=[r()],yi=[r()],bi=[r()],di=[r()],gi=[r()],ci=[r()],ui=[r()],mi=[r()],li=[r()],pi=[r()],ni=[r()],ri=[r()],Ai){constructor(){super(...arguments);d(C,5,this)}async getFavFolders(e,t,s){return await this.get("https://api.bilibili.com/x/v3/fav/folder/created/list-all",{query:{up_mid:e??this.currUserUid,...t?{rid:t}:{},web_location:"333.1387"},...s})??{list:[],count:0}}async getFavFolderMeta(e,t){return await this.get("https://api.bilibili.com/x/v3/fav/folder/info",{query:{media_id:e},...t})}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/v3/fav/resource/list",new ee({pageSize:40,...t},"medias"),{query:{...e,platform:"web",web_location:"333.1387"},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,a){let p=this.buildPager(e,t,a),b=await p.fetchAllPage(s);if(!p.lastApiResponse?.data.info)throw new S(this.clientConfig,`\u6536\u85CF\u5939[${e.media_id}]\u4E0D\u5B58\u5728`);return{info:p.lastApiResponse?.data.info,medias:b,has_more:!1}}async getFavIds(e,t){return await this.get("https://api.bilibili.com/x/v3/fav/resource/ids",{query:{media_id:e},...t})}async addFavFolder(e,t){return await this.save("https://api.bilibili.com/x/v3/fav/folder/add",{data:{...e},...t})}async updateFavFolder(e,t){let{id:s,...a}=e;return await this.save("https://api.bilibili.com/x/v3/fav/folder/edit",{data:{...a,media_id:s},...t})}async delFavFolder(e,t){await this.save("https://api.bilibili.com/x/v3/fav/folder/del",{data:{media_ids:e.join(",")},...t})}async copyFavItems(e,t,s,a,p){await this.save("https://api.bilibili.com/x/v3/fav/resource/copy",{data:{src_media_id:e,tar_media_id:t,mid:s,resources:a,platform:"web"},...p})}async moveFavItems(e,t,s,a,p){await this.save("https://api.bilibili.com/x/v3/fav/resource/move",{data:{src_media_id:e,tar_media_id:t,mid:s,resources:a,platform:"web"},...p})}async batchDelFavItems(e,t,s){await this.save("https://api.bilibili.com/x/v3/fav/resource/batch-del",{data:{media_id:e,resources:t,platform:"web"},...s})}async cleanFavItems(e,t){await this.save("https://api.bilibili.com/x/v3/fav/resource/clean",{data:{media_id:e,platform:"web"},...t})}async favVideo(e,t,s,a){return await this.save("https://api.bilibili.com/x/v3/fav/resource/deal",{data:{rid:e,add_media_ids:t.join(","),del_media_ids:s.join(","),type:"2",platform:"web",eab_x:"1",ramval:"10",ga:"1",gaia_source:"web_normal"},...a})}};C=g(Ai),o(C,1,"getFavFolders",fi,B),o(C,1,"getFavFolderMeta",hi,B),o(C,1,"fetchPage",Ri,B),o(C,1,"fetchPageWithNextParams",yi,B),o(C,1,"fetchAll",bi,B),o(C,1,"getFavIds",di,B),o(C,1,"addFavFolder",gi,B),o(C,1,"updateFavFolder",ci,B),o(C,1,"delFavFolder",ui,B),o(C,1,"copyFavItems",mi,B),o(C,1,"moveFavItems",li,B),o(C,1,"batchDelFavItems",pi,B),o(C,1,"cleanFavItems",ni,B),o(C,1,"favVideo",ri,B),c(C,B);var xi,Di,Pi,Bi,Si,wi,oe,U=class extends(wi=u,Si=[r()],Bi=[r()],Pi=[r()],Di=[r()],xi=[r()],wi){constructor(){super(...arguments);d(oe,5,this)}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/v3/fav/folder/collected/list",new ee({pageSize:50,...t},void 0,void 0,"count"),{query:{up_mid:e??this.currUserUid,platform:"web",web_location:"333.1387"},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,a){return await this.buildPager(e,t,a).fetchAllPage(s)}async add(e,t){await this.save("https://api.bilibili.com/x/v3/fav/season/fav",{data:{season_id:e,platform:"web"},...t})}async del(e,t){await this.save("https://api.bilibili.com/x/v3/fav/season/unfav",{data:{season_id:e,platform:"web"},...t})}};oe=g(wi),o(oe,1,"fetchPage",Si,U),o(oe,1,"fetchPageWithNextParams",Bi,U),o(oe,1,"fetchAll",Pi,U),o(oe,1,"add",Di,U),o(oe,1,"del",xi,U),c(oe,U);var Ee=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){return t!==null&&t.data?t.data.has_more:!0}parsePageNum(i){if(i)return i.page}updateNextPageParams(i,e,t,s){e.page=i,e.page_size=this.options.pageSize}getList(i){return i.data.items}};import{sleepRandom as po}from"@ybgnb/utils";var Ci,ki,Yi,Gi,Wi,vi,Ei,te,q=class extends(Ei=u,vi=[r()],Wi=[r()],Gi=[r()],Yi=[r()],ki=[r()],Ci=[r()],Ei){constructor(){super(...arguments);d(te,5,this)}buildPager(e,t){return this.createPager("https://api.bilibili.com/x/polymer/web-dynamic/v1/opus/feed/fav",new Ee(e),{query:{platform:"web",web_location:"333.1387"},...t})}async fetchPage(e,t){return await this.buildPager(e,t).fetchNext()}async fetchPageWithNextParams(e,t){return await this.buildPager(e,t).fetchPageWithNextParams()}async fetchAll(e,t,s){return await this.buildPager(e,s).fetchAllPage(t)}async del(e,t){await this.post("https://api.bilibili.com/x/community/cosmo/interface/simple_action",{query:{csrf:this.clientConfig.context?.userCookie.bili_jct,gaia_source:"main_web"},data:JSON.stringify({"":{spmid:"444.42.0.0",from:"unknown",from_spmid:"333.1387.0.0"},action:4,entity:{object_id_str:e,type:{biz:2}}}),...t})}async addByCvId(e,t){await this.save("https://api.bilibili.com/x/article/favorites/add",{data:{id:e},...t})}async addByOpusId(e,t){let s=await this.get("https://api.bilibili.com/x/polymer/web-dynamic/v1/opus/detail",{query:{id:e},...t});await po(200,300),await this.addByCvId(s.fallback.id)}};te=g(Ei),o(te,1,"fetchPage",vi,q),o(te,1,"fetchPageWithNextParams",Wi,q),o(te,1,"fetchAll",Gi,q),o(te,1,"del",Yi,q),o(te,1,"addByCvId",ki,q),o(te,1,"addByOpusId",Ci,q),c(te,q);var _n={anime:{name:"\u6211\u7684\u8FFD\u756A",type:"1"},tv:{name:"\u6211\u7684\u8FFD\u5267",type:"2"}},ce={all:0,to_watch:1,watching:2,watched:3};var Vi,_i,Ni,Mi,Ii,Zi,Fi,se,X=class extends(Fi=u,Zi=[r()],Ii=[r()],Mi=[r()],Ni=[r()],_i=[r()],Vi=[r()],Fi){constructor(){super(...arguments);d(se,5,this)}buildPager(e,t,s=ce.all,a,p){return this.createPager("https://api.bilibili.com/x/space/bangumi/follow/list",new $({pageSize:24,...a}),{query:{vmid:e??this.currUserUid,type:t,follow_status:s,platform:"web",web_location:"333.1387"},...p})}async fetchPage(e,t,s=ce.all,a,p){return await this.buildPager(e,t,s,a,p).fetchNext()}async fetchPageWithNextParams(e,t,s=ce.all,a,p){return await this.buildPager(e,t,s,a,p).fetchPageWithNextParams()}async fetchAll(e,t,s=ce.all,a,p,b){return await this.buildPager(e,t,s,a,b).fetchAllPage(p)}async fetchMyAll(e,t=ce.all,s,a,p){return this.fetchAll(this.currUserUid,e,t,s,a,p)}async add(e,t){await this.save("https://api.bilibili.com/pgc/web/follow/add",{data:{season_id:e,platform:"web"},...t})}async del(e,t){await this.save("https://api.bilibili.com/pgc/web/follow/del",{data:{season_id:e,platform:"web"},...t})}};se=g(Fi),o(se,1,"fetchPage",Zi,X),o(se,1,"fetchPageWithNextParams",Ii,X),o(se,1,"fetchAll",Mi,X),o(se,1,"fetchMyAll",Ni,X),o(se,1,"add",_i,X),o(se,1,"del",Vi,X),c(se,X);import{isEmptyArr as lo}from"@ybgnb/utils";var Ve=class extends h{constructor(i){super({pageSize:40,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data,a=s.page;if(lo(s.list.vlist)||a.count<=e.length||a.count<=a.pn*a.ps)return!1}return!0}parsePageNum(i){if(i)return i.pn}updateNextPageParams(i,e,t,s){e.ps=this.options.pageSize,e.pn=i}getList(i){return i.data.list.vlist}};var Oi,qi,Xi,Li,Ae,ie=class extends(Li=u,Xi=[r()],qi=[r()],Oi=[r()],Li){constructor(){super(...arguments);d(Ae,5,this)}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/space/wbi/arc/search",new Ve(t),{query:{...e,platform:"web"},...s})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,a){let p=this.buildPager(e,t,a);return await p.fetchAllPage(s),p.lastApiResponse.data.list.vlist=p.list,p.lastApiResponse.data}};Ae=g(Li),o(Ae,1,"fetchPage",Xi,ie),o(Ae,1,"fetchPageWithNextParams",qi,ie),o(Ae,1,"fetchAll",Oi,ie),c(Ae,ie);var ji,zi,Ui,Ji,Ki,ge,L=class extends(Ki=u,Ji=[r()],Ui=[r()],zi=[r()],ji=[r()],Ki){constructor(){super(...arguments);d(ge,5,this)}getOnlineCount(e,t){return this.get("https://api.bilibili.com/x/player/online/total",{query:{...this.resolveVideoId(e),cid:e.cid},...t})}getParts(e,t){return this.get("https://api.bilibili.com/x/player/pagelist",{query:{...this.resolveVideoId(e)},...t})}async getOwnParts(e,t){let s=await this.get("https://member.bilibili.com/x/vupre/web/archive/view",{query:{topic_grey:"1",bvid:e},...t});return s?.videos&&Array.isArray(s.videos)?s.videos:[]}getInfo(e,t){return this.get("https://api.bilibili.com/x/web-interface/wbi/view",{query:{...this.resolveVideoId(e)},...t})}};ge=g(Ki),o(ge,1,"getOnlineCount",Ji,L),o(ge,1,"getParts",Ui,L),o(ge,1,"getOwnParts",zi,L),o(ge,1,"getInfo",ji,L),c(ge,L);var _e=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data;if(s.has_more!==void 0)return s.has_more}return!0}parsePageNum(i){}updateNextPageParams(i,e,t,s){if(s!=null){let a=s.data;e.offset=a.offset}}getList(i){return i.data.items}};var Ti,Qi,Hi,$i,ea,de,K=class extends(ea=u,$i=[r()],Hi=[r()],Qi=[r()],Ti=[r()],ea){constructor(){super(...arguments);d(de,5,this)}buildDynamicPager(e,t,s){return this.createPager("https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all",new _e(t),{query:{...e,platform:"web",build:0,mobi_app:"web",web_location:"333.1365"},...s})}async fetchDynamicPage(e,t,s){return await this.buildDynamicPager(e,t,s).fetchNext()}async fetchDynamicPageWithNextParams(e,t,s){return await this.buildDynamicPager(e,t,s).fetchPageWithNextParams()}async fetchDynamicAll(e,t,s,a){return await this.buildDynamicPager(e,t,a).fetchAllPage(s)}async newUpdatesCount(e,t){return(await this.get("https://api.bilibili.com/x/polymer/web-dynamic/v1/feed/all/update",{query:{...e,web_location:"333.1365"},...t})).update_num}};de=g(ea),o(de,1,"fetchDynamicPage",$i,K),o(de,1,"fetchDynamicPageWithNextParams",Hi,K),o(de,1,"fetchDynamicAll",Qi,K),o(de,1,"newUpdatesCount",Ti,K),c(de,K);var ta,sa,ia,aa,oa,ra,na,pa,T,M=class extends(pa=u,na=[r()],ra=[r()],oa=[r()],aa=[r()],ia=[r()],sa=[r()],ta=[r()],pa){constructor(){super(...arguments);d(T,5,this);this._videoInfoService=null}get videoInfoService(){return this._videoInfoService||(this._videoInfoService=new L(this.api)),this._videoInfoService}getRelation(e,t){return this.get("https://api.bilibili.com/x/web-interface/archive/relation",{query:{...this.resolveVideoId(e)},returnFormat:"ApiResponse",ignoreBusinessError:!0,...t})}like(e,t){return this.save("https://api.bilibili.com/x/web-interface/archive/like",{data:{...this.resolveVideoId(e),like:e.like?"1":"2"},...t})}async hasLike(e,t){return await this.get("https://api.bilibili.com/x/web-interface/archive/has/like",{query:{...this.resolveVideoId(e)},...t})===1}dislike(e,t){return this.save("https://app.biliapi.net/x/v2/view/dislike",{data:{aid:e.avid,dislike:e.dislike?"0":"1"},...t})}async coin(e,t){let s=e.bvid;return s||(s=(await this.videoInfoService.getInfo(e)).bvid),this.save("https://api.bilibili.com/x/web-interface/coin/add",{data:{bvid:s,multiply:e.multiply,select_like:e.select_like??0,cross_domain:!0,from_spmid:"333.337.search-card.all.click",spmid:"333.788.0.0",statistics:'{"appId":100,"platform":5}',eab_x:2,ramval:0,source:"web_normal",ga:1},returnFormat:"ApiResponse",ignoreBusinessError:!0,...t,referer:`https://www.bilibili.com/video/${s}/?spm_id_from=333.1391.0.0`})}triple(e,t){return this.save("https://api.bilibili.com/x/web-interface/archive/like/triple",{data:{...this.resolveVideoId(e)},...t})}share(e,t){return this.save("https://api.bilibili.com/x/web-interface/share/add",{data:{...this.resolveVideoId(e),eab_x:1,ramval:316,source:"web_normal",ga:1},...t})}};T=g(pa),o(T,1,"getRelation",na,M),o(T,1,"like",ra,M),o(T,1,"hasLike",oa,M),o(T,1,"dislike",aa,M),o(T,1,"coin",ia,M),o(T,1,"triple",sa,M),o(T,1,"share",ta,M),c(T,M);var la,ma,et,be=class extends(ma=u,la=[r()],ma){constructor(){super(...arguments);d(et,5,this)}heartbeat(e,t,s){let a={params:{},body:{}},p=(w,x,D)=>{a.body[w]=a.params[D||"w"+w]=t[w]??e[D||"w"+w]??x};p("start_ts",Math.floor(Date.now()/1e3)),p("mid",this.currUserUid),p("aid",0),p("dt",2),p("realtime",0),p("played_time",0,"w_playedtime"),p("real_played_time",0),p("video_duration",180),p("last_play_progress_time",0);let b="https://www.bilibili.com/?spm_id_from=333.1365.0.0";return this.save("https://api.bilibili.com/x/click-interface/web/heartbeat",{query:{...a.params,web_location:1315873,...e},data:{quality:80,type:3,outer:0,statistics:'{"appId":100,"platform":5,"abtest":"","version":""}',max_play_progress_time:a.body.last_play_progress_time+a.body.played_time,refer_url:b,...a.body,mobi_app:"web",device:"web",platform:"web",cur_language_vt:"{}",perfer_type:"{}",play_mode:"1",spmid:"333.788.0.0",from_spmid:"333.1007.tianma.1-2-2.click",session:crypto.randomUUID().replace(/-/g,""),extra:'{"player_version":"4.8.36","play_method":3,"play_volume":1,"auto_play":0}',...t},init:{headers:{referer:b}},...s})}};et=g(ma),o(et,1,"heartbeat",la,be),c(et,be);var ua,ca,ga,Ne,re=class extends(ga=u,ca=[r()],ua=[r()],ga){constructor(){super(...arguments);d(Ne,5,this)}getDailyTaskStatus(e){return this.get("https://api.bilibili.com/x/member/web/exp/reward",e)}getCoinTodayExp(e){return this.get("https://api.bilibili.com/x/web-interface/coin/today/exp",e)}};Ne=g(ga),o(Ne,1,"getDailyTaskStatus",ca,re),o(Ne,1,"getCoinTodayExp",ua,re),c(Ne,re);var Me=class extends ee{constructor(e,t="list",s){super(e,t);this.hasMoreKey=s}hasNextPage(e,t,s){return s!==null&&s.data?s.data[this.hasMoreKey]:!0}};var da,ba,ya,Ra,ha,ye,Q=class extends(ha=u,Ra=[r()],ya=[r()],ba=[r()],da=[r()],ha){constructor(){super(...arguments);d(ye,5,this)}buildPopularPager(e,t){return this.createPager("https://api.bilibili.com/x/web-interface/popular",new Me({pageSize:20,...e},"list","no_more"),{query:{},...t})}async fetchPopularPage(e,t){return await this.buildPopularPager(e,t).fetchNext()}async fetchPageWithNextParams(e,t){return await this.buildPopularPager(e,t).fetchPageWithNextParams()}getPopularSeriesList(e){return this.get("https://api.bilibili.com/x/web-interface/popular/series/list",{...e})}getPopularSeriesInfo(e,t){return this.get("https://api.bilibili.com/x/web-interface/popular/series/one",{query:{number:e},...t})}};ye=g(ha),o(ye,1,"fetchPopularPage",Ra,Q),o(ye,1,"fetchPageWithNextParams",ya,Q),o(ye,1,"getPopularSeriesList",ba,Q),o(ye,1,"getPopularSeriesInfo",da,Q),c(ye,Q);var fa,Aa,xa,Ie,ne=class extends(xa=u,Aa=[r()],fa=[r()],xa){constructor(){super(...arguments);d(Ie,5,this)}getNavNum(e,t){return this.get("https://api.bilibili.com/x/space/navnum",{query:{mid:e},...t})}getFavNum(e,t){return this.get("https://api.bilibili.com/x/space/fav/nav",{query:{mid:e},...t})}};Ie=g(xa),o(Ie,1,"getNavNum",Aa,ne),o(Ie,1,"getFavNum",fa,ne),c(Ie,ne);var Da,Pa,Ba,Ze,pe=class extends(Ba=u,Pa=[r()],Da=[r()],Ba){constructor(){super(...arguments);d(Ze,5,this)}getSpaceSettings(e){return this.get("https://api.bilibili.com/x/space/setting",{query:{web_location:"333.1387",mid:this.currUserUid},...e})}updatePrivacy(e,t){let s=Object.keys(e)[0],a=e[s];return this.save("https://api.bilibili.com/x/space/privacy/modify",{data:{field:s,value:a},...t})}};Ze=g(Ba),o(Ze,1,"getSpaceSettings",Pa,pe),o(Ze,1,"updatePrivacy",Da,pe),c(Ze,pe);import{createLogger as mo}from"@ybgnb/utils";var Sa=(n="info")=>({timeout:5e3,userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36",referer:"https://space.bilibili.com/10000",logLevel:n,logger:mo(n,(i,...e)=>{console[i](`[${new Date().toLocaleString()}]`,...e)}),autoMixinKey:!1}),tt={method:"GET",skipWbiSign:!1,autoCsrf:!0,logRequestParams:!0},wa={...tt,returnFormat:"ApiResponseData",ignoreBusinessError:!1};import{sleepRandom as Ca}from"@ybgnb/utils";var ka,Ya,Ga,Fe,le=class extends(Ga=u,Ya=[r()],ka=[r()],Ga){constructor(){super(...arguments);d(Fe,5,this)}get userService(){return this.api.client.user}getPlayUrl(e,t){return this.get("https://api.bilibili.com/x/player/wbi/playurl",{query:{fnval:1,fourk:1,high_quality:1,gaia_source:"view-card ",...e},init:{headers:{referer:`https://www.bilibili.com/video/${e.bvid}/?spm_id_from=333.1391.0.0`}},...t})}async getBestQualityUrl(e,t){let s=await this.getPlayUrl({...e,fnval:4048,qn:129},t);if(s.quality===s.accept_quality[0])return s;let a=s.accept_quality[0];await Ca(100,200);let p=await this.userService.getMyInfo(void 0,t);return await Ca(100,200),p.vip.type===0&&s.accept_quality[0]>=80&&(a=80),this.getPlayUrl({...e,qn:a},t)}};Fe=g(Ga),o(Fe,1,"getPlayUrl",Ya,le),o(Fe,1,"getBestQualityUrl",ka,le),c(Fe,le);import{isEmptyArr as uo}from"@ybgnb/utils";var Oe=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data,a=s.page;if(uo(s.replies)||a.count<=e.length||a.count<=a.num*a.size)return!1}return!0}updateNextPageParams(i,e,t,s){e.ps=this.options.pageSize,e.pn=i}getList(i){return i.data.replies}parsePageNum(i){if(i?.pn)return i?.pn}};import{isEmptyArr as co}from"@ybgnb/utils";var qe=class extends h{constructor(i){super({pageSize:20,...i})}hasNextPage(i,e,t){if(t!==null){if(t.data==null)return!1;let s=t.data,a=s.cursor;if(co(s.replies)||a.is_end)return!1}return!0}updateNextPageParams(i,e,t,s){if(s){let a=s.data;e.pagination_str=`{"offset":"${a.cursor.pagination_reply.next_offset}"}`}}getList(i){return i.data.replies}parsePageNum(i){}};var Wa,va,Ea,Va,_a,Na,Ma,Ia,Za,Fa,Oa,I,Y=class extends(Oa=u,Fa=[r()],Za=[r()],Ia=[r()],Ma=[r()],Na=[r()],_a=[r()],Va=[r()],Ea=[r()],va=[r()],Wa=[r()],Oa){constructor(){super(...arguments);d(I,5,this)}buildSubReplyPager(e,t,s){return this.createPager("https://api.bilibili.com/x/v2/reply/reply",new Oe({...t}),{query:{...e,platform:"web",web_location:"333.1369"},...s,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async fetchSubReplyPage(e,t,s){return await this.buildSubReplyPager(e,t,s).fetchNext()}async fetchSubPageWithNextParams(e,t,s){return await this.buildSubReplyPager(e,t,s).fetchPageWithNextParams()}async fetchSubReplyAll(e,t,s,a){return await this.buildSubReplyPager(e,t,a).fetchAllPage(s)}buildPager(e,t,s){return this.createPager("https://api.bilibili.com/x/v2/reply/wbi/main",new qe({...t}),{query:{...e,plat:1,seek_rpid:"",web_location:"1315875"},...s,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async fetchPage(e,t,s){return await this.buildPager(e,t,s).fetchNext()}async fetchPageWithNextParams(e,t,s){return await this.buildPager(e,t,s).fetchPageWithNextParams()}async fetchAll(e,t,s,a){return await this.buildPager(e,t,a).fetchAllPage(s)}async del(e,t){await this.save("https://api.bilibili.com/x/v2/reply/del",{data:{...e},...t,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async like(e,t){await this.save("https://api.bilibili.com/x/v2/reply/action",{data:{action:"1",...e,statistics:'{"appId":100,"platform":5}'},...t,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async hate(e,t){await this.save("https://api.bilibili.com/x/v2/reply/hate",{data:{action:"1",...e,statistics:'{"appId":100,"platform":5}'},...t,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}async add(e,t){return await this.save("https://api.bilibili.com/x/v2/reply/add",{data:{...e,plat:"1",at_name_to_mid:"{}",gaia_source:"main_web",statistics:'{"appId":100,"platform":5}'},...t,referer:`https://t.bilibili.com/${e.oid}?spm_id_from=333.1387.0.0`})}};I=g(Oa),o(I,1,"fetchSubReplyPage",Fa,Y),o(I,1,"fetchSubPageWithNextParams",Za,Y),o(I,1,"fetchSubReplyAll",Ia,Y),o(I,1,"fetchPage",Ma,Y),o(I,1,"fetchPageWithNextParams",Na,Y),o(I,1,"fetchAll",_a,Y),o(I,1,"del",Va,Y),o(I,1,"like",Ea,Y),o(I,1,"hate",va,Y),o(I,1,"add",Wa,Y),c(I,Y);import{fromBinary as Yo}from"@bufbuild/protobuf";import{enumDesc as V,fileDesc as go,messageDesc as m,serviceDesc as bo}from"@bufbuild/protobuf/codegenv2";var l=go("CghkbS5wcm90bxIgYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEiZAoGQXZhdGFyEgoKAmlkGAEgASgJEgsKA3VybBgCIAEoCRJBCgthdmF0YXJfdHlwZRgDIAEoDjIsLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLkF2YXRhclR5cGUiIwoGQnViYmxlEgwKBHRleHQYASABKAkSCwoDdXJsGAIgASgJIsYBCghCdWJibGVWMhIMCgR0ZXh0GAEgASgJEgsKA3VybBgCIAEoCRJBCgtidWJibGVfdHlwZRgDIAEoDjIsLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLkJ1YmJsZVR5cGUSFQoNZXhwb3N1cmVfb25jZRgEIAEoCBJFCg1leHBvc3VyZV90eXBlGAUgASgOMi4uYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuRXhwb3N1cmVU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lcnZpY2UuZG0udjEuRG1QbGF5ZXJDb25maWdSZXEaKi5iaWxpYmlsaS5jb21tdW5pdHkuc2VydmljZS5kbS52MS5SZXNwb25zZRJqCghEbVNlZ090dBItLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLkRtU2VnT3R0UmVxGi8uYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuRG1TZWdPdHRSZXBseRJqCghEbVNlZ1NESxItLmJpbGliaWxpLmNvbW11bml0eS5zZXJ2aWNlLmRtLnYxLkRtU2VnU0RLUmVxGi8uYmlsaWJpbGkuY29tbXVuaXR5LnNlcnZpY2UuZG0udjEuRG1TZWdTREtSZXBseRJ0CgxEbUV4cG9SZXBvcnQSMS5iaWxpYmlsaS5jb21tdW5pdHkuc2VydmljZS5kbS52MS5EbUV4cG9SZXBvcnRSZXEaMS5iaWxpYmlsaS5jb21tdW5pdHkuc2VydmljZS5kbS52MS5EbUV4cG9SZXBvcnRSZXNiBnByb3RvMw"),sl=m(l,0),il=m(l,1),al=m(l,2),ol=m(l,3),rl=m(l,4),nl=m(l,5),pl=m(l,6),ll=m(l,7),ml=m(l,8),ul=m(l,9),cl=m(l,10),gl=m(l,11),dl=m(l,12),bl=m(l,13),yl=m(l,14),Rl=m(l,15),hl=m(l,16),fl=m(l,17),Al=m(l,18),xl=m(l,19),Dl=m(l,20),Pl=m(l,21),Bl=m(l,22),Sl=m(l,23),wl=m(l,24),Cl=m(l,25),kl=m(l,26),Yl=m(l,27),Gl=m(l,28),Wl=m(l,29),vl=m(l,30),El=m(l,31),Vl=m(l,32),_l=m(l,33),Nl=m(l,34),Ml=m(l,35),Il=m(l,36),Zl=m(l,37),Fl=m(l,38),Ol=m(l,39),ql=m(l,40),Xl=m(l,41),Ll=m(l,42),jl=m(l,43),zl=m(l,44),Ul=m(l,45),Jl=m(l,46),Kl=m(l,47),Tl=m(l,48),Ql=m(l,49),Hl=m(l,50),$l=m(l,51),em=m(l,52),tm=m(l,53),sm=m(l,54),im=m(l,55),am=m(l,56),om=m(l,57),rm=m(l,58),nm=m(l,59),pm=m(l,60),lm=m(l,61),mm=m(l,62),um=m(l,63),cm=m(l,64),gm=m(l,65),dm=m(l,66),bm=m(l,67),ym=m(l,68),Rm=m(l,69),hm=m(l,70),fm=m(l,71),yo=(e=>(e[e.AvatarTypeNone=0]="AvatarTypeNone",e[e.AvatarTypeNFT=1]="AvatarTypeNFT",e))(yo||{}),Am=V(l,0),Ro=(t=>(t[t.BubbleTypeNone=0]="BubbleTypeNone",t[t.BubbleTypeClickButton=1]="BubbleTypeClickButton",t[t.BubbleTypeDmSettingPanel=2]="BubbleTypeDmSettingPanel",t))(Ro||{}),xm=V(l,1),ho=(t=>(t[t.CheckboxTypeNone=0]="CheckboxTypeNone",t[t.CheckboxTypeEncourage=1]="CheckboxTypeEncourage",t[t.CheckboxTypeColorDM=2]="CheckboxTypeColorDM",t))(ho||{}),Dm=V(l,2),fo=(t=>(t[t.DMAttrBitProtect=0]="DMAttrBitProtect",t[t.DMAttrBitFromLive=1]="DMAttrBitFromLive",t[t.DMAttrHighLike=2]="DMAttrHighLike",t))(fo||{}),Pm=V(l,3),Ao=(e=>(e[e.NoneType=0]="NoneType",e[e.VipGradualColor=60001]="VipGradualColor",e))(Ao||{}),Bm=V(l,4),xo=(e=>(e[e.ExposureTypeNone=0]="ExposureTypeNone",e[e.ExposureTypeDMSend=1]="ExposureTypeDMSend",e))(xo||{}),Sm=V(l,5),Do=(p=>(p[p.PostPanelBizTypeNone=0]="PostPanelBizTypeNone",p[p.PostPanelBizTypeEncourage=1]="PostPanelBizTypeEncourage",p[p.PostPanelBizTypeColorDM=2]="PostPanelBizTypeColorDM",p[p.PostPanelBizTypeNFTDM=3]="PostPanelBizTypeNFTDM",p[p.PostPanelBizTypeFragClose=4]="PostPanelBizTypeFragClose",p[p.PostPanelBizTypeRecommend=5]="PostPanelBizTypeRecommend",p))(Do||{}),wm=V(l,6),Po=(e=>(e[e.PostStatusNormal=0]="PostStatusNormal",e[e.PostStatusClosed=1]="PostStatusClosed",e))(Po||{}),Cm=V(l,7),Bo=(t=>(t[t.RenderTypeNone=0]="RenderTypeNone",t[t.RenderTypeSingle=1]="RenderTypeSingle",t[t.RenderTypeRotation=2]="RenderTypeRotation",t))(Bo||{}),km=V(l,8),So=(t=>(t[t.None=0]="None",t[t.Exposure=1]="Exposure",t[t.Assist=2]="Assist",t))(So||{}),Ym=V(l,9),wo=(e=>(e[e.Normal=0]="Normal",e[e.Translate=1]="Translate",e))(wo||{}),Gm=V(l,10),Co=(e=>(e[e.CC=0]="CC",e[e.AI=1]="AI",e))(Co||{}),Wm=V(l,11),ko=(e=>(e[e.ToastFunctionTypeNone=0]="ToastFunctionTypeNone",e[e.ToastFunctionTypePostPanel=1]="ToastFunctionTypePostPanel",e))(ko||{}),vm=V(l,12),qa=bo(l,0);import{sleepRandom as Go}from"@ybgnb/utils";var Xe=class extends u{async fetchAll(i,e){let t=(i.duration-1)/360+1,s=[];for(let a=1;a<=t;a++){let p=await this.api.fetchArrayBuffer("https://api.bilibili.com/x/v2/dm/web/seg.so",{query:{type:"1",oid:i.cid,segment_index:a},...e}),b=new Uint8Array(p),w=Yo(qa.method.dmSegMobile.output,b);s.push(...w.elems??[]),a<t&&await Go(500,1111,e?.signal)}return s}};var Le=class{get logger(){return this.config.logger}constructor(i){this.config={...Sa(i?.logLevel),...i??{}},this.api=new ze(this),this.createPager=this.api.createPager,this.request=this.api.request,this.user=new G(this.api),this.userExp=new re(this.api),this.relation=new R(this.api),this.history=new E(this.api),this.session=new N(this.api),this.sessionSettings=new k(this.api),this.message=new A(this.api),this.toview=new W(this.api),this.fav=new B(this.api),this.favCollection=new U(this.api),this.favOpus=new q(this.api),this.followBangumi=new X(this.api),this.spaceVideo=new ie(this.api),this.spaceStatus=new ne(this.api),this.spaceSettings=new pe(this.api),this.dynamic=new K(this.api),this.videoInfo=new L(this.api),this.videoAction=new M(this.api),this.videoReport=new be(this.api),this.videoRanking=new Q(this.api),this.videoPlayer=new le(this.api),this.comment=new Y(this.api),this.dm=new Xe(this.api),je.setAutoRefresh(this.config.autoMixinKey)}updateRequestContext(i){this.config.context=i}};var st=null,it=()=>(st||(st=new Le),st);var xe,Ue=null,ja=0,at,Xa=1440*60*1e3,za=!1,je={get:async()=>xe||(Ue||(Ue=Eo().catch(()=>{Ue=null})),await Ue,xe),setAutoRefresh(n){za=n}};function Wo(n,i){return Math.floor(n/Xa)!==Math.floor(i/Xa)}var vo=[46,47,18,2,53,8,23,32,15,50,10,31,58,3,45,35,27,43,5,49,33,9,42,19,29,28,14,39,12,38,41,13,37,48,7,16,24,55,40,61,26,17,0,1,60,51,30,4,22,25,54,21,56,59,6,63,57,62,11,36,20,34,44,52],ot=(n,i)=>{let e=n+i;return vo.map(t=>e[t]).join("").slice(0,32)},Eo=async()=>{await La(),at||clearInterval(at),za&&(at=setInterval(()=>{Wo(ja,Date.now())&&La()},3e5))},La=async()=>{try{let n=Date.now(),i=(await(await fetch("https://api.bilibili.com/x/web-interface/nav")).json()).data,e=a=>new URL(a).pathname.split("/").pop().replace(/\.[^.]+$/,""),t=e(i.wbi_img.img_url),s=e(i.wbi_img.sub_url);xe=ot(t,s),it().logger.info(`\u521D\u59CB\u5316 imgKey=${t} subKey=${s} mixinKey=${xe}`),ja=n}catch(n){throw it().logger.error("\u521D\u59CB\u5316 MixinKey \u5931\u8D25",n),n}};import{encodeURLParams as rt}from"@ybgnb/utils";async function Ua(n,i){let e=Math.floor(Date.now()/1e3),t=i??await je.get();return`${rt(n)}&w_rid=${Vo(rt({...n,wts:e})+t)}&wts=${e}`}async function Ja(n,i,e){try{return i||Object.keys(n).length===0?`${rt(n)}`:e?`${await Ua(n,ot(e.imgKey,e.subKey))}`:`${await Ua(n)}`}catch{throw new Error("\u67E5\u8BE2\u53C2\u6570\u65E0\u6548")}}import{mergeQueryParams as _o,parseUrl as No,sleep as Mo}from"@ybgnb/utils";var Je=class extends me{constructor(e,t,s){super(e);this.list=[];this.lastApiResponse=null;this.pageStrategy=t,t.options.pageNum!==void 0?this.nextPageNum=t.options.pageNum:this.nextPageNum=1;let{baseUrl:a,searchParams:p}=No(s.url);this.requestParams=Object.assign(_o(p,s.query)),this.requestOptions={...s,url:a,query:this.requestParams,returnFormat:"ApiResponse"}}mergeRequestOptions(e){this.requestParams={...this.requestParams,...e?.query},this.requestOptions={...this.requestOptions,...e,query:this.requestParams,returnFormat:"ApiResponse"}}async fetchNext(e){if(this.mergeRequestOptions(e),!this.pageStrategy.hasNextPage(this.nextPageNum,this.list,this.lastApiResponse))return null;this.pageStrategy.updateNextPageParams(this.nextPageNum,this.requestParams,this.list,this.lastApiResponse),this.lastApiResponse===null&&(this.nextPageNum===1||this.nextPageNum===this.pageStrategy.options.pageNum)&&Object.assign(this.requestParams,this.pageStrategy.options.pageParams);let t=await this.get(this.requestOptions.url,this.requestOptions);if(this.lastApiResponse=t,t.data==null)return null;this.nextPageNum++;let s=this.pageStrategy.getList(t)??[];return s.length<=0?null:(this.list.push(...s),s)}async fetchPageWithNextParams(e){return{items:await this.fetchNext(e),nextParams:this.getNextPageParams(),hasNext:this.pageStrategy.hasNextPage(this.nextPageNum,this.list,this.lastApiResponse),pageSize:this.pageStrategy.options.pageSize,total:this.pageStrategy.getTotal?.(this.lastApiResponse)??void 0}}getRequestDelay(e){return typeof e?.delay=="function"?e.delay(this.nextPageNum):typeof e?.delay=="number"?e.delay:1122}async fetchAllPage(e,t){for(this.mergeRequestOptions(t),this.nextPageNum=1,this.list=[],this.lastApiResponse=null;!this.requestOptions.signal?.aborted;){let s=await this.fetchNext(t);if(s===null||e&&await e(s,this.list)===!1)break;await Mo(this.getRequestDelay(t),this.requestOptions.signal)}return this.list}getNextPageParams(){let e={};return this.pageStrategy.updateNextPageParams(this.nextPageNum,e,this.list,this.lastApiResponse),e}getPageSize(){return this.pageStrategy.options.pageSize}};import{mergeQueryParams as Io,parseUrl as Zo,createAbortError as Ka,isCanceledError as Fo,getErrorMessage as Oo}from"@ybgnb/utils";var ze=class{constructor(i){this.client=i;this.logApiSuccess=(i,e,t,s)=>{if(e==="RawResponse")this.logger.info(`${i} \u8BF7\u6C42\u6210\u529F`);else{let a=s||this.isDebug?JSON.stringify(t):"";e==="ApiResponse"?this.logger.info(`${i} \u8BF7\u6C42\u6210\u529F`,a):this.logger.info(`${i} \u8BF7\u6C42\u6210\u529F`,a)}};this.logApiError=(i,e)=>{Fo(e)?this.logger.info(`${i} [${Oo(e)}]`):e instanceof ae?this.logger.info(`${i} [http error]\uFF1A${e.message}(${e.status})`):e instanceof S?this.logger.info(`${i} ${e.message}`):this.logger.info(`${i} \u51FA\u73B0\u672A\u77E5\u9519\u8BEF`,e)};this.buildFinalUrl=async(i,e)=>{let{baseUrl:t,searchParams:s}=Zo(i.url),a=Io(s,i.query),p=await Ja(a,i.skipWbiSign,i.wbiSignKeys);return i.logRequestParams?this.logger.info(`${e} \u8BF7\u6C42\u4E2D ${p}`):this.logger.info(`${e} \u8BF7\u6C42\u4E2D...`),p&&p.length>0?`${t}?${p}`:t};this.buildRequestBody=async i=>{let e=i.data;if(e)if(typeof e=="object"){if(!(e instanceof Blob)){if(!(e instanceof URLSearchParams)){if(!(e instanceof FormData)){let t={};Object.keys(e).forEach(function(s){if(e!=null){let a=e[s];a!=null&&(t[s]=String(a))}}),e=new URLSearchParams(t)}}}}else typeof e=="string"&&(i.init={...i.init},i.init.headers={...i.init.headers,"Content-Type":"application/json"});return i.method==="POST"&&e&&i.autoCsrf&&e instanceof URLSearchParams&&e.set("csrf",this.clientConfig.context?.userCookie.bili_jct??""),e};this.buildRequestInit=async(i,e)=>{let{context:t,userAgent:s,timeout:a,referer:p}=this.clientConfig;return{signal:i?.signal?AbortSignal.any([i?.signal,AbortSignal.timeout(a)]):AbortSignal.timeout(a),method:i.method,body:e,...i?.init??{},credentials:"include",headers:{"User-Agent":s,origin:"https://t.bilibili.com",cookie:i.cookie?.cookie||t?.userCookie.cookie||"",Referer:i.referer??(typeof p=="function"?p(i.url):p),...i?.init?.headers??{}}}};this.executeRequest=async(i,e)=>{i.url=await this.buildFinalUrl(i,e);let t=await this.buildRequestBody(i);t&&this.logger.debug(`${e} \u8BF7\u6C42\u4F53`,JSON.stringify(t));let s=await this.buildRequestInit(i,t);return await(this.clientConfig.fetcher??fetch)(i.url,s)};this.request=async(i,e)=>{if(e?.signal?.aborted)throw Ka();let t={...wa,url:i,...e},s=this.buildLogPrefix(t);try{let a=await this.executeRequest(t,s);if(!a.ok)throw new ae(this.clientConfig,t,a);if(t.returnFormat==="RawResponse")return this.logApiSuccess(s,"RawResponse",a,t.logResponseData),a;let p;try{p=await a.json()}catch(b){throw new ae(this.clientConfig,t,a,"\u89E3\u6790\u54CD\u5E94\u6570\u636E\u9519\u8BEF",b)}if(!t.ignoreBusinessError&&p.code!==0)throw new Be(this.clientConfig,t,p);return t.returnFormat==="ApiResponse"?(this.logApiSuccess(s,"ApiResponse",p,t.logResponseData),p):(this.logApiSuccess(s,"ApiResponseData",p.data,t.logResponseData),p.data)}catch(a){throw this.logApiError(s,a),a}};this.fetchRaw=async(i,e)=>{if(e?.signal?.aborted)throw Ka();let t={...tt,url:i,...e},s=this.buildLogPrefix(t),a=t.responseType;try{let p=await this.executeRequest(t,s);if(!p.ok)throw new ae(this.clientConfig,t,p);return this.logApiSuccess(s,"RawResponse",p,t.logResponseData),a==="json"?await p.json():a==="text"?await p.text():a==="blob"?await p.blob():a==="arrayBuffer"?await p.arrayBuffer():await p.formData()}catch(p){throw this.logApiError(s,p),p}};this.fetchText=async(i,e)=>this.fetchRaw(i,{...e,responseType:"text"});this.fetchBlob=async(i,e)=>this.fetchRaw(i,{...e,responseType:"blob"});this.fetchArrayBuffer=async(i,e)=>this.fetchRaw(i,{...e,responseType:"arrayBuffer"});this.fetchFormData=async(i,e)=>this.fetchRaw(i,{...e,responseType:"formData"});this.get=async(i,e)=>this.request(i,{...e,method:"GET"});this.post=async(i,e)=>this.request(i,{...e,method:"POST"});this.save=async(i,e)=>this.request(i,{...e,method:"POST",skipWbiSign:!1,autoCsrf:!0});this.createPager=(i,e,t)=>new Je(this,e,{url:i,...t})}get clientConfig(){return this.client.config}get logger(){return this.clientConfig.logger}get isDebug(){return this.clientConfig.logLevel==="debug"}buildLogPrefix(i){let e=this.clientConfig.context?.userCookie.uid;return`[bili API]${e?` [${e}]`:""} ${i.method} ${new URL(i.url).pathname}`}};var Eu=".bilibili.com",Vu=["SESSDATA","bili_jct","DedeUserID","DedeUserID__ckMd5","sid","buvid3","buvid4"];function Nu(n){switch(n.attr&3){case 0:return"default_public";case 1:return"default_private";case 2:return"other_public";case 3:return"other_private";default:return"default_public"}}function Mu(n){let i=n.attr&3;return i===0||i===1?5e4-n.media_count:1e3-n.media_count}var Ta=class extends u{};var Ou={archive:{type:"archive",name:"\u7A3F\u4EF6"},pgc:{type:"pgc",name:"\u5267\u96C6"},live:{type:"live",name:"\u76F4\u64AD"},articleList:{type:"article-list",name:"\u6587\u96C6"},article:{type:"article",name:"\u4E13\u680F"}};var Xu={phone:[1,3,5,7],web:[2],pad:[4,6],tv:[33],other:[0]};var ju={DYNAMIC_TYPE_NONE:{type:"DYNAMIC_TYPE_NONE",description:"\u65E0\u6548\u52A8\u6001"},DYNAMIC_TYPE_FORWARD:{type:"DYNAMIC_TYPE_FORWARD",description:"\u52A8\u6001\u8F6C\u53D1"},DYNAMIC_TYPE_AV:{type:"DYNAMIC_TYPE_AV",description:"\u6295\u7A3F\u89C6\u9891"},DYNAMIC_TYPE_PGC:{type:"DYNAMIC_TYPE_PGC",description:"\u5267\u96C6\uFF08\u756A\u5267\u3001\u7535\u5F71\u3001\u7EAA\u5F55\u7247\uFF09"},DYNAMIC_TYPE_COURSES:{type:"DYNAMIC_TYPE_COURSES",description:""},DYNAMIC_TYPE_WORD:{type:"DYNAMIC_TYPE_WORD",description:"\u7EAF\u6587\u5B57\u52A8\u6001"},DYNAMIC_TYPE_DRAW:{type:"DYNAMIC_TYPE_DRAW",description:"\u5E26\u56FE\u52A8\u6001"},DYNAMIC_TYPE_ARTICLE:{type:"DYNAMIC_TYPE_ARTICLE",description:"\u6295\u7A3F\u4E13\u680F"},DYNAMIC_TYPE_MUSIC:{type:"DYNAMIC_TYPE_MUSIC",description:"\u97F3\u4E50"},DYNAMIC_TYPE_COMMON_SQUARE:{type:"DYNAMIC_TYPE_COMMON_SQUARE",description:"\u88C5\u626E / \u5267\u96C6\u70B9\u8BC4 / \u666E\u901A\u5206\u4EAB"},DYNAMIC_TYPE_COMMON_VERTICAL:{type:"DYNAMIC_TYPE_COMMON_VERTICAL",description:""},DYNAMIC_TYPE_LIVE:{type:"DYNAMIC_TYPE_LIVE",description:"\u76F4\u64AD\u95F4\u5206\u4EAB"},DYNAMIC_TYPE_MEDIALIST:{type:"DYNAMIC_TYPE_MEDIALIST",description:"\u6536\u85CF\u5939"},DYNAMIC_TYPE_COURSES_SEASON:{type:"DYNAMIC_TYPE_COURSES_SEASON",description:"\u8BFE\u7A0B"},DYNAMIC_TYPE_COURSES_BATCH:{type:"DYNAMIC_TYPE_COURSES_BATCH",description:""},DYNAMIC_TYPE_AD:{type:"DYNAMIC_TYPE_AD",description:""},DYNAMIC_TYPE_APPLET:{type:"DYNAMIC_TYPE_APPLET",description:""},DYNAMIC_TYPE_SUBSCRIPTION:{type:"DYNAMIC_TYPE_SUBSCRIPTION",description:""},DYNAMIC_TYPE_LIVE_RCMD:{type:"DYNAMIC_TYPE_LIVE_RCMD",description:"\u76F4\u64AD\u5F00\u64AD"},DYNAMIC_TYPE_BANNER:{type:"DYNAMIC_TYPE_BANNER",description:""},DYNAMIC_TYPE_UGC_SEASON:{type:"DYNAMIC_TYPE_UGC_SEASON",description:"\u5408\u96C6\u66F4\u65B0"},DYNAMIC_TYPE_SUBSCRIPTION_NEW:{type:"DYNAMIC_TYPE_SUBSCRIPTION_NEW",description:""}};var Uu={AUTHOR_TYPE_NONE:"",AUTHOR_TYPE_NORMAL:"\u666E\u901A\u66F4\u65B0",AUTHOR_TYPE_PGC:"\u5267\u96C6\u66F4\u65B0",AUTHOR_TYPE_UGC_SEASON:"\u5408\u96C6\u66F4\u65B0"};var Qu={reply_video:{name:"\u8BC4\u8BBA",type:"reply",id:1},reply_dynamic:{name:"\u52A8\u6001",type:"dynamic",id:11},reply_comment:{name:"\u8BC4\u8BBA",type:"reply",id:17},reply_article:{name:"\u8BC4\u8BBA",type:"reply",id:12},like_reply:{name:"\u8BC4\u8BBA",type:"reply",id:0},like_dynamic:{name:"\u52A8\u6001",type:"dynamic",id:0}};var $u={followed:1,keys:2,recv:3,voyage:5};var tc={unknown:{code:0,name:"\u672A\u77E5\u6765\u6E90"},ios:{code:1,name:"iOS"},android:{code:2,name:"Android"},h5:{code:3,name:"H5"},pc_client:{code:4,name:"PC\u5BA2\u6237\u7AEF"},official_push_msg:{code:5,name:"\u5B98\u65B9\u63A8\u9001\u6D88\u606F"},push_notify_msg:{code:6,name:"\u63A8\u9001/\u901A\u77E5\u6D88\u606F"},web:{code:7,name:"Web"},auto_reply_followed:{code:8,name:"\u81EA\u52A8\u56DE\u590D - \u88AB\u5173\u6CE8\u56DE\u590D"},auto_reply_recv:{code:9,name:"\u81EA\u52A8\u56DE\u590D - \u6536\u5230\u6D88\u606F\u56DE\u590D"},auto_reply_keyword:{code:10,name:"\u81EA\u52A8\u56DE\u590D - \u5173\u952E\u8BCD\u56DE\u590D"},auto_reply_voyage:{code:11,name:"\u81EA\u52A8\u56DE\u590D - \u5927\u822A\u6D77\u4E0A\u8239\u56DE\u590D"},up_gift_msg:{code:12,name:"\u81EA\u52A8\u63A8\u9001 - UP\u4E3B\u8D60\u8A00"},fans_group_system:{code:13,name:"\u7C89\u4E1D\u56E2\u7CFB\u7EDF\u63D0\u793A"},system:{code:16,name:"\u7CFB\u7EDF"},mutual_follow:{code:17,name:"\u4E92\u76F8\u5173\u6CE8"},system_hint:{code:18,name:"\u7CFB\u7EDF\u63D0\u793A"},ai:{code:19,name:"AI"}};var ic={fav_video:"\u516C\u5F00\u6211\u7684\u6536\u85CF",user_info:"\u516C\u5F00\u6211\u7684\u751F\u65E5\u3001\u4E2A\u4EBA\u6807\u7B7E",comic:"\u516C\u5F00\u6211\u7684\u8FFD\u6F2B(\u4EC5APP)",bangumi:"\u516C\u5F00\u8FFD\u756A\u8FFD\u5267",disable_show_school:"\u516C\u5F00\u5B66\u6821\u4FE1\u606F",dress_up:"\u516C\u5F00\u62E5\u6709\u7684\u7C89\u4E1D\u88C5\u626E\uFF08\u4EC5APP\uFF09",coins_video:"\u516C\u5F00\u6700\u8FD1\u6295\u5E01\u7684\u89C6\u9891",played_game:"\u516C\u5F00\u6700\u8FD1\u73A9\u8FC7\u7684\u6E38\u620F",channel:"\u6295\u7A3F\u89C6\u9891\u5217\u8868\u4E2D\u5C55\u73B0\u76F4\u64AD\u56DE\u653E",likes_video:"\u516C\u5F00\u6700\u8FD1\u70B9\u8D5E\u7684\u89C6\u9891",close_space_medal:"\u516C\u5F00\u4F69\u6234\u7684\u7C89\u4E1D\u52CB\u7AE0",lesson_video:"\u6295\u7A3F\u89C6\u9891\u5217\u8868\u4E2D\u5C55\u73B0\u8BFE\u5802\u89C6\u9891",disable_following:"\u7981\u6B62\u516C\u5F00\u6211\u7684\u5173\u6CE8\u5217\u8868",only_show_wearing:"\u52CB\u7AE0\u5899\u516C\u5F00\u663E\u793A\u6240\u6709\u7C89\u4E1D\u52CB\u7AE0",charge_video:"\u6295\u7A3F\u89C6\u9891\u5217\u8868\u4E2D\u5C55\u73B0\u5305\u6708\u5145\u7535\u4E13\u5C5E\u89C6\u9891",disable_show_fans:"\u7981\u6B62\u516C\u5F00\u6211\u7684\u7C89\u4E1D\u5217\u8868",bbq:"\u516C\u5F00\u8F7B\u89C6\u9891\uFF1F",groups:"\u5708\u5B50\uFF1F",live_playback:"\u516C\u5F00\u6211\u7684\u76F4\u64AD\u56DE\u653E\uFF1F",tags:"\u516C\u5F00\u8BA2\u9605\u6807\u7B7E\uFF1F"};var oc={NORMAL:0,BLOCKED:1};var nc={NONE:0,MONTH:1,YEAR:2},pc={NONE:0,YES:1};export{ke as AtMsgPageStrategy,Uu as AuthorTypeMap,$u as AutoReplyTypeMap,sl as AvatarSchema,yo as AvatarType,Am as AvatarTypeSchema,Eu as BILIBILI_COOKIE_DOMAIN,ze as BaseApi,h as BasePageStrategy,u as BaseService,Be as BiliApiBusinessError,Pe as BiliApiError,ae as BiliApiHttpError,Le as BiliClient,S as BiliError,il as BubbleSchema,Ro as BubbleType,xm as BubbleTypeSchema,al as BubbleV2Schema,Ou as BusinessMap,ol as ButtonSchema,rl as BuzzwordConfigSchema,nl as BuzzwordShowConfigSchema,r as CatchError,pl as CheckBoxSchema,ll as CheckBoxV2Schema,ho as CheckboxType,Dm as CheckboxTypeSchema,ml as ClickButtonSchema,ul as ClickButtonV2Schema,cl as CommandDmSchema,Y as CommentService,qa as DM,fo as DMAttrBit,Pm as DMAttrBitSchema,Xe as DMService,gl as DanmakuAIFlagSchema,dl as DanmakuElemSchema,yl as DanmakuFlagConfigSchema,bl as DanmakuFlagSchema,Rl as DanmuDefaultPlayerConfigSchema,fl as DanmuPlayerConfigPanelSchema,hl as DanmuPlayerConfigSchema,Al as DanmuPlayerDynamicConfigSchema,xl as DanmuPlayerViewConfigSchema,Dl as DanmuWebPlayerConfigSchema,Xu as DeviceTypeCodeMap,Pl as DmColorfulSchema,Ao as DmColorfulType,Bm as DmColorfulTypeSchema,Bl as DmExpoReportReqSchema,Sl as DmExpoReportResSchema,wl as DmPlayerConfigReqSchema,Cl as DmSegConfigSchema,kl as DmSegMobileReplySchema,Yl as DmSegMobileReqSchema,Gl as DmSegOttReplySchema,Wl as DmSegOttReqSchema,vl as DmSegSDKReplySchema,El as DmSegSDKReqSchema,Vl as DmViewReplySchema,_l as DmViewReqSchema,Nl as DmWebViewReplySchema,_e as DynamicPageStrategy,K as DynamicService,ju as DynamicTypeMap,Ml as ExpoReportSchema,xo as ExposureType,Sm as ExposureTypeSchema,Il as ExpressionSchema,Zl as ExpressionsSchema,U as FavCollectionService,Ee as FavOpusPageStrategy,q as FavOpusService,B as FavService,X as FollowBangumiService,ce as FollowBangumiStatusMap,_n as FollowBangumiTypeMap,ee as HasMorePageStrategy,we as HistoryPageStrategy,E as HistoryService,Fl as InlinePlayerDanmakuSwitchSchema,Ol as LabelSchema,ql as LabelV2Schema,Ye as LikeMsgPageStrategy,ue as ListPageStrategy,Qu as MessageBusinessMap,A as MessageService,tc as MsgSourceMap,Je as PageApi,Xl as PeriodSchema,Ll as PlayerDanmakuAiRecommendedLevelSchema,jl as PlayerDanmakuAiRecommendedLevelV2Schema,zl as PlayerDanmakuAiRecommendedSwitchSchema,Ul as PlayerDanmakuBlockbottomSchema,Jl as PlayerDanmakuBlockcolorfulSchema,Kl as PlayerDanmakuBlockrepeatSchema,Tl as PlayerDanmakuBlockscrollSchema,Ql as PlayerDanmakuBlockspecialSchema,Hl as PlayerDanmakuBlocktopSchema,$l as PlayerDanmakuDomainSchema,em as PlayerDanmakuEnableblocklistSchema,tm as PlayerDanmakuOpacitySchema,sm as PlayerDanmakuScalingfactorSchema,im as PlayerDanmakuSeniorModeSwitchSchema,am as PlayerDanmakuSpeedSchema,rm as PlayerDanmakuSwitchSaveSchema,om as PlayerDanmakuSwitchSchema,nm as PlayerDanmakuUseDefaultConfigSchema,Do as PostPanelBizType,wm as PostPanelBizTypeSchema,pm as PostPanelSchema,lm as PostPanelV2Schema,Po as PostStatus,Cm as PostStatusSchema,ic as PrivacySettingsMap,H as RelationActMap,nr as RelationAttributeMap,R as RelationService,fe as RelationSourceMap,Bo as RenderType,km as RenderTypeSchema,Ce as ReplyMsgPageStrategy,qe as ReplyPageStrategy,mm as ResponseSchema,$ as ResponseWithTotalStrategy,We as SessionPageStrategy,N as SessionService,k as SessionSettingsService,oc as SilenceStatusMap,pe as SpaceSettingsService,ne as SpaceStatusService,Ve as SpaceVPageStrategy,ie as SpaceVideoService,Me as SpecifyHasMorePageStrategy,Oe as SubReplyPageStrategy,So as SubtitleAiStatus,Ym as SubtitleAiStatusSchema,wo as SubtitleAiType,Gm as SubtitleAiTypeSchema,um as SubtitleItemSchema,Co as SubtitleType,Wm as SubtitleTypeSchema,Ge as SystemMsgPageStrategy,cm as TextInputSchema,gm as TextInputV2Schema,ve as ToViewPageStrategy,W as ToViewService,bm as ToastButtonV2Schema,ko as ToastFunctionType,vm as ToastFunctionTypeSchema,dm as ToastSchema,ym as ToastV2Schema,Vu as USER_COOKIE_NAMES,re as UserExpService,Rm as UserInfoSchema,G as UserService,M as VideoActionService,L as VideoInfoService,hm as VideoMaskSchema,le as VideoPlayerService,Q as VideoRankingService,be as VideoReportService,fm as VideoSubtitleSchema,Ta as VideoUploadService,pc as VipStatusMap,nc as VipTypeMap,me as WithApi,wa as defaultApiRequestOptions,tt as defaultBaseRequestOptions,l as file_dm,ot as generateMixinKey,it as getCommonBiliClient,Sa as getDefaultClientConfig,Mu as getFavFolderRemaining,Nu as getFavFolderType,Ja as handleUrlParams,bt as loginUserWithQRCode,je as mixinKeyStore,yt as parseUserCookie,Ua as wbiSign};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ybgnb/bili-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "bilibili 的 Node.js 接口封装库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"packageManager": "pnpm@10.30.3",
|
|
44
44
|
"dependencies": {
|
|
45
|
+
"@bufbuild/protobuf": "^2.12.1",
|
|
45
46
|
"@ybgnb/utils": "^0.2.8",
|
|
46
47
|
"md5": "^2.3.0"
|
|
47
48
|
},
|