skmcj / dycast

抖音弹幕姬,只需输入房间号,即可实时获取对应直播间的弹幕信息,并可将其转发到自己的后端服务
312 stars 83 forks source link

链接直播间失败,获取res.data不正确 #16

Open moxixuan opened 5 months ago

moxixuan commented 5 months ago

hi,我把项目发到腾讯云后(也是通过ngnix代理的),链接直播间房间返回“连接失败”,我把res.data通过console.log(res.data);打印到控制台,发现res.data数据好像跟要解析的matchRes没有对应上,请问作者知道原因吗?

    location /dy {
        proxy_buffer_size 128k;
        proxy_buffers   32 128k;
        proxy_busy_buffers_size 256k;
        proxy_pass https://live.douyin.com/;
    }

haqHB5pFoT

<html><head><meta charset="UTF-8" /></head><body></body> <script> var glb;(glb="undefined"==typeof window?global:window)._$jsvmprt=function(b,e,f){function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(b){return!1}}function d(b,e,f){return(d=a()?Reflect.construct:function(b,e,f){var a=[null];a.push.apply(a,e);var d=new(Function.bind.apply(b,a));return f&&c(d,f.prototype),d}).apply(null,arguments)}function c(b,e){return(c=Object.setPrototypeOf||function(b,e){return b.__proto__=e,b})(b,e)}function n(b){return function(b){if(Array.isArray(b)){for(var e=0,f=new Array(b.length);e<b.length;e++)f[e]=b[e];return f}}(b)||function(b){if(Symbol.iterator in Object(b)||"[object Arguments]"===Object.prototype.toString.call(b))return Array.from(b)}(b)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}for(var i=[],r=0,t=[],o=0,l=function(b,e){var f=b[e++],a=b[e],d=parseInt(""+f+a,16);if(d>>7==0)return[1,d];if(d>>6==2){var c=parseInt(""+b[++e]+b[++e],16);return d&=63,[2,c=(d<<=8)+c]}if(d>>6==3){var n=parseInt(""+b[++e]+b[++e],16),i=parseInt(""+b[++e]+b[++e],16);return d&=63,[3,i=(d<<=16)+(n<<=8)+i]}},u=function(b,e){var f=parseInt(""+b[e]+b[e+1],16);return f=f>127?-256+f:f},s=function(b,e){var f=parseInt(""+b[e]+b[e+1]+b[e+2]+b[e+3],16);return f=f>32767?-65536+f:f},p=function(b,e){var f=parseInt(""+b[e]+b[e+1]+b[e+2]+b[e+3]+b[e+4]+b[e+5]+b[e+6]+b[e+7],16);return f=f>2147483647?0+f:f},y=function(b,e){return parseInt(""+b[e]+b[e+1],16)},v=function(b,e){return parseInt(""+b[e]+b[e+1]+b[e+2]+b[e+3],16)},g=g||this||window,h=Object.keys||function(b){var e={},f=0;for(var a in b)e[f++]=a;return e.length=f,e},m=(b.length,0),I="",C=m;C<m+16;C++){var q=""+b[C++]+b[C];q=parseInt(q,16),I+=String.fromCharCode(q)}if("HNOJ@?RC"!=I)throw new Error("error magic number "+I);m+=16;parseInt(""+b[m]+b[m+1],16);m+=8,r=0;for(var w=0;w<4;w++){var S=m+2*w,R=""+b[S++]+b[S],x=parseInt(R,16);r+=(3&x)<<2*w}m+=16,m+=8;var z=parseInt(""+b[m]+b[m+1]+b[m+2]+b[m+3]+b[m+4]+b[m+5]+b[m+6]+b[m+7],16),O=z,E=m+=8,j=v(b,m+=z);j[1];m+=4,i={p:[],q:[]};for(var A=0;A<j;A++){for(var D=l(b,m),T=m+=2*D[0],$=i.p.length,P=0;P<D[1];P++){var U=l(b,T);i.p.push(U[1]),T+=2*U[0]}m=T,i.q.push([$,i.p.length])}var _={5:1,6:1,70:1,22:1,23:1,37:1,73:1},k={72:1},M={74:1},H={11:1,12:1,24:1,26:1,27:1,31:1},J={10:1},N={2:1,29:1,30:1,20:1},B=[],W=[];function F(b,e,f){for(var a=e;a<e+f;){var d=y(b,a);B[a]=d,a+=2;k[d]?(W[a]=u(b,a),a+=2):_[d]?(W[a]=s(b,a),a+=4):M[d]?(W[a]=p(b,a),a+=8):H[d]?(W[a]=y(b,a),a+=2):J[d]?(W[a]=v(b,a),a+=4):N[d]&&(W[a]=v(b,a),a+=4)}}return K(b,E,O/2,[],e,f);function G(b,e,f,a,c,l,m,I){null==l&&(l=this);var C,q,w,S=[],R=0;m&&(C=m);var x,z,O=e,E=O+2*f;if(!I)for(;O<E;){var j=parseInt(""+b[O]+b[O+1],16);O+=2;var A=3&(x=13*j%241);if(x>>=2,A<1){A=3&x;if(x>>=2,A>2)(A=x)>10?S[++R]=void 0:A>1?(C=S[R--],S[R]=S[R]>=C):A>-1&&(S[++R]=null);else if(A>1){if((A=x)>11)throw S[R--];if(A>7){for(C=S[R--],z=v(b,O),A="",P=i.q[z][0];P<i.q[z][1];P++)A+=String.fromCharCode(r^i.p[P]);O+=4,S[R--][A]=C}else A>5&&(S[R]=h(S[R]))}else if(A>0){(A=x)>8?(C=S[R--],S[R]=typeof C):A>6?S[R]=--S[R]:A>4?S[R-=1]=S[R][S[R+1]]:A>2&&(q=S[R--],(A=S[R]).x===G?A.y>=1?S[R]=K(b,A.c,A.l,[q],A.z,w,null,1):(S[R]=K(b,A.c,A.l,[q],A.z,w,null,0),A.y++):S[R]=A(q))}else{if((A=x)>14)z=s(b,O),(U=function e(){var f=arguments;return e.y>0?K(b,e.c,e.l,f,e.z,this,null,0):(e.y++,K(b,e.c,e.l,f,e.z,this,null,0))}).c=O+4,U.l=z-2,U.x=G,U.y=0,U.z=c,S[R]=U,O+=2*z-2;else if(A>12)q=S[R--],w=S[R--],(A=S[R--]).x===G?A.y>=1?S[++R]=K(b,A.c,A.l,q,A.z,w,null,1):(S[++R]=K(b,A.c,A.l,q,A.z,w,null,0),A.y++):S[++R]=A.apply(w,q);else if(A>5)C=S[R--],S[R]=S[R]!=C;else if(A>3)C=S[R--],S[R]=S[R]*C;else if(A>-1)return[1,S[R--]]}}else if(A<2){A=3&x;if(x>>=2,A<1){if((A=x)>9);else if(A>7)C=S[R--],S[R]=S[R]&C;else if(A>5)z=y(b,O),O+=2,S[R-=z]=0===z?new S[R]:d(S[R],n(S.slice(R+1,R+z+1)));else if(A>3){z=s(b,O);try{if(t[o][2]=1,1==(C=G(b,O+4,z-3,[],c,l,null,0))[0])return C}catch(m){if(t[o]&&t[o][1]&&1==(C=G(b,t[o][1][0],t[o][1][1],[],c,l,m,0))[0])return C}finally{if(t[o]&&t[o][0]&&1==(C=G(b,t[o][0][0],t[o][0][1],[],c,l,null,0))[0])return C;t[o]=0,o--}O+=2*z-2}}else if(A<2){if((A=x)>12)S[++R]=u(b,O),O+=2;else if(A>10)C=S[R--],S[R]=S[R]<<C;else if(A>8){for(z=v(b,O),A="",P=i.q[z][0];P<i.q[z][1];P++)A+=String.fromCharCode(r^i.p[P]);O+=4,S[R]=S[R][A]}else A>6&&(q=S[R--],C=delete S[R--][q])}else if(A<3){(A=x)<2?S[++R]=C:A<4?(C=S[R--],S[R]=S[R]<=C):A<11?(C=S[R-=2][S[R+1]]=S[R+2],R--):A<13&&(C=S[R],S[++R]=C)}else{if((A=x)>12)S[++R]=l;else if(A>5)C=S[R--],S[R]=S[R]!==C;else if(A>3)C=S[R--],S[R]=S[R]/C;else if(A>1){if((z=s(b,O))<0){I=1,F(b,e,2*f),O+=2*z-2;break}O+=2*z-2}else A>-1&&(S[R]=!S[R])}}else if(A<3){A=3&x;if(x>>=2,A>2)(A=x)>7?(C=S[R--],S[R]=S[R]|C):A>5?(z=y(b,O),O+=2,S[++R]=c["$"+z]):A>3&&(z=s(b,O),t[o][0]&&!t[o][2]?t[o][1]=[O+4,z-3]:t[o++]=[0,[O+4,z-3],0],O+=2*z-2);else if(A>1){if((A=x)<2){for(z=v(b,O),C="",P=i.q[z][0];P<i.q[z][1];P++)C+=String.fromCharCode(r^i.p[P]);S[++R]=C,O+=4}else if(A<4)if(S[R--])O+=4;else{if((z=s(b,O))<0){I=1,F(b,e,2*f),O+=2*z-2;break}O+=2*z-2}else A<6?(C=S[R--],S[R]=S[R]%C):A<8?(C=S[R--],S[R]=S[R]instanceof C):A<15&&(S[++R]=!1)}else if(A>0){(A=x)<1?S[++R]=g:A<3?(C=S[R--],S[R]=S[R]+C):A<5?(C=S[R--],S[R]=S[R]==C):A<14&&(C=S[R-1],q=S[R],S[++R]=C,S[++R]=q)}else{(A=x)<2?(C=S[R--],S[R]=S[R]>C):A<9?(z=v(b,O),O+=4,q=R+1,S[R-=z-1]=z?S.slice(R,q):[]):A<11?(z=y(b,O),O+=2,C=S[R--],c[z]=C):A<13?(C=S[R--],S[R]=S[R]>>C):A<15&&(S[++R]=s(b,O),O+=4)}}else{A=3&x;if(x>>=2,A>2)(A=x)>13?(S[++R]=p(b,O),O+=8):A>11?(C=S[R--],S[R]=S[R]>>>C):A>9?S[++R]=!0:A>7?(z=y(b,O),O+=2,S[R]=S[R][z]):A>0&&(C=S[R--],S[R]=S[R]<C);else if(A>1){(A=x)>10?(z=s(b,O),t[++o]=[[O+4,z-3],0,0],O+=2*z-2):A>8?(C=S[R--],S[R]=S[R]^C):A>6&&(C=S[R--])}else if(A>0){if((A=x)<3){var D=0,T=S[R].length,$=S[R];S[++R]=function(){var b=D<T;if(b){var e=$[D++];S[++R]=e}S[++R]=b}}else A<5?(z=y(b,O),O+=2,C=c[z],S[++R]=C):A<7?S[R]=++S[R]:A<9&&(C=S[R--],S[R]=S[R]in C)}else{if((A=x)>13)C=S[R],S[R]=S[R-1],S[R-1]=C;else if(A>4)C=S[R--],S[R]=S[R]===C;else if(A>2)C=S[R--],S[R]=S[R]-C;else if(A>0){for(z=v(b,O),A="",P=i.q[z][0];P<i.q[z][1];P++)A+=String.fromCharCode(r^i.p[P]);A=+A,O+=4,S[++R]=A}}}}if(I)for(;O<E;){j=B[O];O+=2;A=3&(x=13*j%241);if(x>>=2,A<1){var U;A=3&x;if(x>>=2,A<1){if((A=x)>14)z=W[O],(U=function e(){var f=arguments;return e.y>0?K(b,e.c,e.l,f,e.z,this,null,0):(e.y++,K(b,e.c,e.l,f,e.z,this,null,0))}).c=O+4,U.l=z-2,U.x=G,U.y=0,U.z=c,S[R]=U,O+=2*z-2;else if(A>12)q=S[R--],w=S[R--],(A=S[R--]).x===G?A.y>=1?S[++R]=K(b,A.c,A.l,q,A.z,w,null,1):(S[++R]=K(b,A.c,A.l,q,A.z,w,null,0),A.y++):S[++R]=A.apply(w,q);else if(A>5)C=S[R--],S[R]=S[R]!=C;else if(A>3)C=S[R--],S[R]=S[R]*C;else if(A>-1)return[1,S[R--]]}else if(A<2){(A=x)<4?(q=S[R--],(A=S[R]).x===G?A.y>=1?S[R]=K(b,A.c,A.l,[q],A.z,w,null,1):(S[R]=K(b,A.c,A.l,[q],A.z,w,null,0),A.y++):S[R]=A(q)):A<6?S[R-=1]=S[R][S[R+1]]:A<8?S[R]=--S[R]:A<10&&(C=S[R--],S[R]=typeof C)}else if(A<3){if((A=x)>11)throw S[R--];if(A>7){for(C=S[R--],z=W[O],A="",P=i.q[z][0];P<i.q[z][1];P++)A+=String.fromCharCode(r^i.p[P]);O+=4,S[R--][A]=C}else A>5&&(S[R]=h(S[R]))}else{(A=x)<1?S[++R]=null:A<3?(C=S[R--],S[R]=S[R]>=C):A<12&&(S[++R]=void 0)}}else if(A<2){A=3&x;if(x>>=2,A>2)(A=x)>12?S[++R]=l:A>5?(C=S[R--],S[R]=S[R]!==C):A>3?(C=S[R--],S[R]=S[R]/C):A>1?O+=2*(z=W[O])-2:A>-1&&(S[R]=!S[R]);else if(A>1){(A=x)<2?S[++R]=C:A<4?(C=S[R--],S[R]=S[R]<=C):A<11?(C=S[R-=2][S[R+1]]=S[R+2],R--):A<13&&(C=S[R],S[++R]=C)}else if(A>0){if((A=x)<8)q=S[R--],C=delete S[R--][q];else if(A<10){for(z=W[O],A="",P=i.q[z][0];P<i.q[z][1];P++)A+=String.fromCharCode(r^i.p[P]);O+=4,S[R]=S[R][A]}else A<12?(C=S[R--],S[R]=S[R]<<C):A<14&&(S[++R]=W[O],O+=2)}else{if((A=x)<5){z=W[O];try{if(t[o][2]=1,1==(C=G(b,O+4,z-3,[],c,l,null,0))[0])return C}catch(m){if(t[o]&&t[o][1]&&1==(C=G(b,t[o][1][0],t[o][1][1],[],c,l,m,0))[0])return C}finally{if(t[o]&&t[o][0]&&1==(C=G(b,t[o][0][0],t[o][0][1],[],c,l,null,0))[0])return C;t[o]=0,o--}O+=2*z-2}else A<7?(z=W[O],O+=2,S[R-=z]=0===z?new S[R]:d(S[R],n(S.slice(R+1,R+z+1)))):A<9&&(C=S[R--],S[R]=S[R]&C)}}else if(A<3){A=3&x;if(x>>=2,A<1)(A=x)<2?(C=S[R--],S[R]=S[R]>C):A<9?(z=W[O],O+=4,q=R+1,S[R-=z-1]=z?S.slice(R,q):[]):A<11?(z=W[O],O+=2,C=S[R--],c[z]=C):A<13?(C=S[R--],S[R]=S[R]>>C):A<15&&(S[++R]=W[O],O+=4);else if(A<2){(A=x)<1?S[++R]=g:A<3?(C=S[R--],S[R]=S[R]+C):A<5?(C=S[R--],S[R]=S[R]==C):A<14&&(C=S[R-1],q=S[R],S[++R]=C,S[++R]=q)}else if(A<3){if((A=x)<2){for(z=W[O],C="",P=i.q[z][0];P<i.q[z][1];P++)C+=String.fromCharCode(r^i.p[P]);S[++R]=C,O+=4}else A<4?S[R--]?O+=4:O+=2*(z=W[O])-2:A<6?(C=S[R--],S[R]=S[R]%C):A<8?(C=S[R--],S[R]=S[R]instanceof C):A<15&&(S[++R]=!1)}else{(A=x)>7?(C=S[R--],S[R]=S[R]|C):A>5?(z=W[O],O+=2,S[++R]=c["$"+z]):A>3&&(z=W[O],t[o][0]&&!t[o][2]?t[o][1]=[O+4,z-3]:t[o++]=[0,[O+4,z-3],0],O+=2*z-2)}}else{A=3&x;if(x>>=2,A>2)(A=x)>13?(S[++R]=W[O],O+=8):A>11?(C=S[R--],S[R]=S[R]>>>C):A>9?S[++R]=!0:A>7?(z=W[O],O+=2,S[R]=S[R][z]):A>0&&(C=S[R--],S[R]=S[R]<C);else if(A>1){(A=x)>10?(z=W[O],t[++o]=[[O+4,z-3],0,0],O+=2*z-2):A>8?(C=S[R--],S[R]=S[R]^C):A>6&&(C=S[R--])}else if(A>0){if((A=x)>7)C=S[R--],S[R]=S[R]in C;else if(A>5)S[R]=++S[R];else if(A>3)z=W[O],O+=2,C=c[z],S[++R]=C;else if(A>1){D=0,T=S[R].length,$=S[R];S[++R]=function(){var b=D<T;if(b){var e=$[D++];S[++R]=e}S[++R]=b}}}else{if((A=x)<2){for(z=W[O],A="",P=i.q[z][0];P<i.q[z][1];P++)A+=String.fromCharCode(r^i.p[P]);A=+A,O+=4,S[++R]=A}else A<4?(C=S[R--],S[R]=S[R]-C):A<6?(C=S[R--],S[R]=S[R]===C):A<15&&(C=S[R],S[R]=S[R-1],S[R-1]=C)}}}return[0,null]}function K(b,e,f,a,d,c,n,i){var r,t;null==c&&(c=this),d&&!d.d&&(d.d=0,d.$0=d,d[1]={});var o={},l=o.d=d?d.d+1:0;for(o["$"+l]=o,t=0;t<l;t++)o[r="$"+t]=d[r];for(t=0,l=o.length=a.length;t<l;t++)o[t]=a[t];return i&&!B[e]&&F(b,e,2*f),B[e]?G(b,e,f,0,o,c,null,1)[1]:G(b,e,f,0,o,c,null,0)[1]}},(glb="undefined"==typeof window?global:window)._$jsvmprt("484e",[,,"undefined"!=typeof exports?exports:void 0,"undefined"!=typeof module?module:void 0,"undefined"!=typeof define?define:void 0,"undefined"!=typeof Object?Object:void 0,void 0,"undefined"!=typeof TypeError?TypeError:void 0,"undefined"!=typeof document?document:void 0,"undefined"!=typeof InstallTrigger?InstallTrigger:void 0,"undefined"!=typeof safari?safari:void 0,"undefined"!=typeof Date?Date:void 0,"undefined"!=typeof Math?Math:void 0,"undefined"!=typeof navigator?navigator:void 0,"undefined"!=typeof location?location:void 0,"undefined"!=typeof history?history:void 0,"undefined"!=typeof Image?Image:void 0,"undefined"!=typeof console?console:void 0,"undefined"!=typeof PluginArray?PluginArray:void 0,"undefined"!=typeof indexedDB?indexedDB:void 0,"undefined"!=typeof DOMException?DOMException:void 0,"undefined"!=typeof parseInt?parseInt:void 0,"undefined"!=typeof String?String:void 0,"undefined"!=typeof Array?Array:void 0,"undefined"!=typeof Error?Error:void 0,"undefined"!=typeof JSON?JSON:void 0,"undefined"!=typeof Promise?Promise:void 0,"undefined"!=typeof WebSocket?WebSocket:void 0,"undefined"!=typeof eval?eval:void 0,"undefined"!=typeof setTimeout?setTimeout:void 0,"undefined"!=typeof encodeURIComponent?encodeURIComponent:void 0,"undefined"!=typeof encodeURI?encodeURI:void 0,"undefined"!=typeof Request?Request:void 0,"undefined"!=typeof Headers?Headers:void 0,"undefined"!=typeof decodeURIComponent?decodeURIComponent:void 0,"undefined"!=typeof RegExp?RegExp:void 0]); </script> <script>function _f1(e,t){if("string"!=typeof t)return;var o,n=e+"=",r=t.split(/[;&]/);for(var e=0;e<r.length;e++){for(o=r[e];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(n))return o.substring(n.length,o.length)}return""}function _f2(e){return _f1(e,document.cookie)}function _f3(e,t,o){try{o&&(window.sessionStorage&&window.sessionStorage.setItem(e,t),window.localStorage&&window.localStorage.setItem(e,t));var n=31536e6;document.cookie=e+"=; expires=Mon, 20 Sep 1970 00:00:00 UTC; path=/;"+(window.location.protocol == 'https:' ? 'SameSite=None; Secure;' : ''),document.cookie=e+"="+t+"; expires="+new Date((new Date).getTime()+n).toGMTString()+"; path=/;"+(window.location.protocol == 'https:' ? 'SameSite=None; Secure;' : '')}catch(e){}}window.byted_acrawler.init({aid:99999999,dfp:0});var __ac_nonce=_f2("__ac_nonce"),__ac_signature=window.byted_acrawler.sign("",__ac_nonce);_f3("__ac_signature",__ac_signature),_f3("__ac_referer",document.referrer||"__ac_blank",!0);try{sessionStorage.setItem("__ac_ns",performance.timing.navigationStart)}catch(e){};window.location.reload();</script></html>

skmcj commented 5 months ago

emmmm,大概率是nginx配置问题,测试跨域是否有正常访问到目标地址,自己百度解决吧,