mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
695 B
JavaScript
1 line
695 B
JavaScript
(()=>(n,o)=>{const e=()=>new Promise((async(n,o)=>{await SpinQuery.condition((()=>unsafeWindow),(()=>unsafeWindow.onLoginInfoLoaded!==undefined));if(unsafeWindow.onLoginInfoLoaded){unsafeWindow.onLoginInfoLoaded(n)}else{logError(new Error("utils.playerReady 失败"));console.error(`typeof onLoginInfoLoaded === ${typeof unsafeWindow.onLoginInfoLoaded}`);o()}}));const i=async()=>{if(unsafeWindow.aid){return unsafeWindow.aid}if(_.has(unsafeWindow,"player.getVideoMessage")){const n=await SpinQuery.condition((()=>unsafeWindow.player.getVideoMessage()),(n=>n.aid!==undefined));unsafeWindow.aid=n.aid;return n.aid}throw new Error("Cannot find aid")};return{export:{playerReady:e,aidReady:i}}})(); |