import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DCQ3KkFK.mjs";const n={path:`/check-cookie`,description:`检查 bilibili cookie 是否有效`,maintainers:[`DIYgod`],handler:r};async function r(){let n=await t.getCookie();if(!n)return{code:-1};let r=await e(`https://api.bilibili.com/x/web-interface/nav`,{headers:{Referer:`https://space.bilibili.com/1/`,Cookie:n}}),i=r.code===0&&!!r.data.mid,a=await e(`https://api.bilibili.com/x/player/wbi/v2?bvid=BV1iU411o7R2&cid=1550543560`,{headers:{Referer:`https://www.bilibili.com/video/BV1iU411o7R2`,Cookie:n}}),o=a?.data?.subtitle?.subtitles||[],s=a?.data?.permission!==`0`&&o.length>0;return{code:i&&s?0:-1}}export{n as apiRoute};