Skip to content

Commit babfd9e

Browse files
committed
🐛 fix: face auth qrcode
fix #5
1 parent 8480156 commit babfd9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/index.user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
// @connect api.live.bilibili.com
1818
// @connect *
1919
// ==/UserScript==
20-
(()=>{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)}})();
20+
(()=>{let o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(i,e,p=!0,a=null,l=null){let{host:n,pathname:r}=new URL(e.startsWith("//")?"https:"+e:e);switch(i){case"GET":if(n==="api.live.bilibili.com"&&r==="/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"&&r==="/room/v1/Room/startLive"&&(this.send=s=>{let t=new URLSearchParams(s);t.set("platform","pc_link"),XMLHttpRequest.prototype.send.call(this,t.toString())});break}o.call(this,i,e,p,a,l)}})();

src/index.user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
this.send = (body: string) => {
4343
const searchParams = new URLSearchParams(body);
4444

45-
searchParams.set("platform", "ios");
45+
searchParams.set("platform", "pc_link");
4646
XMLHttpRequest.prototype.send.call(this, searchParams.toString());
4747
};
4848
}

0 commit comments

Comments
 (0)