-(()=>{let r=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(i,e,p=!0,a=null,l=null){let{host:n,pathname:o}=new URL(e.startsWith("//")?"https:"+e:e);switch(i){case"GET":if(n==="api.live.bilibili.com"&&o==="/xlive/app-blink/v1/live/GetWebLivePermission"){let s=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"responseText")?.get;Object.defineProperty(this,"responseText",{get(){let t=JSON.parse(s?.call(this));return t.data.allow_live=!0,JSON.stringify(t)}})}break;case"POST":n==="api.live.bilibili.com"&&o==="/room/v1/Room/startLive"&&(this.send=s=>{let t=new URLSearchParams(s);t.set("platform","ios"),XMLHttpRequest.prototype.send.call(this,t.toString())});break}r.call(this,i,e,p,a,l)}})();
0 commit comments