(()=>{return(t,o)=>{const e=()=>document.URL.replace(location.search,"").match(/https:\/\/live\.bilibili\.com\/record\/(.+)/);return{widget:{content:`\n`,condition:async()=>{const t=e();return Boolean(t)},success:()=>{const t=dq("#download-live-records");t.addEventListener("click",async()=>{try{t.disabled=true;const o=e()[1];const n=await Ajax.getJson(`https://api.live.bilibili.com/xlive/web-room/v1/record/getLiveRecordUrl?rid=${o}&platform=html5`);if(n.code!==0){logError(new Error(`获取录像链接失败: ${n.message}`));return}const i=n.data.list.map(t=>t.url);Toast.success(i.map(t=>`${t}`).join("\n"),"下载录像")}catch(t){logError(t)}finally{t.disabled=false}})}}}}})();