>>0?1:0))+((M>>>19|E<<13)^(M<<3|E>>>29)^M>>>6)+((z+=P=(E>>>19|M<<13)^(E<<3|M>>>29)^(E>>>6|M<<26))>>>0>>0?1:0),z+=F=Y.low,C.high=H=H+$+(z>>>0>>0?1:0),C.low=z),b&Z^~b&V),D=m&S^~m&G,E=y&v^y&w^v&w,M=(g>>>28|y<<4)^(g<<30|y>>>2)^(g<<25|y>>>7),P=R1[A],Y=P.high,$=P.low,F=Q+((m>>>14|b<<18)^(m>>>18|b<<14)^(m<<23|b>>>9)),C=J+((b>>>14|m<<18)^(b>>>18|m<<14)^(b<<23|m>>>9))+(F>>>0>>0?1:0),t1=M+(g&B^g&k^B&k),J=V,Q=G,V=Z,G=S,Z=b,S=m,b=q+(C=C+R+((F=F+D)>>>0>>0?1:0)+Y+((F=F+$)>>>0<$>>>0?1:0)+H+((F=F+z)>>>0>>0?1:0))+((m=x+F|0)>>>0>>0?1:0)|0,q=w,x=k,w=v,k=B,v=y,B=g,y=C+(((y>>>28|g<<4)^(y<<30|g>>>2)^(y<<25|g>>>7))+E+(t1>>>0>>0?1:0))+((g=F+t1|0)>>>0>>0?1:0)|0;a=e.low=a+g,e.high=I+y+(a>>>0>>0?1:0),h=r.low=h+B,r.high=U+v+(h>>>0>>0?1:0),l=i.low=l+k,i.high=K+w+(l>>>0>>0?1:0),f=o.low=f+x,o.high=X+q+(f>>>0>>0?1:0),d=n.low=d+m,n.high=L+b+(d>>>0>>0?1:0),u=s.low=u+S,s.high=j+Z+(u>>>0>>0?1:0),p=c.low=p+G,c.high=T+V+(p>>>0>>0?1:0),_=t.low=_+Q,t.high=N+J+(_>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(128+i>>>10<<5)]=Math.floor(r/4294967296),e[31+(128+i>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=H1.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),p.SHA512=H1._createHelper(u),p.HmacSHA512=H1._createHmacHelper(u),u=(p=i).x64,t=u.Word,N=u.WordArray,u=p.algo,q=u.SHA512,u=u.SHA384=q.extend({_doReset:function(){this._hash=new N.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var t=q._doFinalize.call(this);return t.sigBytes-=16,t}}),p.SHA384=q._createHelper(u),p.HmacSHA384=q._createHmacHelper(u);for(var M1=Math,p=i,P1=(u=p.lib).WordArray,F1=u.Hasher,W1=p.x64.Word,u=p.algo,O1=[],I1=[],U1=[],v=1,B=0,K1=0;K1<24;K1++){O1[v+5*B]=(K1+1)*(K1+2)/2%64;var X1=(2*v+3*B)%5;v=B%5,B=X1}for(v=0;v<5;v++)for(B=0;B<5;B++)I1[v+5*B]=B+(2*v+3*B)%5*5;for(var L1=1,j1=0;j1<24;j1++){for(var T1,N1=0,q1=0,Z1=0;Z1<7;Z1++)1&L1&&((T1=(1<>>32-e}function Y1(t){return"string"==typeof t?f1:o}function $1(t,e,r){var i,o=this._iv;o?(i=o,this._iv=void 0):i=this._prevBlock;for(var n=0;n>24&255)?(r=t>>8&255,i=255&t,255===(e=t>>16&255)?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t=(t+=e<<16)+(r<<8)+i):t+=1<<24,t}u=u.SHA3=F1.extend({cfg:F1.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new W1.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var r=this._state,i=this.blockSize/2,o=0;o>>24)|4278255360&(n<<24|n>>>8);(x=r[o]).high^=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),x.low^=n}for(var c=0;c<24;c++){for(var a=0;a<5;a++){for(var h=0,l=0,f=0;f<5;f++)h^=(x=r[a+5*f]).high,l^=x.low;var d=D[a];d.high=h,d.low=l}for(a=0;a<5;a++)for(var u=D[(a+4)%5],p=D[(a+1)%5],_=p.high,p=p.low,h=u.high^(_<<1|p>>>31),l=u.low^(p<<1|_>>>31),f=0;f<5;f++)(x=r[a+5*f]).high^=h,x.low^=l;for(var y=1;y<25;y++){var g=(x=r[y]).high,v=x.low,B=O1[y],g=(l=B<32?(h=g<>>32-B,v<>>32-B):(h=v<>>64-B,g<>>64-B),D[I1[y]]);g.high=h,g.low=l}var w=D[0],k=r[0];w.high=k.high,w.low=k.low;for(a=0;a<5;a++)for(f=0;f<5;f++){var x=r[y=a+5*f],b=D[y],m=D[(a+1)%5+5*f],S=D[(a+2)%5+5*f];x.high=b.high^~m.high&S.high,x.low=b.low^~m.low&S.low}x=r[0],w=U1[c];x.high^=w.high,x.low^=w.low}},_doFinalize:function(){for(var t=this._data,e=t.words,r=(this._nDataBytes,8*t.sigBytes),i=32*this.blockSize,o=(e[r>>>5]|=1<<24-r%32,e[(M1.ceil((1+r)/i)*i>>>5)-1]|=128,t.sigBytes=4*e.length,this._process(),this._state),r=this.cfg.outputLength/8,n=r/8,s=[],c=0;c>>24)|4278255360&(h<<24|h>>>8);s.push(16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)),s.push(h)}return new P1.init(s,r)},clone:function(){for(var t=F1.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}}),p.SHA3=F1._createHelper(u),p.HmacSHA3=F1._createHmacHelper(u),Math,u=(p=i).lib,e=u.WordArray,Z=u.Hasher,u=p.algo,V=e.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),G=e.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),J=e.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),Q=e.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),Y=e.create([0,1518500249,1859775393,2400959708,2840853838]),$=e.create([1352829926,1548603684,1836072691,2053994217,0]),u=u.RIPEMD160=Z.extend({_doReset:function(){this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,o=t[i];t[i]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}for(var n,s,c,a,h,l,f=this._hash.words,d=Y.words,u=$.words,p=V.words,_=G.words,y=J.words,g=Q.words,v=n=f[0],B=s=f[1],w=c=f[2],k=a=f[3],x=h=f[4],r=0;r<80;r+=1)l=(l=Q1(l=(l=n+t[e+p[r]]|0)+(r<16?(s^c^a)+d[0]:r<32?G1(s,c,a)+d[1]:r<48?((s|~c)^a)+d[2]:r<64?J1(s,c,a)+d[3]:(s^(c|~a))+d[4])|0,y[r]))+h|0,n=h,h=a,a=Q1(c,10),c=s,s=l,l=(l=Q1(l=(l=v+t[e+_[r]]|0)+(r<16?(B^(w|~k))+u[0]:r<32?J1(B,w,k)+u[1]:r<48?((B|~w)^k)+u[2]:r<64?G1(B,w,k)+u[3]:(B^w^k)+u[4])|0,g[r]))+x|0,v=x,x=k,k=Q1(w,10),w=B,B=l;l=f[1]+c+k|0,f[1]=f[2]+a+x|0,f[2]=f[3]+h+v|0,f[3]=f[4]+n+B|0,f[4]=f[0]+s+w|0,f[0]=l},_doFinalize:function(){for(var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes,i=(e[i>>>5]|=128<<24-i%32,e[14+(64+i>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process(),this._hash),o=i.words,n=0;n<5;n++){var s=o[n];o[n]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var t=Z.clone.call(this);return t._hash=this._hash.clone(),t}}),p.RIPEMD160=Z._createHelper(u),p.HmacRIPEMD160=Z._createHmacHelper(u),u=(p=i).lib.Base,t1=p.enc.Utf8,p.algo.HMAC=u.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=t1.parse(e));for(var r=t.blockSize,i=4*r,t=((e=e.sigBytes>i?t.finalize(e):e).clamp(),this._oKey=e.clone()),e=this._iKey=e.clone(),o=t.words,n=e.words,s=0;s>>2];t.sigBytes-=e}},P.BlockCipher=h1.extend({cfg:h1.cfg.extend({mode:r,padding:u}),reset:function(){h1.reset.call(this);var t,e=this.cfg,r=e.iv,e=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=e.createEncryptor:(t=e.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(e,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),l1=P.CipherParams=p.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),r=(w.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,t=t.salt,t=t?s.create([1398893684,1701076831]).concat(t).concat(e):e;return t.toString(c1)},parse:function(t){var e,t=c1.parse(t),r=t.words;return 1398893684==r[0]&&1701076831==r[1]&&(e=s.create(r.slice(2,4)),r.splice(0,4),t.sigBytes-=16),l1.create({ciphertext:t,salt:e})}},o=P.SerializableCipher=p.extend({cfg:p.extend({format:r}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var o=t.createEncryptor(r,i),e=o.finalize(e),o=o.cfg;return l1.create({ciphertext:e,key:r,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),u=(w.kdf={}).OpenSSL={execute:function(t,e,r,i,o){i=i||s.random(8),o=(o?a1.create({keySize:e+r,hasher:o}):a1.create({keySize:e+r})).compute(t,i);t=s.create(o.words.slice(e),4*r);return o.sigBytes=4*e,l1.create({key:o,iv:t,salt:i})}},f1=P.PasswordBasedCipher=o.extend({cfg:o.cfg.extend({kdf:u}),encrypt:function(t,e,r,i){r=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize,i.salt,i.hasher),i.iv=r.iv,t=o.encrypt.call(this,t,e,r.key,i);return t.mixIn(r),t},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);r=i.kdf.execute(r,t.keySize,t.ivSize,e.salt,i.hasher);return i.iv=r.iv,o.decrypt.call(this,t,e,r.key,i)}})),i.mode.CFB=((p=i.lib.BlockCipherMode.extend()).Encryptor=p.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize;t2.call(this,t,e,i,r),this._prevBlock=t.slice(e,e+i)}}),p.Decryptor=p.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,o=t.slice(e,e+i);t2.call(this,t,e,i,r),this._prevBlock=o}}),p),i.mode.CTR=(r=i.lib.BlockCipherMode.extend(),w=r.Encryptor=r.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,o=this._iv,n=this._counter,s=(o&&(n=this._counter=o.slice(0),this._iv=void 0),n.slice(0));r.encryptBlock(s,0),n[i-1]=n[i-1]+1|0;for(var c=0;c>>2]|=e<<24-r%4*8,t.sigBytes+=e},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Iso10126={pad:function(t,e){e*=4,e-=t.sigBytes%e;t.concat(i.lib.WordArray.random(e-1)).concat(i.lib.WordArray.create([e<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Iso97971={pad:function(t,e){t.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(t,e)},unpad:function(t){i.pad.ZeroPadding.unpad(t),t.sigBytes--}},i.pad.ZeroPadding={pad:function(t,e){e*=4;t.clamp(),t.sigBytes+=e-(t.sigBytes%e||e)},unpad:function(t){for(var e=t.words,r=t.sigBytes-1,r=t.sigBytes-1;0<=r;r--)if(e[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},i.pad.NoPadding={pad:function(){},unpad:function(){}},d1=(P=i).lib.CipherParams,u1=P.enc.Hex,P.format.Hex={stringify:function(t){return t.ciphertext.toString(u1)},parse:function(t){t=u1.parse(t);return d1.create({ciphertext:t})}};for(var w=i,p=w.lib.BlockCipher,u=w.algo,k=[],r2=[],i2=[],o2=[],n2=[],s2=[],c2=[],a2=[],h2=[],l2=[],x=[],b=0;b<256;b++)x[b]=b<128?b<<1:b<<1^283;for(var m=0,S=0,b=0;b<256;b++){var E=S^S<<1^S<<2^S<<3^S<<4,f2=(k[m]=E=E>>>8^255&E^99,x[r2[E]=m]),d2=x[f2],u2=x[d2],M=257*x[E]^16843008*E;i2[m]=M<<24|M>>>8,o2[m]=M<<16|M>>>16,n2[m]=M<<8|M>>>24,s2[m]=M,c2[E]=(M=16843009*u2^65537*d2^257*f2^16843008*m)<<24|M>>>8,a2[E]=M<<16|M>>>16,h2[E]=M<<8|M>>>24,l2[E]=M,m?(m=f2^x[x[x[u2^f2]]],S^=x[x[S]]):m=S=1}var p2=[0,1,2,4,8,16,32,64,128,27,54],u=u.AES=p.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,i=4*(1+(this._nRounds=6+r)),o=this._keySchedule=[],n=0;n>>24]<<24|k[a>>>16&255]<<16|k[a>>>8&255]<<8|k[255&a]):(a=k[(a=a<<8|a>>>24)>>>24]<<24|k[a>>>16&255]<<16|k[a>>>8&255]<<8|k[255&a],a^=p2[n/r|0]<<24),o[n]=o[n-r]^a);for(var s=this._invKeySchedule=[],c=0;c>>24]]^a2[k[a>>>16&255]]^h2[k[a>>>8&255]]^l2[k[255&a]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,i2,o2,n2,s2,k)},decryptBlock:function(t,e){var r=t[e+1],r=(t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,c2,a2,h2,l2,r2),t[e+1]);t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,o,n,s,c){for(var a=this._nRounds,h=t[e]^r[0],l=t[e+1]^r[1],f=t[e+2]^r[2],d=t[e+3]^r[3],u=4,p=1;p>>24]^o[l>>>16&255]^n[f>>>8&255]^s[255&d]^r[u++],y=i[l>>>24]^o[f>>>16&255]^n[d>>>8&255]^s[255&h]^r[u++],g=i[f>>>24]^o[d>>>16&255]^n[h>>>8&255]^s[255&l]^r[u++],v=i[d>>>24]^o[h>>>16&255]^n[l>>>8&255]^s[255&f]^r[u++],h=_,l=y,f=g,d=v;_=(c[h>>>24]<<24|c[l>>>16&255]<<16|c[f>>>8&255]<<8|c[255&d])^r[u++],y=(c[l>>>24]<<24|c[f>>>16&255]<<16|c[d>>>8&255]<<8|c[255&h])^r[u++],g=(c[f>>>24]<<24|c[d>>>16&255]<<16|c[h>>>8&255]<<8|c[255&l])^r[u++],v=(c[d>>>24]<<24|c[h>>>16&255]<<16|c[l>>>8&255]<<8|c[255&f])^r[u++];t[e]=_,t[e+1]=y,t[e+2]=g,t[e+3]=v},keySize:8}),P=(w.AES=p._createHelper(u),i),_2=(w=P.lib).WordArray,w=w.BlockCipher,p=P.algo,y2=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],g2=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],v2=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],B2=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],w2=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],k2=p.DES=w.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=y2[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var o=this._subKeys=[],n=0;n<16;n++){for(var s=o[n]=[],c=v2[n],r=0;r<24;r++)s[r/6|0]|=e[(g2[r]-1+c)%28]<<31-r%6,s[4+(r/6|0)]|=e[28+(g2[r+24]-1+c)%28]<<31-r%6;s[0]=s[0]<<1|s[0]>>>31;for(r=1;r<7;r++)s[r]=s[r]>>>4*(r-1)+3;s[7]=s[7]<<5|s[7]>>>27}for(var a=this._invSubKeys=[],r=0;r<16;r++)a[r]=o[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],x2.call(this,4,252645135),x2.call(this,16,65535),b2.call(this,2,858993459),b2.call(this,8,16711935),x2.call(this,1,1431655765);for(var i=0;i<16;i++){for(var o=r[i],n=this._lBlock,s=this._rBlock,c=0,a=0;a<8;a++)c|=B2[a][((s^o[a])&w2[a])>>>0];this._lBlock=s,this._rBlock=n^c}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,x2.call(this,1,1431655765),b2.call(this,8,16711935),b2.call(this,2,858993459),x2.call(this,16,65535),x2.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function x2(t,e){e=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=e,this._lBlock^=e<>>t^this._lBlock)&e;this._lBlock^=e,this._rBlock^=e<192.");var e=t.slice(0,2),r=t.length<4?t.slice(0,2):t.slice(2,4),t=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=k2.createEncryptor(_2.create(e)),this._des2=k2.createEncryptor(_2.create(r)),this._des3=k2.createEncryptor(_2.create(t))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),P.TripleDES=w._createHelper(p);var u=i,P=u.lib.StreamCipher,w=u.algo,m2=w.RC4=P.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,i=this._S=[],o=0;o<256;o++)i[o]=o;for(var o=0,n=0;o<256;o++){var s=o%r,s=e[s>>>2]>>>24-s%4*8&255,n=(n+i[o]+s)%256,s=i[o];i[o]=i[n],i[n]=s}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=S2.call(this)},keySize:8,ivSize:0});function S2(){for(var t=this._S,e=this._i,r=this._j,i=0,o=0;o<4;o++){var r=(r+t[e=(e+1)%256])%256,n=t[e];t[e]=t[r],t[r]=n,i|=t[(t[e]+t[r])%256]<<24-8*o}return this._i=e,this._j=r,i}function A2(){for(var t=this._X,e=this._C,r=0;r<8;r++)c[r]=e[r];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=t[r]+e[r],o=65535&i,n=i>>>16;a[r]=((o*o>>>17)+o*n>>>15)+n*n^((4294901760&i)*i|0)+((65535&i)*i|0)}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}function z2(){for(var t=this._X,e=this._C,r=0;r<8;r++)f[r]=e[r];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=t[r]+e[r],o=65535&i,n=i>>>16;d[r]=((o*o>>>17)+o*n>>>15)+n*n^((4294901760&i)*i|0)+((65535&i)*i|0)}t[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,t[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,t[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,t[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,t[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,t[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,t[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,t[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}u.RC4=P._createHelper(m2),w=w.RC4Drop=m2.extend({cfg:m2.cfg.extend({drop:192}),_doReset:function(){m2._doReset.call(this);for(var t=this.cfg.drop;0>>24)|4278255360&(t[r]<<24|t[r]>>>8);for(var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],o=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]],r=this._b=0;r<4;r++)A2.call(this);for(r=0;r<8;r++)o[r]^=i[r+4&7];if(e){var e=e.words,n=e[0],e=e[1],n=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8),s=n>>>16|4294901760&e,c=e<<16|65535&n;o[0]^=n,o[1]^=s,o[2]^=e,o[3]^=c,o[4]^=n,o[5]^=s,o[6]^=e,o[7]^=c;for(r=0;r<4;r++)A2.call(this)}},_doProcessBlock:function(t,e){var r=this._X;A2.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),t[e+i]^=n[i]},blockSize:4,ivSize:2}),p.Rabbit=u._createHelper(P),p=(w=i).lib.StreamCipher,u=w.algo,h=[],f=[],d=[],u=u.RabbitLegacy=p.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]],o=this._b=0;o<4;o++)z2.call(this);for(o=0;o<8;o++)i[o]^=r[o+4&7];if(e){var t=e.words,e=t[0],t=t[1],e=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8),t=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8),n=e>>>16|4294901760&t,s=t<<16|65535&e;i[0]^=e,i[1]^=n,i[2]^=t,i[3]^=s,i[4]^=e,i[5]^=n,i[6]^=t,i[7]^=s;for(o=0;o<4;o++)z2.call(this)}},_doProcessBlock:function(t,e){var r=this._X;z2.call(this),h[0]=r[0]^r[5]>>>16^r[3]<<16,h[1]=r[2]^r[7]>>>16^r[5]<<16,h[2]=r[4]^r[1]>>>16^r[7]<<16,h[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)h[i]=16711935&(h[i]<<8|h[i]>>>24)|4278255360&(h[i]<<24|h[i]>>>8),t[e+i]^=h[i]},blockSize:4,ivSize:2}),w.RabbitLegacy=p._createHelper(u);{w=(P=i).lib.BlockCipher,p=P.algo;const F=16,D2=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],E2=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var H2={pbox:[],sbox:[]};function C2(t,e){var r=t.sbox[0][e>>24&255]+t.sbox[1][e>>16&255];return r=(r^=t.sbox[2][e>>8&255])+t.sbox[3][255&e]}function R2(e,t,r){let i=t,o=r,n;for(let t=0;t=a&&(e=0);let r=0,i=0,o=0;for(let t=0;t= 48 && charCode <= 57) {
+ number = number * 10 + (charCode - 48);
+ } else {
+ if (number !== 0) {
+ signature += createRandom(number);
+ number = 0;
+ }
+ signature += String.fromCharCode(charCode);
+ }
+ }
+ if (number !== 0) {
+ signature += createRandom(number);
+ }
+ return signature;
+}
+
+function oC(e) {
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e
+}
+var Tm = {
+ exports: {}
+}
+ , Sm = {
+ exports: {}
+};
+(function() {
+ var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
+ , t = {
+ rotl: function(n, r) {
+ return n << r | n >>> 32 - r
+ },
+ rotr: function(n, r) {
+ return n << 32 - r | n >>> r
+ },
+ endian: function(n) {
+ if (n.constructor == Number)
+ return t.rotl(n, 8) & 16711935 | t.rotl(n, 24) & 4278255360;
+ for (var r = 0; r < n.length; r++)
+ n[r] = t.endian(n[r]);
+ return n
+ },
+ randomBytes: function(n) {
+ for (var r = []; n > 0; n--)
+ r.push(Math.floor(Math.random() * 256));
+ return r
+ },
+ bytesToWords: function(n) {
+ for (var r = [], s = 0, o = 0; s < n.length; s++,
+ o += 8)
+ r[o >>> 5] |= n[s] << 24 - o % 32;
+ return r
+ },
+ wordsToBytes: function(n) {
+ for (var r = [], s = 0; s < n.length * 32; s += 8)
+ r.push(n[s >>> 5] >>> 24 - s % 32 & 255);
+ return r
+ },
+ bytesToHex: function(n) {
+ for (var r = [], s = 0; s < n.length; s++)
+ r.push((n[s] >>> 4).toString(16)),
+ r.push((n[s] & 15).toString(16));
+ return r.join("")
+ },
+ hexToBytes: function(n) {
+ for (var r = [], s = 0; s < n.length; s += 2)
+ r.push(parseInt(n.substr(s, 2), 16));
+ return r
+ },
+ bytesToBase64: function(n) {
+ for (var r = [], s = 0; s < n.length; s += 3)
+ for (var o = n[s] << 16 | n[s + 1] << 8 | n[s + 2], i = 0; i < 4; i++)
+ s * 8 + i * 6 <= n.length * 8 ? r.push(e.charAt(o >>> 6 * (3 - i) & 63)) : r.push("=");
+ return r.join("")
+ },
+ base64ToBytes: function(n) {
+ n = n.replace(/[^A-Z0-9+\/]/ig, "");
+ for (var r = [], s = 0, o = 0; s < n.length; o = ++s % 4)
+ o != 0 && r.push((e.indexOf(n.charAt(s - 1)) & Math.pow(2, -2 * o + 8) - 1) << o * 2 | e.indexOf(n.charAt(s)) >>> 6 - o * 2);
+ return r
+ }
+ };
+ Sm.exports = t
+}
+)();
+var iC = Sm.exports
+ , nl = {
+ utf8: {
+ stringToBytes: function(e) {
+ return nl.bin.stringToBytes(unescape(encodeURIComponent(e)))
+ },
+ bytesToString: function(e) {
+ return decodeURIComponent(escape(nl.bin.bytesToString(e)))
+ }
+ },
+ bin: {
+ stringToBytes: function(e) {
+ for (var t = [], n = 0; n < e.length; n++)
+ t.push(e.charCodeAt(n) & 255);
+ return t
+ },
+ bytesToString: function(e) {
+ for (var t = [], n = 0; n < e.length; n++)
+ t.push(String.fromCharCode(e[n]));
+ return t.join("")
+ }
+ }
+}, sd = nl;
+
+var aC = function(e) {
+ return e != null && (Cm(e) || lC(e) || !!e._isBuffer)
+};
+function Cm(e) {
+ return !!e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e)
+}
+function lC(e) {
+ return typeof e.readFloatLE == "function" && typeof e.slice == "function" && Cm(e.slice(0, 0))
+}
+(function() {
+ var e = iC
+ , t = sd.utf8
+ , n = aC
+ , r = sd.bin
+ , s = function(o, i) {
+ o.constructor == String ? i && i.encoding === "binary" ? o = r.stringToBytes(o) : o = t.stringToBytes(o) : n(o) ? o = Array.prototype.slice.call(o, 0) : !Array.isArray(o) && o.constructor !== Uint8Array && (o = o.toString());
+ for (var a = e.bytesToWords(o), l = o.length * 8, c = 1732584193, u = -271733879, f = -1732584194, d = 271733878, m = 0; m < a.length; m++)
+ a[m] = (a[m] << 8 | a[m] >>> 24) & 16711935 | (a[m] << 24 | a[m] >>> 8) & 4278255360;
+ a[l >>> 5] |= 128 << l % 32,
+ a[(l + 64 >>> 9 << 4) + 14] = l;
+ for (var v = s._ff, w = s._gg, R = s._hh, y = s._ii, m = 0; m < a.length; m += 16) {
+ var b = c
+ , _ = u
+ , g = f
+ , C = d;
+ c = v(c, u, f, d, a[m + 0], 7, -680876936),
+ d = v(d, c, u, f, a[m + 1], 12, -389564586),
+ f = v(f, d, c, u, a[m + 2], 17, 606105819),
+ u = v(u, f, d, c, a[m + 3], 22, -1044525330),
+ c = v(c, u, f, d, a[m + 4], 7, -176418897),
+ d = v(d, c, u, f, a[m + 5], 12, 1200080426),
+ f = v(f, d, c, u, a[m + 6], 17, -1473231341),
+ u = v(u, f, d, c, a[m + 7], 22, -45705983),
+ c = v(c, u, f, d, a[m + 8], 7, 1770035416),
+ d = v(d, c, u, f, a[m + 9], 12, -1958414417),
+ f = v(f, d, c, u, a[m + 10], 17, -42063),
+ u = v(u, f, d, c, a[m + 11], 22, -1990404162),
+ c = v(c, u, f, d, a[m + 12], 7, 1804603682),
+ d = v(d, c, u, f, a[m + 13], 12, -40341101),
+ f = v(f, d, c, u, a[m + 14], 17, -1502002290),
+ u = v(u, f, d, c, a[m + 15], 22, 1236535329),
+ c = w(c, u, f, d, a[m + 1], 5, -165796510),
+ d = w(d, c, u, f, a[m + 6], 9, -1069501632),
+ f = w(f, d, c, u, a[m + 11], 14, 643717713),
+ u = w(u, f, d, c, a[m + 0], 20, -373897302),
+ c = w(c, u, f, d, a[m + 5], 5, -701558691),
+ d = w(d, c, u, f, a[m + 10], 9, 38016083),
+ f = w(f, d, c, u, a[m + 15], 14, -660478335),
+ u = w(u, f, d, c, a[m + 4], 20, -405537848),
+ c = w(c, u, f, d, a[m + 9], 5, 568446438),
+ d = w(d, c, u, f, a[m + 14], 9, -1019803690),
+ f = w(f, d, c, u, a[m + 3], 14, -187363961),
+ u = w(u, f, d, c, a[m + 8], 20, 1163531501),
+ c = w(c, u, f, d, a[m + 13], 5, -1444681467),
+ d = w(d, c, u, f, a[m + 2], 9, -51403784),
+ f = w(f, d, c, u, a[m + 7], 14, 1735328473),
+ u = w(u, f, d, c, a[m + 12], 20, -1926607734),
+ c = R(c, u, f, d, a[m + 5], 4, -378558),
+ d = R(d, c, u, f, a[m + 8], 11, -2022574463),
+ f = R(f, d, c, u, a[m + 11], 16, 1839030562),
+ u = R(u, f, d, c, a[m + 14], 23, -35309556),
+ c = R(c, u, f, d, a[m + 1], 4, -1530992060),
+ d = R(d, c, u, f, a[m + 4], 11, 1272893353),
+ f = R(f, d, c, u, a[m + 7], 16, -155497632),
+ u = R(u, f, d, c, a[m + 10], 23, -1094730640),
+ c = R(c, u, f, d, a[m + 13], 4, 681279174),
+ d = R(d, c, u, f, a[m + 0], 11, -358537222),
+ f = R(f, d, c, u, a[m + 3], 16, -722521979),
+ u = R(u, f, d, c, a[m + 6], 23, 76029189),
+ c = R(c, u, f, d, a[m + 9], 4, -640364487),
+ d = R(d, c, u, f, a[m + 12], 11, -421815835),
+ f = R(f, d, c, u, a[m + 15], 16, 530742520),
+ u = R(u, f, d, c, a[m + 2], 23, -995338651),
+ c = y(c, u, f, d, a[m + 0], 6, -198630844),
+ d = y(d, c, u, f, a[m + 7], 10, 1126891415),
+ f = y(f, d, c, u, a[m + 14], 15, -1416354905),
+ u = y(u, f, d, c, a[m + 5], 21, -57434055),
+ c = y(c, u, f, d, a[m + 12], 6, 1700485571),
+ d = y(d, c, u, f, a[m + 3], 10, -1894986606),
+ f = y(f, d, c, u, a[m + 10], 15, -1051523),
+ u = y(u, f, d, c, a[m + 1], 21, -2054922799),
+ c = y(c, u, f, d, a[m + 8], 6, 1873313359),
+ d = y(d, c, u, f, a[m + 15], 10, -30611744),
+ f = y(f, d, c, u, a[m + 6], 15, -1560198380),
+ u = y(u, f, d, c, a[m + 13], 21, 1309151649),
+ c = y(c, u, f, d, a[m + 4], 6, -145523070),
+ d = y(d, c, u, f, a[m + 11], 10, -1120210379),
+ f = y(f, d, c, u, a[m + 2], 15, 718787259),
+ u = y(u, f, d, c, a[m + 9], 21, -343485551),
+ c = c + b >>> 0,
+ u = u + _ >>> 0,
+ f = f + g >>> 0,
+ d = d + C >>> 0
+ }
+ return e.endian([c, u, f, d])
+ };
+ s._ff = function(o, i, a, l, c, u, f) {
+ var d = o + (i & a | ~i & l) + (c >>> 0) + f;
+ return (d << u | d >>> 32 - u) + i
+ }
+ ,
+ s._gg = function(o, i, a, l, c, u, f) {
+ var d = o + (i & l | a & ~l) + (c >>> 0) + f;
+ return (d << u | d >>> 32 - u) + i
+ }
+ ,
+ s._hh = function(o, i, a, l, c, u, f) {
+ var d = o + (i ^ a ^ l) + (c >>> 0) + f;
+ return (d << u | d >>> 32 - u) + i
+ }
+ ,
+ s._ii = function(o, i, a, l, c, u, f) {
+ var d = o + (a ^ (i | ~l)) + (c >>> 0) + f;
+ return (d << u | d >>> 32 - u) + i
+ }
+ ,
+ s._blocksize = 16,
+ s._digestsize = 16,
+ Tm.exports = function(o, i) {
+ if (o == null)
+ throw new Error("Illegal argument " + o);
+ var a = e.wordsToBytes(s(o, i));
+ return i && i.asBytes ? a : i && i.asString ? r.bytesToString(a) : e.bytesToHex(a)
+ }
+}
+)();
+var cC = Tm.exports;
+var t = {
+ utf8: {
+ stringToBytes: function(e) {
+ return nl.bin.stringToBytes(unescape(encodeURIComponent(e)))
+ },
+ bytesToString: function(e) {
+ return decodeURIComponent(escape(nl.bin.bytesToString(e)))
+ }
+ },
+ bin: {
+ stringToBytes: function(e) {
+ for (var t = [], n = 0; n < e.length; n++)
+ t.push(e.charCodeAt(n) & 255);
+ return t
+ },
+ bytesToString: function(e) {
+ for (var t = [], n = 0; n < e.length; n++)
+ t.push(String.fromCharCode(e[n]));
+ return t.join("")
+ }
+ }
+};
+
+const hC = (e, t, n=!1) => {
+ if (t.params) {
+ const o = {};
+ Object.keys(t.params).forEach(i => {
+ t.params[i] !== void 0 && t.params[i] !== null && (o[i] = t.params[i])
+ }
+ ),
+ t.params = o
+ }
+ let r = {};
+ const s = t.method.toLowerCase();
+ if (s === "get")
+ t.params = Object.assign({}, e, t.params || {});
+ else if (s === "post")
+ if (typeof t.data == "string") {
+ let o;
+ t.data.split("&").forEach(i => {
+ o = i.split("="),
+ r[o[0]] = o[1]
+ }
+ ),
+ r = Object.assign({}, e, r),
+ t.data = Object.keys(r).map(i => `${i}=${r[i]}`).join("&")
+ } else
+ r = Object.assign(r, e, t.data || {}),
+ t.data = r;
+ return n ? t : (r = Object.assign({}, t.params, r),
+ r)
+}
+
+const Rm = oC(cC);
+const s = Rm(r);
+
+pC = e => {
+ let t = Object.keys(e).sort().map(n => {
+ function r(s) {
+ return Array.isArray(s) ? s.join(",") : typeof s === "object" ? JSON.stringify(s) : s
+ }
+ return n + r(e[n])
+ }
+ ).join("");
+ return t += Am + e.lm_s_ts + rl,
+ Rm(t)
+}
+
+
+// final encryption function
+let CryptoJS = null;
+lm_s_key = atob('ZGQ0NmRiYjQ0MmI2ZTRiYTgxN2Q2MzQ3ZDJkZGY0OTM=');
+function requestSign(signParams, cryptoJSPath) {
+ let sKey = Object.keys(signParams).sort().map(key => {
+ function getValue(val) {
+ if (Array.isArray(val)) {
+ return val.join(',');
+ }
+ if (typeof val === 'object') {
+ return JSON.stringify(val);
+ }
+ return val;
+ }
+ return key + getValue(signParams[key]);
+ }).join('');
+
+ sKey += signParams.lm_s_id + signParams.lm_s_ts + lm_s_key;
+ console.log(`sKey: ${sKey}`);
+ CryptoJS = require(cryptoJSPath);
+ return CryptoJS.MD5(sKey).toString();
+}
+
+function sign(videoid, cryptoJSPath, platform='web'){
+ const vali = createSignature();
+ const data_e = {
+ lm_s_id: Am,
+ lm_s_ts: r,
+ lm_s_str: s,
+ lm_s_ver: 1,
+ h5: 1
+ };
+ /* data_e example value
+ const data_e = {
+ lm_s_id: Am,
+ lm_s_ts: "17284909009151",
+ lm_s_str: "88f9777231dc2d6ac462a1d7ebf5f54e",
+ lm_s_ver: 1,
+ h5: 1
+ };
+ */
+ console.log("data_e:",data_e);
+
+ data_i = {
+ ...data_e,
+ _time: new Date().valueOf(),
+ thirdchannel: 6,
+ videoid: videoid,
+ area: 'zh',
+ vali: vali
+ }
+ console.log("data_i:",data_i);
+
+ // fake lm_s_sign param value
+ let lm_s_sign = pC(data_i);
+ console.log(`fake lm_s_sign: ${lm_s_sign}`);
+
+ //finnal request params
+ /*
+ signParams = {
+ "alias": "liveme",
+ "tongdun_black_box": "iWPU21728483558afruvSVo6x0",
+ "os": "android",
+ "lm_s_id": "LM6000101139961122666757",
+ "lm_s_ts": "17284909009151",
+ "lm_s_str": "88f9777231dc2d6ac462a1d7ebf5f54e",
+ "lm_s_ver": 1,
+ "h5": 1,
+ "_time": 1728490664651,
+ "thirdchannel": 6,
+ "videoid": "17284844223282059697",
+ "area": "zh",
+ "vali": "zH8SlBwnCm4AZWp"
+ }#
+ //result: 4eaf71a1ec19b49b7267e4d16e007105
+ */
+ signParams = {
+ "alias": "liveme",
+ "tongdun_black_box": "",
+ "os": platform,
+ ...data_i
+ }
+ console.log("signParams: ", signParams);
+ lm_s_sign = requestSign(signParams, cryptoJSPath);
+ console.log(`\x1b[32mfinal lm_s_sign: \x1b[0m${lm_s_sign}\n`);
+ data = {
+ ...signParams,
+ lm_s_sign
+ }
+ return data;
+
+}
+
+module.exports = {
+ sign
+ };
diff --git a/src/javascript/migu.js b/src/javascript/migu.js
new file mode 100644
index 0000000..3ac86d3
--- /dev/null
+++ b/src/javascript/migu.js
@@ -0,0 +1,143 @@
+/**
+ * Function to get the ddCalcu parameter value
+ * @param {string} inputUrl - The original URL before encryption
+ * @returns {Promise} - Returns the calculated ddCalcu value
+ */
+async function getDdCalcu(inputUrl) {
+ let wasmInstance = null;
+ let memory_p = null; // Uint8Array view
+ let memory_h = null; // Uint32Array view
+
+ // Fixed parameter
+ const f = 'PBTxuWiTEbUPPFcpyxs0ww==';
+
+ // Utility function: Convert string to UTF-8 in memory
+ function stringToUTF8(string, offset) {
+ const encoder = new TextEncoder();
+ const encoded = encoder.encode(string);
+ for (let i = 0; i < encoded.length; i++) {
+ memory_p[offset + i] = encoded[i];
+ }
+ memory_p[offset + encoded.length] = 0; // Null-terminate
+ }
+
+ // Utility function: Read UTF-8 string from memory address
+ function UTF8ToString(offset) {
+ let s = '';
+ let i = 0;
+ while (memory_p[offset + i]) {
+ s += String.fromCharCode(memory_p[offset + i]);
+ i++;
+ }
+ return s;
+ }
+
+ // WASM import function stubs
+ function a(e, t, r, n) {
+ let s = 0;
+ for (let i = 0; i < r; i++) {
+ const d = memory_h[t + 4 >> 2];
+ t += 8;
+ s += d;
+ }
+ memory_h[n >> 2] = s;
+ return 0;
+ }
+
+ function b() {}
+
+ function c() {}
+
+ // Step 1: Retrieve playerVersion
+ const settingsResp = await fetch('https://app-sc.miguvideo.com/common/v1/settings/H5_DetailPage');
+ const settingsData = await settingsResp.json();
+ const playerVersion = JSON.parse(settingsData.body.paramValue).playerVersion;
+
+ // Step 2: Load WASM module
+ const wasmUrl = `https://www.miguvideo.com/mgs/player/prd/${playerVersion}/dist/mgprtcl.wasm`;
+ const wasmResp = await fetch(wasmUrl);
+ if (!wasmResp.ok) throw new Error("Failed to download WASM");
+ const wasmBuffer = await wasmResp.arrayBuffer();
+
+ const importObject = {
+ a: { a, b, c }
+ };
+
+ const { instance } = await WebAssembly.instantiate(wasmBuffer, importObject);
+ wasmInstance = instance;
+
+ const memory = wasmInstance.exports.d;
+ memory_p = new Uint8Array(memory.buffer);
+ memory_h = new Uint32Array(memory.buffer);
+
+ const exports = {
+ CallInterface1: wasmInstance.exports.h,
+ CallInterface2: wasmInstance.exports.i,
+ CallInterface3: wasmInstance.exports.j,
+ CallInterface4: wasmInstance.exports.k,
+ CallInterface6: wasmInstance.exports.m,
+ CallInterface7: wasmInstance.exports.n,
+ CallInterface8: wasmInstance.exports.o,
+ CallInterface9: wasmInstance.exports.p,
+ CallInterface10: wasmInstance.exports.q,
+ CallInterface11: wasmInstance.exports.r,
+ CallInterface14: wasmInstance.exports.t,
+ malloc: wasmInstance.exports.u,
+ };
+
+ const parsedUrl = new URL(inputUrl);
+ const query = Object.fromEntries(parsedUrl.searchParams);
+
+ const o = query.userid || '';
+ const a_val = query.timestamp || '';
+ const s = query.ProgramID || '';
+ const u = query.Channel_ID || '';
+ const v = query.puData || '';
+
+ // Allocate memory
+ const d = exports.malloc(o.length + 1);
+ const h = exports.malloc(a_val.length + 1);
+ const y = exports.malloc(s.length + 1);
+ const m = exports.malloc(u.length + 1);
+ const g = exports.malloc(v.length + 1);
+ const b_val = exports.malloc(f.length + 1);
+ const E = exports.malloc(128);
+ const T = exports.malloc(128);
+
+ // Write data to memory
+ stringToUTF8(o, d);
+ stringToUTF8(a_val, h);
+ stringToUTF8(s, y);
+ stringToUTF8(u, m);
+ stringToUTF8(v, g);
+ stringToUTF8(f, b_val);
+
+ // Call interface functions
+ const S = exports.CallInterface6(); // Create context
+ exports.CallInterface1(S, y, s.length);
+ exports.CallInterface10(S, h, a_val.length);
+ exports.CallInterface9(S, d, o.length);
+ exports.CallInterface3(S, 0, 0);
+ exports.CallInterface11(S, 0, 0);
+ exports.CallInterface8(S, g, v.length);
+ exports.CallInterface2(S, m, u.length);
+ exports.CallInterface14(S, b_val, f.length, T, 128);
+
+ const w = UTF8ToString(T);
+ const I = exports.malloc(w.length + 1);
+ stringToUTF8(w, I);
+
+ exports.CallInterface7(S, I, w.length);
+ exports.CallInterface4(S, E, 128);
+
+ return UTF8ToString(E);
+}
+
+const url = process.argv[2];
+
+getDdCalcu(url).then(result => {
+ console.log(result);
+}).catch(err => {
+ console.error(err);
+ process.exit(1);
+});
\ No newline at end of file
diff --git a/src/javascript/taobao-sign.js b/src/javascript/taobao-sign.js
new file mode 100644
index 0000000..b130db5
--- /dev/null
+++ b/src/javascript/taobao-sign.js
@@ -0,0 +1,78 @@
+function sign(e) {
+ function t(e, t) {
+ return e << t | e >>> 32 - t
+ }
+ function o(e, t) {
+ var o, n, r, i, a;
+ return r = 2147483648 & e,
+ i = 2147483648 & t,
+ a = (1073741823 & e) + (1073741823 & t),
+ (o = 1073741824 & e) & (n = 1073741824 & t) ? 2147483648 ^ a ^ r ^ i : o | n ? 1073741824 & a ? 3221225472 ^ a ^ r ^ i : 1073741824 ^ a ^ r ^ i : a ^ r ^ i
+ }
+ function n(e, n, r, i, a, s, u) {
+ return o(t(e = o(e, o(o(function(e, t, o) {
+ return e & t | ~e & o
+ }(n, r, i), a), u)), s), n)
+ }
+ function r(e, n, r, i, a, s, u) {
+ return o(t(e = o(e, o(o(function(e, t, o) {
+ return e & o | t & ~o
+ }(n, r, i), a), u)), s), n)
+ }
+ function i(e, n, r, i, a, s, u) {
+ return o(t(e = o(e, o(o(function(e, t, o) {
+ return e ^ t ^ o
+ }(n, r, i), a), u)), s), n)
+ }
+ function a(e, n, r, i, a, s, u) {
+ return o(t(e = o(e, o(o(function(e, t, o) {
+ return t ^ (e | ~o)
+ }(n, r, i), a), u)), s), n)
+ }
+ function s(e) {
+ var t, o = "", n = "";
+ for (t = 0; 3 >= t; t++)
+ o += (n = "0" + (e >>> 8 * t & 255).toString(16)).substr(n.length - 2, 2);
+ return o
+ }
+ var u, l, d, c, p, f, h, m, y, g;
+ for (g = function(e) {
+ for (var t = e.length, o = t + 8, n = 16 * ((o - o % 64) / 64 + 1), r = Array(n - 1), i = 0, a = 0; t > a; )
+ i = a % 4 * 8,
+ r[(a - a % 4) / 4] |= e.charCodeAt(a) << i,
+ a++;
+ return i = a % 4 * 8,
+ r[(a - a % 4) / 4] |= 128 << i,
+ r[n - 2] = t << 3,
+ r[n - 1] = t >>> 29,
+ r
+ }(e = function(e) {
+ var t = String.fromCharCode;
+ e = e.replace(/\r\n/g, "\n");
+ for (var o, n = "", r = 0; r < e.length; r++)
+ 128 > (o = e.charCodeAt(r)) ? n += t(o) : o > 127 && 2048 > o ? (n += t(o >> 6 | 192),
+ n += t(63 & o | 128)) : (n += t(o >> 12 | 224),
+ n += t(o >> 6 & 63 | 128),
+ n += t(63 & o | 128));
+ return n
+ }(e)),
+ f = 1732584193,
+ h = 4023233417,
+ m = 2562383102,
+ y = 271733878,
+ u = 0; u < g.length; u += 16)
+ l = f,
+ d = h,
+ c = m,
+ p = y,
+ h = a(h = a(h = a(h = a(h = i(h = i(h = i(h = i(h = r(h = r(h = r(h = r(h = n(h = n(h = n(h = n(h, m = n(m, y = n(y, f = n(f, h, m, y, g[u + 0], 7, 3614090360), h, m, g[u + 1], 12, 3905402710), f, h, g[u + 2], 17, 606105819), y, f, g[u + 3], 22, 3250441966), m = n(m, y = n(y, f = n(f, h, m, y, g[u + 4], 7, 4118548399), h, m, g[u + 5], 12, 1200080426), f, h, g[u + 6], 17, 2821735955), y, f, g[u + 7], 22, 4249261313), m = n(m, y = n(y, f = n(f, h, m, y, g[u + 8], 7, 1770035416), h, m, g[u + 9], 12, 2336552879), f, h, g[u + 10], 17, 4294925233), y, f, g[u + 11], 22, 2304563134), m = n(m, y = n(y, f = n(f, h, m, y, g[u + 12], 7, 1804603682), h, m, g[u + 13], 12, 4254626195), f, h, g[u + 14], 17, 2792965006), y, f, g[u + 15], 22, 1236535329), m = r(m, y = r(y, f = r(f, h, m, y, g[u + 1], 5, 4129170786), h, m, g[u + 6], 9, 3225465664), f, h, g[u + 11], 14, 643717713), y, f, g[u + 0], 20, 3921069994), m = r(m, y = r(y, f = r(f, h, m, y, g[u + 5], 5, 3593408605), h, m, g[u + 10], 9, 38016083), f, h, g[u + 15], 14, 3634488961), y, f, g[u + 4], 20, 3889429448), m = r(m, y = r(y, f = r(f, h, m, y, g[u + 9], 5, 568446438), h, m, g[u + 14], 9, 3275163606), f, h, g[u + 3], 14, 4107603335), y, f, g[u + 8], 20, 1163531501), m = r(m, y = r(y, f = r(f, h, m, y, g[u + 13], 5, 2850285829), h, m, g[u + 2], 9, 4243563512), f, h, g[u + 7], 14, 1735328473), y, f, g[u + 12], 20, 2368359562), m = i(m, y = i(y, f = i(f, h, m, y, g[u + 5], 4, 4294588738), h, m, g[u + 8], 11, 2272392833), f, h, g[u + 11], 16, 1839030562), y, f, g[u + 14], 23, 4259657740), m = i(m, y = i(y, f = i(f, h, m, y, g[u + 1], 4, 2763975236), h, m, g[u + 4], 11, 1272893353), f, h, g[u + 7], 16, 4139469664), y, f, g[u + 10], 23, 3200236656), m = i(m, y = i(y, f = i(f, h, m, y, g[u + 13], 4, 681279174), h, m, g[u + 0], 11, 3936430074), f, h, g[u + 3], 16, 3572445317), y, f, g[u + 6], 23, 76029189), m = i(m, y = i(y, f = i(f, h, m, y, g[u + 9], 4, 3654602809), h, m, g[u + 12], 11, 3873151461), f, h, g[u + 15], 16, 530742520), y, f, g[u + 2], 23, 3299628645), m = a(m, y = a(y, f = a(f, h, m, y, g[u + 0], 6, 4096336452), h, m, g[u + 7], 10, 1126891415), f, h, g[u + 14], 15, 2878612391), y, f, g[u + 5], 21, 4237533241), m = a(m, y = a(y, f = a(f, h, m, y, g[u + 12], 6, 1700485571), h, m, g[u + 3], 10, 2399980690), f, h, g[u + 10], 15, 4293915773), y, f, g[u + 1], 21, 2240044497), m = a(m, y = a(y, f = a(f, h, m, y, g[u + 8], 6, 1873313359), h, m, g[u + 15], 10, 4264355552), f, h, g[u + 6], 15, 2734768916), y, f, g[u + 13], 21, 1309151649), m = a(m, y = a(y, f = a(f, h, m, y, g[u + 4], 6, 4149444226), h, m, g[u + 11], 10, 3174756917), f, h, g[u + 2], 15, 718787259), y, f, g[u + 9], 21, 3951481745),
+ f = o(f, l),
+ h = o(h, d),
+ m = o(m, c),
+ y = o(y, p);
+ return (s(f) + s(h) + s(m) + s(y)).toLowerCase()
+}
+
+// 正确sign值:05748e8359cd3e6deaab02d15caafc11
+// var sg =sign('5655b7041ca049730330701082886efd&1719411639403&12574478&{"componentKey":"wp_pc_shop_basic_info","params":"{\\"memberId\\":\\"b2b-22133374292418351a\\"}"}')
+// console.log(sg)
\ No newline at end of file
diff --git a/src/javascript/x-bogus.js b/src/javascript/x-bogus.js
new file mode 100644
index 0000000..5cf2bde
--- /dev/null
+++ b/src/javascript/x-bogus.js
@@ -0,0 +1,564 @@
+var window = null;
+
+function _0x5cd844(e) {
+ var b = {
+ exports: {}
+ };
+ return e(b, b.exports), b.exports
+}
+jsvmp = function(e, b, a) {
+ function f(e, b, a) {
+ return (f = function() {
+ if ("undefined" == typeof Reflect || !Reflect.construct || Reflect.construct.sham) return !1;
+ if ("function" == typeof Proxy) return !0;
+ try {
+ return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0
+ } catch (e) {
+ return !1
+ }
+ }() ? Reflect.construct : function(e, b, a) {
+ var f = [null];
+ f.push.apply(f, b);
+ var c = new(Function.bind.apply(e, f));
+ return a && function(e, b) {
+ (Object.setPrototypeOf || function(e, b) {
+ return e.__proto__ = b, e
+ })(e, b)
+ }(c, a.prototype), c
+ }).apply(null, arguments)
+ }
+
+ function c(e) {
+ return function(e) {
+ if (Array.isArray(e)) {
+ for (var b = 0, a = new Array(e.length); b < e.length; b++) a[b] = e[b];
+ return a
+ }
+ }(e) || function(e) {
+ if (Symbol.iterator in Object(e) || "[object Arguments]" === Object.prototype.toString.call(e)) return Array.from(e)
+ }(e) || function() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance")
+ }()
+ }
+ for (var r = [], t = 0, d = [], i = 0, n = function(e, b) {
+ var a = e[b++],
+ f = e[b],
+ c = parseInt("" + a + f, 16);
+ if (c >> 7 == 0) return [1, c];
+ if (c >> 6 == 2) {
+ var r = parseInt("" + e[++b] + e[++b], 16);
+ return c &= 63, [2, r = (c <<= 8) + r]
+ }
+ if (c >> 6 == 3) {
+ var t = parseInt("" + e[++b] + e[++b], 16),
+ d = parseInt("" + e[++b] + e[++b], 16);
+ return c &= 63, [3, d = (c <<= 16) + (t <<= 8) + d]
+ }
+ }, s = function(e, b) {
+ var a = parseInt("" + e[b] + e[b + 1], 16);
+ return a > 127 ? -256 + a : a
+ }, o = function(e, b) {
+ var a = parseInt("" + e[b] + e[b + 1] + e[b + 2] + e[b + 3], 16);
+ return a > 32767 ? -65536 + a : a
+ }, l = function(e, b) {
+ var a = parseInt("" + e[b] + e[b + 1] + e[b + 2] + e[b + 3] + e[b + 4] + e[b + 5] + e[b + 6] + e[b + 7], 16);
+ return a > 2147483647 ? 0 + a : a
+ }, _ = function(e, b) {
+ return parseInt("" + e[b] + e[b + 1], 16)
+ }, x = function(e, b) {
+ return parseInt("" + e[b] + e[b + 1] + e[b + 2] + e[b + 3], 16)
+ }, u = u || this || window, h = (e.length, 0), p = "", y = h; y < h + 16; y++) {
+ var v = "" + e[y++] + e[y];
+ v = parseInt(v, 16), p += String.fromCharCode(v)
+ }
+ if ("HNOJ@?RC" != p) throw new Error("error magic number " + p);
+ parseInt("" + e[h += 16] + e[h + 1], 16), h += 8, t = 0;
+ for (var g = 0; g < 4; g++) {
+ var w = h + 2 * g,
+ A = parseInt("" + e[w++] + e[w], 16);
+ t += (3 & A) << 2 * g
+ }
+ h += 16;
+ var C = parseInt("" + e[h += 8] + e[h + 1] + e[h + 2] + e[h + 3] + e[h + 4] + e[h + 5] + e[h + 6] + e[h + 7], 16),
+ m = C,
+ S = h += 8,
+ z = x(e, h += C);
+ z[1], h += 4, r = {
+ p: [],
+ q: []
+ };
+ for (var B = 0; B < z; B++) {
+ for (var R = n(e, h), q = h += 2 * R[0], I = r.p.length, k = 0; k < R[1]; k++) {
+ var j = n(e, q);
+ r.p.push(j[1]), q += 2 * j[0]
+ }
+ h = q, r.q.push([I, r.p.length])
+ }
+ var O = {
+ 5: 1,
+ 6: 1,
+ 70: 1,
+ 22: 1,
+ 23: 1,
+ 37: 1,
+ 73: 1
+ },
+ U = {
+ 72: 1
+ },
+ D = {
+ 74: 1
+ },
+ N = {
+ 11: 1,
+ 12: 1,
+ 24: 1,
+ 26: 1,
+ 27: 1,
+ 31: 1
+ },
+ J = {
+ 10: 1
+ },
+ L = {
+ 2: 1,
+ 29: 1,
+ 30: 1,
+ 20: 1
+ },
+ T = [],
+ E = [];
+
+ function M(e, b, a) {
+ for (var f = b; f < b + a;) {
+ var c = _(e, f);
+ T[f] = c, f += 2, U[c] ? (E[f] = s(e, f), f += 2) : O[c] ? (E[f] = o(e, f), f += 4) : D[c] ? (E[f] = l(e, f), f += 8) : N[c] ? (E[f] = _(e, f), f += 2) : J[c] ? (E[f] = x(e, f), f += 4) : L[c] && (E[f] = x(e, f), f += 4)
+ }
+ }
+ return F(e, S, m / 2, [], b, a);
+
+ function P(e, b, a, n, h, p, y, v) {
+ null == p && (p = this);
+ var g, w, A, C, m = [],
+ S = 0;
+ y && (w = y);
+ var z, B, R = b,
+ q = R + 2 * a;
+ if (!v)
+ for (; R < q;) {
+ var I = parseInt("" + e[R] + e[R + 1], 16);
+ R += 2;
+ var j = 3 & (z = 13 * I % 241);
+ if (z >>= 2, j < 1)
+ if (j = 3 & z, z >>= 2, j < 1) {
+ if ((j = z) < 1) return [1, m[S--]];
+ j < 5 ? (w = m[S--], m[S] = m[S] * w) : j < 7 ? (w = m[S--], m[S] = m[S] != w) : j < 14 ? (A = m[S--], C = m[S--], (j = m[S--]).x === P ? j.y >= 1 ? m[++S] = F(e, j.c, j.l, A, j.z, C, null, 1) : (m[++S] = F(e, j.c, j.l, A, j.z, C, null, 0), j.y++) : m[++S] = j.apply(C, A)) : j < 16 && (B = o(e, R), (g = function b() {
+ var a = arguments;
+ return b.y > 0 || b.y++, F(e, b.c, b.l, a, b.z, this, null, 0)
+ }).c = R + 4, g.l = B - 2, g.x = P, g.y = 0, g.z = h, m[S] = g, R += 2 * B - 2)
+ } else if (j < 2)(j = z) > 8 ? (w = m[S--], m[S] = typeof w) : j > 4 ? m[S -= 1] = m[S][m[S + 1]] : j > 2 && (A = m[S--], (j = m[S]).x === P ? j.y >= 1 ? m[S] = F(e, j.c, j.l, [A], j.z, C, null, 1) : (m[S] = F(e, j.c, j.l, [A], j.z, C, null, 0), j.y++) : m[S] = j(A));
+ else if (j < 3) {
+ if ((j = z) < 9) {
+ for (w = m[S--], B = x(e, R), j = "", k = r.q[B][0]; k < r.q[B][1]; k++) j += String.fromCharCode(t ^ r.p[k]);
+ R += 4, m[S--][j] = w
+ } else if (j < 13) throw m[S--]
+ } else(j = z) < 1 ? m[++S] = null : j < 3 ? (w = m[S--], m[S] = m[S] >= w) : j < 12 && (m[++S] = void 0);
+ else if (j < 2)
+ if (j = 3 & z, z >>= 2, j < 1)
+ if ((j = z) < 5) {
+ B = o(e, R);
+ try {
+ if (d[i][2] = 1, 1 == (w = P(e, R + 4, B - 3, [], h, p, null, 0))[0]) return w
+ } catch (b) {
+ if (d[i] && d[i][1] && 1 == (w = P(e, d[i][1][0], d[i][1][1], [], h, p, b, 0))[0]) return w
+ } finally {
+ if (d[i] && d[i][0] && 1 == (w = P(e, d[i][0][0], d[i][0][1], [], h, p, null, 0))[0]) return w;
+ d[i] = 0, i--
+ }
+ R += 2 * B - 2
+ } else j < 7 ? (B = _(e, R), R += 2, m[S -= B] = 0 === B ? new m[S] : f(m[S], c(m.slice(S + 1, S + B + 1)))) : j < 9 && (w = m[S--], m[S] = m[S] & w);
+ else if (j < 2)
+ if ((j = z) > 12) m[++S] = s(e, R), R += 2;
+ else if (j > 10) w = m[S--], m[S] = m[S] << w;
+ else if (j > 8) {
+ for (B = x(e, R), j = "", k = r.q[B][0]; k < r.q[B][1]; k++) j += String.fromCharCode(t ^ r.p[k]);
+ R += 4, m[S] = m[S][j]
+ } else j > 6 && (A = m[S--], w = delete m[S--][A]);
+ else if (j < 3)(j = z) < 2 ? m[++S] = w : j < 11 ? (w = m[S -= 2][m[S + 1]] = m[S + 2], S--) : j < 13 && (w = m[S], m[++S] = w);
+ else if ((j = z) > 12) m[++S] = p;
+ else if (j > 5) w = m[S--], m[S] = m[S] !== w;
+ else if (j > 3) w = m[S--], m[S] = m[S] / w;
+ else if (j > 1) {
+ if ((B = o(e, R)) < 0) {
+ v = 1, M(e, b, 2 * a), R += 2 * B - 2;
+ break
+ }
+ R += 2 * B - 2
+ } else j > -1 && (m[S] = !m[S]);
+ else if (j < 3)
+ if (j = 3 & z, z >>= 2, j < 1)(j = z) > 13 ? (m[++S] = o(e, R), R += 4) : j > 11 ? (w = m[S--], m[S] = m[S] >> w) : j > 9 ? (B = _(e, R), R += 2, w = m[S--], h[B] = w) : j > 7 ? (B = x(e, R), R += 4, A = S + 1, m[S -= B - 1] = B ? m.slice(S, A) : []) : j > 0 && (w = m[S--], m[S] = m[S] > w);
+ else if (j < 2)(j = z) > 12 ? (w = m[S - 1], A = m[S], m[++S] = w, m[++S] = A) : j > 3 ? (w = m[S--], m[S] = m[S] == w) : j > 1 ? (w = m[S--], m[S] = m[S] + w) : j > -1 && (m[++S] = u);
+ else if (j < 3) {
+ if ((j = z) > 13) m[++S] = !1;
+ else if (j > 6) w = m[S--], m[S] = m[S] instanceof w;
+ else if (j > 4) w = m[S--], m[S] = m[S] % w;
+ else if (j > 2)
+ if (m[S--]) R += 4;
+ else {
+ if ((B = o(e, R)) < 0) {
+ v = 1, M(e, b, 2 * a), R += 2 * B - 2;
+ break
+ }
+ R += 2 * B - 2
+ }
+ else if (j > 0) {
+ for (B = x(e, R), w = "", k = r.q[B][0]; k < r.q[B][1]; k++) w += String.fromCharCode(t ^ r.p[k]);
+ m[++S] = w, R += 4
+ }
+ } else(j = z) > 7 ? (w = m[S--], m[S] = m[S] | w) : j > 5 ? (B = _(e, R), R += 2, m[++S] = h["$" + B]) : j > 3 && (B = o(e, R), d[i][0] && !d[i][2] ? d[i][1] = [R + 4, B - 3] : d[i++] = [0, [R + 4, B - 3], 0], R += 2 * B - 2);
+ else if (j = 3 & z, z >>= 2, j > 2)(j = z) > 13 ? (m[++S] = l(e, R), R += 8) : j > 11 ? (w = m[S--], m[S] = m[S] >>> w) : j > 9 ? m[++S] = !0 : j > 7 ? (B = _(e, R), R += 2, m[S] = m[S][B]) : j > 0 && (w = m[S--], m[S] = m[S] < w);
+ else if (j > 1)(j = z) > 10 ? (B = o(e, R), d[++i] = [
+ [R + 4, B - 3], 0, 0
+ ], R += 2 * B - 2) : j > 8 ? (w = m[S--], m[S] = m[S] ^ w) : j > 6 && (w = m[S--]);
+ else if (j > 0) {
+ if ((j = z) > 7) w = m[S--], m[S] = m[S] in w;
+ else if (j > 5) m[S] = ++m[S];
+ else if (j > 3) B = _(e, R), R += 2, w = h[B], m[++S] = w;
+ else if (j > 1) {
+ var O = 0,
+ U = m[S].length,
+ D = m[S];
+ m[++S] = function() {
+ var e = O < U;
+ if (e) {
+ var b = D[O++];
+ m[++S] = b
+ }
+ m[++S] = e
+ }
+ }
+ } else if ((j = z) > 13) w = m[S], m[S] = m[S - 1], m[S - 1] = w;
+ else if (j > 4) w = m[S--], m[S] = m[S] === w;
+ else if (j > 2) w = m[S--], m[S] = m[S] - w;
+ else if (j > 0) {
+ for (B = x(e, R), j = "", k = r.q[B][0]; k < r.q[B][1]; k++) j += String.fromCharCode(t ^ r.p[k]);
+ j = +j, R += 4, m[++S] = j
+ }
+ }
+ if (v)
+ for (; R < q;)
+ if (I = T[R], R += 2, j = 3 & (z = 13 * I % 241), z >>= 2, j > 2)
+ if (j = 3 & z, z >>= 2, j > 2)(j = z) < 2 ? (w = m[S--], m[S] = m[S] < w) : j < 9 ? (B = E[R], R += 2, m[S] = m[S][B]) : j < 11 ? m[++S] = !0 : j < 13 ? (w = m[S--], m[S] = m[S] >>> w) : j < 15 && (m[++S] = E[R], R += 8);
+ else if (j > 1)(j = z) < 6 || (j < 8 ? w = m[S--] : j < 10 ? (w = m[S--], m[S] = m[S] ^ w) : j < 12 && (B = E[R], d[++i] = [
+ [R + 4, B - 3], 0, 0
+ ], R += 2 * B - 2));
+ else if (j > 0)(j = z) > 7 ? (w = m[S--], m[S] = m[S] in w) : j > 5 ? m[S] = ++m[S] : j > 3 ? (B = E[R], R += 2, w = h[B], m[++S] = w) : j > 1 && (O = 0, U = m[S].length, D = m[S], m[++S] = function() {
+ var e = O < U;
+ if (e) {
+ var b = D[O++];
+ m[++S] = b
+ }
+ m[++S] = e
+ });
+ else if ((j = z) < 2) {
+ for (B = E[R], j = "", k = r.q[B][0]; k < r.q[B][1]; k++) j += String.fromCharCode(t ^ r.p[k]);
+ j = +j, R += 4, m[++S] = j
+ } else j < 4 ? (w = m[S--], m[S] = m[S] - w) : j < 6 ? (w = m[S--], m[S] = m[S] === w) : j < 15 && (w = m[S], m[S] = m[S - 1], m[S - 1] = w);
+ else if (j > 1)
+ if (j = 3 & z, z >>= 2, j < 1)(j = z) > 13 ? (m[++S] = E[R], R += 4) : j > 11 ? (w = m[S--], m[S] = m[S] >> w) : j > 9 ? (B = E[R], R += 2, w = m[S--], h[B] = w) : j > 7 ? (B = E[R], R += 4, A = S + 1, m[S -= B - 1] = B ? m.slice(S, A) : []) : j > 0 && (w = m[S--], m[S] = m[S] > w);
+ else if (j < 2)(j = z) < 1 ? m[++S] = u : j < 3 ? (w = m[S--], m[S] = m[S] + w) : j < 5 ? (w = m[S--], m[S] = m[S] == w) : j < 14 && (w = m[S - 1], A = m[S], m[++S] = w, m[++S] = A);
+ else if (j < 3) {
+ if ((j = z) > 13) m[++S] = !1;
+ else if (j > 6) w = m[S--], m[S] = m[S] instanceof w;
+ else if (j > 4) w = m[S--], m[S] = m[S] % w;
+ else if (j > 2) m[S--] ? R += 4 : R += 2 * (B = E[R]) - 2;
+ else if (j > 0) {
+ for (B = E[R], w = "", k = r.q[B][0]; k < r.q[B][1]; k++) w += String.fromCharCode(t ^ r.p[k]);
+ m[++S] = w, R += 4
+ }
+ } else(j = z) > 7 ? (w = m[S--], m[S] = m[S] | w) : j > 5 ? (B = E[R], R += 2, m[++S] = h["$" + B]) : j > 3 && (B = E[R], d[i][0] && !d[i][2] ? d[i][1] = [R + 4, B - 3] : d[i++] = [0, [R + 4, B - 3], 0], R += 2 * B - 2);
+ else if (j > 0)
+ if (j = 3 & z, z >>= 2, j < 1) {
+ if ((j = z) > 9);
+ else if (j > 7) w = m[S--], m[S] = m[S] & w;
+ else if (j > 5) B = E[R], R += 2, m[S -= B] = 0 === B ? new m[S] : f(m[S], c(m.slice(S + 1, S + B + 1)));
+ else if (j > 3) {
+ B = E[R];
+ try {
+ if (d[i][2] = 1, 1 == (w = P(e, R + 4, B - 3, [], h, p, null, 0))[0]) return w
+ } catch (b) {
+ if (d[i] && d[i][1] && 1 == (w = P(e, d[i][1][0], d[i][1][1], [], h, p, b, 0))[0]) return w
+ } finally {
+ if (d[i] && d[i][0] && 1 == (w = P(e, d[i][0][0], d[i][0][1], [], h, p, null, 0))[0]) return w;
+ d[i] = 0, i--
+ }
+ R += 2 * B - 2
+ }
+ } else if (j < 2)
+ if ((j = z) < 8) A = m[S--], w = delete m[S--][A];
+ else if (j < 10) {
+ for (B = E[R], j = "", k = r.q[B][0]; k < r.q[B][1]; k++) j += String.fromCharCode(t ^ r.p[k]);
+ R += 4, m[S] = m[S][j]
+ } else j < 12 ? (w = m[S--], m[S] = m[S] << w) : j < 14 && (m[++S] = E[R], R += 2);
+ else j < 3 ? (j = z) < 2 ? m[++S] = w : j < 11 ? (w = m[S -= 2][m[S + 1]] = m[S + 2], S--) : j < 13 && (w = m[S], m[++S] = w) : (j = z) > 12 ? m[++S] = p : j > 5 ? (w = m[S--], m[S] = m[S] !== w) : j > 3 ? (w = m[S--], m[S] = m[S] / w) : j > 1 ? R += 2 * (B = E[R]) - 2 : j > -1 && (m[S] = !m[S]);
+ else if (j = 3 & z, z >>= 2, j < 1) {
+ if ((j = z) < 1) return [1, m[S--]];
+ j < 5 ? (w = m[S--], m[S] = m[S] * w) : j < 7 ? (w = m[S--], m[S] = m[S] != w) : j < 14 ? (A = m[S--], C = m[S--], (j = m[S--]).x === P ? j.y >= 1 ? m[++S] = F(e, j.c, j.l, A, j.z, C, null, 1) : (m[++S] = F(e, j.c, j.l, A, j.z, C, null, 0), j.y++) : m[++S] = j.apply(C, A)) : j < 16 && (B = E[R], (g = function b() {
+ var a = arguments;
+ return b.y > 0 || b.y++, F(e, b.c, b.l, a, b.z, this, null, 0)
+ }).c = R + 4, g.l = B - 2, g.x = P, g.y = 0, g.z = h, m[S] = g, R += 2 * B - 2)
+ } else if (j < 2)(j = z) > 8 ? (w = m[S--], m[S] = typeof w) : j > 4 ? m[S -= 1] = m[S][m[S + 1]] : j > 2 && (A = m[S--], (j = m[S]).x === P ? j.y >= 1 ? m[S] = F(e, j.c, j.l, [A], j.z, C, null, 1) : (m[S] = F(e, j.c, j.l, [A], j.z, C, null, 0), j.y++) : m[S] = j(A));
+ else if (j < 3) {
+ if ((j = z) < 9) {
+ for (w = m[S--], B = E[R], j = "", k = r.q[B][0]; k < r.q[B][1]; k++) j += String.fromCharCode(t ^ r.p[k]);
+ R += 4, m[S--][j] = w
+ } else if (j < 13) throw m[S--]
+ } else(j = z) < 1 ? m[++S] = null : j < 3 ? (w = m[S--], m[S] = m[S] >= w) : j < 12 && (m[++S] = void 0);
+ return [0, null]
+ }
+
+ function F(e, b, a, f, c, r, t, d) {
+ null == r && (r = this), c && !c.d && (c.d = 0, c.$0 = c, c[1] = {});
+ var i, n, s = {},
+ o = s.d = c ? c.d + 1 : 0;
+ for (s["$" + o] = s, n = 0; n < o; n++) s[i = "$" + n] = c[i];
+ for (n = 0, o = s.length = f.length; n < o; n++) s[n] = f[n];
+ return d && !T[b] && M(e, b, 2 * a), T[b] ? P(e, b, a, 0, s, r, null, 1)[1] : P(e, b, a, 0, s, r, null, 0)[1]
+ }
+};
+var _0x397dc7 = "undefined" != typeof globalThis ? globalThis : void 0 !== window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {},
+ _0x124d1a = _0x5cd844(function(_0x770f81) {
+ ! function() {
+ var _0x250d36 = "input is invalid type",
+ _0x4cfaee = !1,
+ _0x1702f9 = {},
+ _0x5ccbb3 = !_0x4cfaee && "object" == typeof self,
+ _0x54d876 = !_0x1702f9.JS_MD5_NO_NODE_JS && "object" == typeof process && process.versions && process.versions.node,
+ _0x185caf;
+ _0x54d876 ? _0x1702f9 = _0x397dc7 : _0x5ccbb3 && (_0x1702f9 = self);
+ var _0x17dcbf = !_0x1702f9.JS_MD5_NO_COMMON_JS && _0x770f81.exports,
+ _0x554fed = !1,
+ _0x2de28f = !_0x1702f9.JS_MD5_NO_ARRAY_BUFFER && "undefined" != typeof ArrayBuffer,
+ _0x3a9a1b = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"],
+ _0x465562 = [128, 32768, 8388608, -2147483648],
+ _0x20b37e = [0, 8, 16, 24],
+ _0x323604 = ["hex", "array", "digest", "buffer", "arrayBuffer", "base64"],
+ _0x2c185e = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/"],
+ _0x4b59e0 = [];
+ if (_0x2de28f) {
+ var _0x395837 = new ArrayBuffer(68);
+ _0x185caf = new Uint8Array(_0x395837), _0x4b59e0 = new Uint32Array(_0x395837)
+ }!_0x1702f9.JS_MD5_NO_NODE_JS && Array.isArray || (Array.isArray = function(e) {
+ return "[object Array]" === Object.prototype.toString.call(e)
+ }), _0x2de28f && (_0x1702f9.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function(e) {
+ return "object" == typeof e && e.buffer && e.buffer.constructor === ArrayBuffer
+ });
+ var _0x4e9930 = function(e) {
+ return function(b) {
+ return new _0x5887c8(!0).update(b)[e]()
+ }
+ },
+ _0x38ba77 = function() {
+ var e = _0x4e9930("hex");
+ _0x54d876 && (e = _0x474989(e)), e.create = function() {
+ return new _0x5887c8
+ }, e.update = function(b) {
+ return e.create().update(b)
+ };
+ for (var b = 0; b < _0x323604.length; ++b) {
+ var a = _0x323604[b];
+ e[a] = _0x4e9930(a)
+ }
+ return e
+ },
+ _0x474989 = function(_0x57eeaa) {
+ var _0x114910, _0x226465 = eval("require('crypto');"),
+ _0x1f6ae0 = eval("require('buffer')['Buffer'];");
+ return function(e) {
+ if ("string" == typeof e) return _0x226465.createHash("md5").update(e, "utf8").digest("hex");
+ if (null == e) throw _0x250d36;
+ return e.constructor === ArrayBuffer && (e = new Uint8Array(e)), Array.isArray(e) || ArrayBuffer.isView(e) || e.constructor === _0x1f6ae0 ? _0x226465.createHash("md5").update(new _0x1f6ae0.from(e)).digest("hex") : _0x57eeaa(e)
+ }
+ };
+
+ function _0x5887c8(e) {
+ if (e) _0x4b59e0[0] = _0x4b59e0[16] = _0x4b59e0[1] = _0x4b59e0[2] = _0x4b59e0[3] = _0x4b59e0[4] = _0x4b59e0[5] = _0x4b59e0[6] = _0x4b59e0[7] = _0x4b59e0[8] = _0x4b59e0[9] = _0x4b59e0[10] = _0x4b59e0[11] = _0x4b59e0[12] = _0x4b59e0[13] = _0x4b59e0[14] = _0x4b59e0[15] = 0, this.blocks = _0x4b59e0, this.buffer8 = _0x185caf;
+ else if (_0x2de28f) {
+ var b = new ArrayBuffer(68);
+ this.buffer8 = new Uint8Array(b), this.blocks = new Uint32Array(b)
+ } else this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = !1, this.first = !0
+ }
+ _0x5887c8.prototype.update = function(e) {
+ if (!this.finalized) {
+ var b, a = typeof e;
+ if ("string" !== a) {
+ if ("object" !== a || null === e) throw _0x250d36;
+ if (_0x2de28f && e.constructor === ArrayBuffer) e = new Uint8Array(e);
+ else if (!(Array.isArray(e) || _0x2de28f && ArrayBuffer.isView(e))) throw _0x250d36;
+ b = !0
+ }
+ for (var f, c, r = 0, t = e.length, d = this.blocks, i = this.buffer8; r < t;) {
+ if (this.hashed && (this.hashed = !1, d[0] = d[16], d[16] = d[1] = d[2] = d[3] = d[4] = d[5] = d[6] = d[7] = d[8] = d[9] = d[10] = d[11] = d[12] = d[13] = d[14] = d[15] = 0), b)
+ if (_0x2de28f)
+ for (c = this.start; r < t && c < 64; ++r) i[c++] = e[r];
+ else
+ for (c = this.start; r < t && c < 64; ++r) d[c >> 2] |= e[r] << _0x20b37e[3 & c++];
+ else if (_0x2de28f)
+ for (c = this.start; r < t && c < 64; ++r)(f = e.charCodeAt(r)) < 128 ? i[c++] = f : f < 2048 ? (i[c++] = 192 | f >> 6, i[c++] = 128 | 63 & f) : f < 55296 || f >= 57344 ? (i[c++] = 224 | f >> 12, i[c++] = 128 | f >> 6 & 63, i[c++] = 128 | 63 & f) : (f = 65536 + ((1023 & f) << 10 | 1023 & e.charCodeAt(++r)), i[c++] = 240 | f >> 18, i[c++] = 128 | f >> 12 & 63, i[c++] = 128 | f >> 6 & 63, i[c++] = 128 | 63 & f);
+ else
+ for (c = this.start; r < t && c < 64; ++r)(f = e.charCodeAt(r)) < 128 ? d[c >> 2] |= f << _0x20b37e[3 & c++] : f < 2048 ? (d[c >> 2] |= (192 | f >> 6) << _0x20b37e[3 & c++], d[c >> 2] |= (128 | 63 & f) << _0x20b37e[3 & c++]) : f < 55296 || f >= 57344 ? (d[c >> 2] |= (224 | f >> 12) << _0x20b37e[3 & c++], d[c >> 2] |= (128 | f >> 6 & 63) << _0x20b37e[3 & c++], d[c >> 2] |= (128 | 63 & f) << _0x20b37e[3 & c++]) : (f = 65536 + ((1023 & f) << 10 | 1023 & e.charCodeAt(++r)), d[c >> 2] |= (240 | f >> 18) << _0x20b37e[3 & c++], d[c >> 2] |= (128 | f >> 12 & 63) << _0x20b37e[3 & c++], d[c >> 2] |= (128 | f >> 6 & 63) << _0x20b37e[3 & c++], d[c >> 2] |= (128 | 63 & f) << _0x20b37e[3 & c++]);
+ this.lastByteIndex = c, this.bytes += c - this.start, c >= 64 ? (this.start = c - 64, this.hash(), this.hashed = !0) : this.start = c
+ }
+ return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this
+ }
+ }, _0x5887c8.prototype.finalize = function() {
+ if (!this.finalized) {
+ this.finalized = !0;
+ var e = this.blocks,
+ b = this.lastByteIndex;
+ e[b >> 2] |= _0x465562[3 & b], b >= 56 && (this.hashed || this.hash(), e[0] = e[16], e[16] = e[1] = e[2] = e[3] = e[4] = e[5] = e[6] = e[7] = e[8] = e[9] = e[10] = e[11] = e[12] = e[13] = e[14] = e[15] = 0), e[14] = this.bytes << 3, e[15] = this.hBytes << 3 | this.bytes >>> 29, this.hash()
+ }
+ }, _0x5887c8.prototype.hash = function() {
+ var e, b, a, f, c, r, t = this.blocks;
+ this.first ? b = ((b = ((e = ((e = t[0] - 680876937) << 7 | e >>> 25) - 271733879 << 0) ^ (a = ((a = (-271733879 ^ (f = ((f = (-1732584194 ^ 2004318071 & e) + t[1] - 117830708) << 12 | f >>> 20) + e << 0) & (-271733879 ^ e)) + t[2] - 1126478375) << 17 | a >>> 15) + f << 0) & (f ^ e)) + t[3] - 1316259209) << 22 | b >>> 10) + a << 0 : (e = this.h0, b = this.h1, a = this.h2, b = ((b += ((e = ((e += ((f = this.h3) ^ b & (a ^ f)) + t[0] - 680876936) << 7 | e >>> 25) + b << 0) ^ (a = ((a += (b ^ (f = ((f += (a ^ e & (b ^ a)) + t[1] - 389564586) << 12 | f >>> 20) + e << 0) & (e ^ b)) + t[2] + 606105819) << 17 | a >>> 15) + f << 0) & (f ^ e)) + t[3] - 1044525330) << 22 | b >>> 10) + a << 0), b = ((b += ((e = ((e += (f ^ b & (a ^ f)) + t[4] - 176418897) << 7 | e >>> 25) + b << 0) ^ (a = ((a += (b ^ (f = ((f += (a ^ e & (b ^ a)) + t[5] + 1200080426) << 12 | f >>> 20) + e << 0) & (e ^ b)) + t[6] - 1473231341) << 17 | a >>> 15) + f << 0) & (f ^ e)) + t[7] - 45705983) << 22 | b >>> 10) + a << 0, b = ((b += ((e = ((e += (f ^ b & (a ^ f)) + t[8] + 1770035416) << 7 | e >>> 25) + b << 0) ^ (a = ((a += (b ^ (f = ((f += (a ^ e & (b ^ a)) + t[9] - 1958414417) << 12 | f >>> 20) + e << 0) & (e ^ b)) + t[10] - 42063) << 17 | a >>> 15) + f << 0) & (f ^ e)) + t[11] - 1990404162) << 22 | b >>> 10) + a << 0, b = ((b += ((e = ((e += (f ^ b & (a ^ f)) + t[12] + 1804603682) << 7 | e >>> 25) + b << 0) ^ (a = ((a += (b ^ (f = ((f += (a ^ e & (b ^ a)) + t[13] - 40341101) << 12 | f >>> 20) + e << 0) & (e ^ b)) + t[14] - 1502002290) << 17 | a >>> 15) + f << 0) & (f ^ e)) + t[15] + 1236535329) << 22 | b >>> 10) + a << 0, b = ((b += ((f = ((f += (b ^ a & ((e = ((e += (a ^ f & (b ^ a)) + t[1] - 165796510) << 5 | e >>> 27) + b << 0) ^ b)) + t[6] - 1069501632) << 9 | f >>> 23) + e << 0) ^ e & ((a = ((a += (e ^ b & (f ^ e)) + t[11] + 643717713) << 14 | a >>> 18) + f << 0) ^ f)) + t[0] - 373897302) << 20 | b >>> 12) + a << 0, b = ((b += ((f = ((f += (b ^ a & ((e = ((e += (a ^ f & (b ^ a)) + t[5] - 701558691) << 5 | e >>> 27) + b << 0) ^ b)) + t[10] + 38016083) << 9 | f >>> 23) + e << 0) ^ e & ((a = ((a += (e ^ b & (f ^ e)) + t[15] - 660478335) << 14 | a >>> 18) + f << 0) ^ f)) + t[4] - 405537848) << 20 | b >>> 12) + a << 0, b = ((b += ((f = ((f += (b ^ a & ((e = ((e += (a ^ f & (b ^ a)) + t[9] + 568446438) << 5 | e >>> 27) + b << 0) ^ b)) + t[14] - 1019803690) << 9 | f >>> 23) + e << 0) ^ e & ((a = ((a += (e ^ b & (f ^ e)) + t[3] - 187363961) << 14 | a >>> 18) + f << 0) ^ f)) + t[8] + 1163531501) << 20 | b >>> 12) + a << 0, b = ((b += ((f = ((f += (b ^ a & ((e = ((e += (a ^ f & (b ^ a)) + t[13] - 1444681467) << 5 | e >>> 27) + b << 0) ^ b)) + t[2] - 51403784) << 9 | f >>> 23) + e << 0) ^ e & ((a = ((a += (e ^ b & (f ^ e)) + t[7] + 1735328473) << 14 | a >>> 18) + f << 0) ^ f)) + t[12] - 1926607734) << 20 | b >>> 12) + a << 0, b = ((b += ((r = (f = ((f += ((c = b ^ a) ^ (e = ((e += (c ^ f) + t[5] - 378558) << 4 | e >>> 28) + b << 0)) + t[8] - 2022574463) << 11 | f >>> 21) + e << 0) ^ e) ^ (a = ((a += (r ^ b) + t[11] + 1839030562) << 16 | a >>> 16) + f << 0)) + t[14] - 35309556) << 23 | b >>> 9) + a << 0, b = ((b += ((r = (f = ((f += ((c = b ^ a) ^ (e = ((e += (c ^ f) + t[1] - 1530992060) << 4 | e >>> 28) + b << 0)) + t[4] + 1272893353) << 11 | f >>> 21) + e << 0) ^ e) ^ (a = ((a += (r ^ b) + t[7] - 155497632) << 16 | a >>> 16) + f << 0)) + t[10] - 1094730640) << 23 | b >>> 9) + a << 0, b = ((b += ((r = (f = ((f += ((c = b ^ a) ^ (e = ((e += (c ^ f) + t[13] + 681279174) << 4 | e >>> 28) + b << 0)) + t[0] - 358537222) << 11 | f >>> 21) + e << 0) ^ e) ^ (a = ((a += (r ^ b) + t[3] - 722521979) << 16 | a >>> 16) + f << 0)) + t[6] + 76029189) << 23 | b >>> 9) + a << 0, b = ((b += ((r = (f = ((f += ((c = b ^ a) ^ (e = ((e += (c ^ f) + t[9] - 640364487) << 4 | e >>> 28) + b << 0)) + t[12] - 421815835) << 11 | f >>> 21) + e << 0) ^ e) ^ (a = ((a += (r ^ b) + t[15] + 530742520) << 16 | a >>> 16) + f << 0)) + t[2] - 995338651) << 23 | b >>> 9) + a << 0, b = ((b += ((f = ((f += (b ^ ((e = ((e += (a ^ (b | ~f)) + t[0] - 198630844) << 6 | e >>> 26) + b << 0) | ~a)) + t[7] + 1126891415) << 10 | f >>> 22) + e << 0) ^ ((a = ((a += (e ^ (f | ~b)) + t[14] - 1416354905) << 15 | a >>> 17) + f << 0) | ~e)) + t[5] - 57434055) << 21 | b >>> 11) + a << 0, b = ((b += ((f = ((f += (b ^ ((e = ((e += (a ^ (b | ~f)) + t[12] + 1700485571) << 6 | e >>> 26) + b << 0) | ~a)) + t[3] - 1894986606) << 10 | f >>> 22) + e << 0) ^ ((a = ((a += (e ^ (f | ~b)) + t[10] - 1051523) << 15 | a >>> 17) + f << 0) | ~e)) + t[1] - 2054922799) << 21 | b >>> 11) + a << 0, b = ((b += ((f = ((f += (b ^ ((e = ((e += (a ^ (b | ~f)) + t[8] + 1873313359) << 6 | e >>> 26) + b << 0) | ~a)) + t[15] - 30611744) << 10 | f >>> 22) + e << 0) ^ ((a = ((a += (e ^ (f | ~b)) + t[6] - 1560198380) << 15 | a >>> 17) + f << 0) | ~e)) + t[13] + 1309151649) << 21 | b >>> 11) + a << 0, b = ((b += ((f = ((f += (b ^ ((e = ((e += (a ^ (b | ~f)) + t[4] - 145523070) << 6 | e >>> 26) + b << 0) | ~a)) + t[11] - 1120210379) << 10 | f >>> 22) + e << 0) ^ ((a = ((a += (e ^ (f | ~b)) + t[2] + 718787259) << 15 | a >>> 17) + f << 0) | ~e)) + t[9] - 343485551) << 21 | b >>> 11) + a << 0, this.first ? (this.h0 = e + 1732584193 << 0, this.h1 = b - 271733879 << 0, this.h2 = a - 1732584194 << 0, this.h3 = f + 271733878 << 0, this.first = !1) : (this.h0 = this.h0 + e << 0, this.h1 = this.h1 + b << 0, this.h2 = this.h2 + a << 0, this.h3 = this.h3 + f << 0)
+ }, _0x5887c8.prototype.hex = function() {
+ this.finalize();
+ var e = this.h0,
+ b = this.h1,
+ a = this.h2,
+ f = this.h3;
+ return _0x3a9a1b[e >> 4 & 15] + _0x3a9a1b[15 & e] + _0x3a9a1b[e >> 12 & 15] + _0x3a9a1b[e >> 8 & 15] + _0x3a9a1b[e >> 20 & 15] + _0x3a9a1b[e >> 16 & 15] + _0x3a9a1b[e >> 28 & 15] + _0x3a9a1b[e >> 24 & 15] + _0x3a9a1b[b >> 4 & 15] + _0x3a9a1b[15 & b] + _0x3a9a1b[b >> 12 & 15] + _0x3a9a1b[b >> 8 & 15] + _0x3a9a1b[b >> 20 & 15] + _0x3a9a1b[b >> 16 & 15] + _0x3a9a1b[b >> 28 & 15] + _0x3a9a1b[b >> 24 & 15] + _0x3a9a1b[a >> 4 & 15] + _0x3a9a1b[15 & a] + _0x3a9a1b[a >> 12 & 15] + _0x3a9a1b[a >> 8 & 15] + _0x3a9a1b[a >> 20 & 15] + _0x3a9a1b[a >> 16 & 15] + _0x3a9a1b[a >> 28 & 15] + _0x3a9a1b[a >> 24 & 15] + _0x3a9a1b[f >> 4 & 15] + _0x3a9a1b[15 & f] + _0x3a9a1b[f >> 12 & 15] + _0x3a9a1b[f >> 8 & 15] + _0x3a9a1b[f >> 20 & 15] + _0x3a9a1b[f >> 16 & 15] + _0x3a9a1b[f >> 28 & 15] + _0x3a9a1b[f >> 24 & 15]
+ }, _0x5887c8.prototype.toString = _0x5887c8.prototype.hex, _0x5887c8.prototype.digest = function() {
+ this.finalize();
+ var e = this.h0,
+ b = this.h1,
+ a = this.h2,
+ f = this.h3;
+ return [255 & e, e >> 8 & 255, e >> 16 & 255, e >> 24 & 255, 255 & b, b >> 8 & 255, b >> 16 & 255, b >> 24 & 255, 255 & a, a >> 8 & 255, a >> 16 & 255, a >> 24 & 255, 255 & f, f >> 8 & 255, f >> 16 & 255, f >> 24 & 255]
+ }, _0x5887c8.prototype.array = _0x5887c8.prototype.digest, _0x5887c8.prototype.arrayBuffer = function() {
+ this.finalize();
+ var e = new ArrayBuffer(16),
+ b = new Uint32Array(e);
+ return b[0] = this.h0, b[1] = this.h1, b[2] = this.h2, b[3] = this.h3, e
+ }, _0x5887c8.prototype.buffer = _0x5887c8.prototype.arrayBuffer, _0x5887c8.prototype.base64 = function() {
+ for (var e, b, a, f = "", c = this.array(), r = 0; r < 15;) e = c[r++], b = c[r++], a = c[r++], f += _0x2c185e[e >>> 2] + _0x2c185e[63 & (e << 4 | b >>> 4)] + _0x2c185e[63 & (b << 2 | a >>> 6)] + _0x2c185e[63 & a];
+ return f + (_0x2c185e[(e = c[r]) >>> 2] + _0x2c185e[e << 4 & 63] + "==")
+ };
+ var _0x4dd781 = _0x38ba77();
+ _0x17dcbf ? _0x770f81.exports = _0x4dd781 : (_0x1702f9.md5 = _0x4dd781, _0x554fed && (void 0)(function() {
+ return _0x4dd781
+ }))
+ }()
+ });
+
+function _0x178cef(e) {
+ return jsvmp("484e4f4a403f52430038001eab0015840e8ee21a00000000000000621b000200001d000146000306000e271f001b000200021d00010500121b001b000b021b000b04041d0001071b000b0500000003000126207575757575757575757575757575757575757575757575757575757575757575", [, , void 0 !== _0x124d1a ? _0x124d1a : void 0, _0x178cef, e])
+}
+for (var _0xb55f3e = {
+ boe: !1,
+ aid: 0,
+ dfp: !1,
+ sdi: !1,
+ enablePathList: [],
+ _enablePathListRegex: [],
+ urlRewriteRules: [],
+ _urlRewriteRules: [],
+ initialized: !1,
+ enableTrack: !1,
+ track: {
+ unitTime: 0,
+ unitAmount: 0,
+ fre: 0
+ },
+ triggerUnload: !1,
+ region: "",
+ regionConf: {},
+ umode: 0,
+ v: !1,
+ perf: !1,
+ xxbg: !0
+ }, _0x3eaf64 = {
+ debug: function(e, b) {
+ let a = !1;
+ a = !1
+ }
+ }, _0x233455 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"], _0x2e9f6d = [], _0x511f86 = [], _0x3d35de = 0; _0x3d35de < 256; _0x3d35de++) _0x2e9f6d[_0x3d35de] = _0x233455[_0x3d35de >> 4 & 15] + _0x233455[15 & _0x3d35de], _0x3d35de < 16 && (_0x3d35de < 10 ? _0x511f86[48 + _0x3d35de] = _0x3d35de : _0x511f86[87 + _0x3d35de] = _0x3d35de);
+var _0x2ce54d = function(e) {
+ for (var b = e.length, a = "", f = 0; f < b;) a += _0x2e9f6d[e[f++]];
+ return a
+ },
+ _0x5960a2 = function(e) {
+ for (var b = e.length >> 1, a = b << 1, f = new Uint8Array(b), c = 0, r = 0; r < a;) f[c++] = _0x511f86[e.charCodeAt(r++)] << 4 | _0x511f86[e.charCodeAt(r++)];
+ return f
+ },
+ _0x4e46b6 = {
+ encode: _0x2ce54d,
+ decode: _0x5960a2
+ };
+
+function sign(e, b) {
+ return jsvmp("484e4f4a403f5243001f240fbf2031ccf317480300000000000007181b0002012e1d00921b000b171b000b02402217000a1c1b000b1726402217000c1c1b000b170200004017002646000306000e271f001b000200021d00920500121b001b000b031b000b17041d0092071b000b041e012f17000d1b000b05260a0000101c1b000b06260a0000101c1b001b000b071e01301d00931b001b000b081e00081d00941b0048021d00951b001b000b1b1d00961b0048401d009e1b001b000b031b000b16041d009f1b001b000b09221e0131241b000b031b000b09221e0131241b000b1e0a000110040a0001101d00d51b001b000b09221e0131241b000b031b000b09221e0131241b000b180a000110040a0001101d00d71b001b000b0a1e00101d00d91b001b000b0b261b000b1a1b000b190a0002101d00db1b001b000b0c261b000b221b000b210a0002101d00dc1b001b000b0d261b000b230200200a0002101d00dd1b001b000b09221e0131241b000b031b000b24040a0001101d00df1b001b000b0e1a00221e00de240a0000104903e82b1d00e31b001b000b0f260a0000101d00e41b001b000b1d1d00e71b001b000b1a4901002b1d00e81b001b000b1a4901002c1d00ea1b001b000b191d00f21b001b000b1f480e191d00f81b001b000b1f480f191d00f91b001b000b20480e191d00fb1b001b000b20480f191d00fe1b001b000b25480e191d01001b001b000b25480f191d01011b001b000b264818344900ff2f1d01031b001b000b264810344900ff2f1d01321b001b000b264808344900ff2f1d01331b001b000b264800344900ff2f1d01341b001b000b274818344900ff2f1d01351b001b000b274810344900ff2f1d01361b001b000b274808344900ff2f1d01371b001b000b274800344900ff2f1d01381b001b000b281b000b29311b000b2a311b000b2b311b000b2c311b000b2d311b000b2e311b000b2f311b000b30311b000b31311b000b32311b000b33311b000b34311b000b35311b000b36311b000b37311b000b38311b000b39311d01391b004900ff1d013a1b001b000b10261b000b281b000b2a1b000b2c1b000b2e1b000b301b000b321b000b341b000b361b000b381b000b3a1b000b291b000b2b1b000b2d1b000b2f1b000b311b000b331b000b351b000b371b000b390a0013101d013b1b001b000b0c261b000b111b000b3b041b000b3c0a0002101d013c1b001b000b12261b000b1c1b000b3b1b000b3d0a0003101d013d1b001b000b13261b000b3e0200240a0002101d013e1b000b3f0000013f000126207575757575757575757575757575757575757575757575757575757575757575012b0e7776757a7d7643617c637661676a027a77065c717976706708777671667474766107767d65707c77760374766707707c7d607c7f7607757a61767166740a7c66677661447a77677b0a7a7d7d7661447a77677b0b7c666776615b767a747b670b7a7d7d76615b767a747b6709666076615274767d670b677c5f7c64766150726076077a7d77766b5c7508767f767067617c7d09667d7776757a7d76770963617c677c676a637608677c4067617a7d740470727f7f0763617c7076606010487c71797670673363617c707660604e067c717976706705677a677f76047d7c7776012e0125012402602341525150575655545b5a59585f5e5d5c43424140474645444b4a49727170777675747b7a79787f7e7d7c63626160676665646b6a6923222120272625242b2a383c2e0260224157787763747b2749586042512b233c5e75656420254b5a22412126384446527f567a245d5f717c624a475c4366697e5579597d616a6b2a5b45547072406750762e0260214157787763747b2749586042512b233c5e75656420254b5a224121263e4446527f567a245d5f717c624a475c4366697e5579597d616a6b2a5b45547072406750762e02602041525150575655545b5a59585f5e5d5c43424140474645444b4a49727170777675747b7a79787f7e7d7c63626160676665646b6a6923222120272625242b2a3e4c2e012a022222067f767d74677b0a707b7261507c7776526702222306707b726152670f487c717976706733447a7d777c644e08577c70667e767d6712487c7179767067335d72657a7472677c614e057960777c7e10487c7179767067335b7a60677c616a4e07637f66747a7d60084c637b727d677c7e0b70727f7f437b727d677c7e0b4c4c7d7a747b677e726176055266777a7c1850727d65726041767d7776617a7d74507c7d67766b6721570964767177617a657661137476675c647d43617c637661676a5d727e7660097f727d74667274766006707b617c7e760761667d677a7e7607707c7d7d767067144c4c64767177617a6576614c7665727f66726776134c4c60767f767d7a667e4c7665727f667267761b4c4c64767177617a6576614c6070617a63674c75667d70677a7c7d174c4c64767177617a6576614c6070617a63674c75667d70154c4c64767177617a6576614c6070617a63674c757d134c4c756b77617a6576614c7665727f66726776124c4c77617a6576614c667d64617263637677154c4c64767177617a6576614c667d64617263637677114c4c77617a6576614c7665727f66726776144c4c60767f767d7a667e4c667d64617263637677144c4c756b77617a6576614c667d64617263637677094c60767f767d7a667e0c70727f7f40767f767d7a667e164c40767f767d7a667e4c5a57564c4176707c6177766108777c70667e767d670478766a60057e7267707b06417674566b630a4f3748723e694e77704c067072707b764c04607c7e7608707675407b72616308507675407b72616305767c72637a16767c44767151617c64607661577a60637267707b76610f717a7d775c717976706752606a7d700e7a60565c44767151617c646076610120047c63767d0467766067097a7d707c747d7a677c077c7d7661617c6104707c77761242465c47524c564b5056565756574c5641410e607660607a7c7d40677c61727476076076675a67767e10607c7e7658766a5b766176516a6776770a61767e7c65765a67767e097a7d77766b767757510c437c7a7d6776615665767d670e5e40437c7a7d6776615665767d670d706176726776567f767e767d670670727d65726009677c5772677246415f076176637f727076034f603901740a7d72677a6576707c777614487c717976706733437f66747a7d526161726a4e4a4d7b676763602c294f3c4f3c3b48233e2a4e68223f206e3b4f3d48233e2a4e68223f206e3a68206e6f48723e75233e2a4e68223f276e3b2948723e75233e2a4e68223f276e3a68246e3a0127087f7c7072677a7c7d047b61767504757a7f76107b676763293c3c7f7c70727f7b7c606708637f7267757c617e02222102222007647a7d777c646002222703647a7d02222607727d77617c7a77022225057f7a7d666b022224067a637b7c7d7602222b047a63727702222a047a637c77022123037e7270022122097e72707a7d677c607b0c7e72704c637c64766163703a0470617c60036b22220570617a7c6005756b7a7c6004637a787602212102212002212702212602212502212402212b08757a6176757c6b3c067c637661723c05337c63613c05337c63673c07707b617c7e763c0867617a77767d673c047e607a7602212a0220230665767d777c6106547c7c747f760e4c637261727e40647a67707b5c7d0a777a61767067407a747d0a707c7d607a6067767d670660647a67707b03777c7e07637b727d677c7e047b7c7c7840525150575655545b5a59585f5e5d5c43424140474645444b4a49727170777675747b7a79787f7e7d7c63626160676665646b6a6923222120272625242b2a3e3d03727a77017d01750161096067726167477a7e7601670972717a7f7a677a76600a677a7e766067727e6322137b72617764726176507c7d70666161767d706a0c7776657a70765e767e7c616a087f727d74667274760a6176607c7f66677a7c7d0f7265727a7f4176607c7f66677a7c7d0960706176767d477c630a60706176767d5f767567107776657a7076437a6b767f4172677a7c0a63617c77667067406671077172676776616a016309677c66707b5a7d757c08677a7e76697c7d760a677a7e766067727e6321077463665a7d757c0b7960557c7d67605f7a60670b637f66747a7d605f7a60670a677a7e766067727e63200a76657661507c7c787a760767674c60707a77017e0b606a7d67726b5661617c610c7d72677a65765f767d74677b056167705a43097563457661607a7c7d0b4c4c657661607a7c7d4c4c08707f7a767d675a770a677a7e766067727e63270b766b67767d77557a767f77046366607b03727f7f04677b767d097172607625274c707b0c75617c7e507b7261507c7776067125274c2023022022087172607625274c23022021087172607625274c22022020087172607625274c2102202702202602202507747667477a7e760220240b777c7e5d7c6745727f7a77096066716067617a7d740863617c677c707c7f02202b02202a01230e222323232323232322222323232302272302272207757c616176727f02272104717c776a096067617a7d747a756a02686e0b717c776a45727f216067610a717c776a4c7b72607b2e01350366617f02272005626676616a0a72607c7f774c607a747d096372677b7d727e762e0967674c6476717a772e063566667a772e0227270227260e4c716a6776774c6076704c777a770227250a27212a272a2524212a25097576457661607a7c7d0227240e4c232151274925647c232323232202272b02272a05607f7a7076022623074056505a5d555c037d7c6409677a7e766067727e6305757f7c7c610661727d777c7e0f7476674747447671507c7c787a7660056767647a770867674c6476717a770767674476715a770b67674c6476717a774c65210967674476717a7745210761667d7d7a7d7405757f66607b087e7c65765f7a60670660637f7a70760671765e7c657609707f7a70785f7a6067077176507f7a70780c78766a717c7261775f7a60670a717658766a717c7261770b7270677a657640677267760b647a7d777c6440677267760360477e05676172707808667d7a67477a7e76037270700a667d7a67527e7c667d670871767b72657a7c61077e6074476a637603645a5707727a775f7a60670b63617a6572706a5e7c777606706660677c7e067260607a747d0f4456514c5756455a50564c5a5d555c0479607c7d0a6176747a7c7d507c7d75096176637c616746617f04766b7a67094b3e5e403e404746510c4b3e5e403e43524a5f5c525720232323232323232323232323232323232323232323232323232323232323232320772722772b70772a2b75232371212327762a2b23232a2a2b7670752b272124760165066671707c7776067776707c777602262202262102262002262702262602262502262402262b02262a022523022522022521022520", [, , void 0, void 0 !== _0x178cef ? _0x178cef : void 0, {
+ boe: !1,
+ aid: 0,
+ dfp: !1,
+ sdi: !1,
+ enablePathList: [],
+ _enablePathListRegex: [/\/web\/report/],
+ urlRewriteRules: [],
+ _urlRewriteRules: [],
+ initialized: !1,
+ enableTrack: !1,
+ track: {
+ unitTime: 0,
+ unitAmount: 0,
+ fre: 0
+ },
+ triggerUnload: !1,
+ region: "",
+ regionConf: {},
+ umode: 0,
+ v: !1,
+ perf: !1,
+ xxbg: !0
+ }, () => 0, () => "03v", {
+ ubcode: 0
+ }, {
+ bogusIndex: 0,
+ msNewTokenList: [],
+ moveList: [],
+ clickList: [],
+ keyboardList: [],
+ activeState: [],
+ aidList: [],
+ envcode: 0,
+ msToken: "",
+ msStatus: 0,
+ __ac_testid: "",
+ ttwid: "",
+ tt_webid: "",
+ tt_webid_v2: ""
+ }, void 0 !== _0x4e46b6 ? _0x4e46b6 : void 0, {
+ userAgent: b
+ }, (e, b) => {
+ let a = new Uint8Array(3);
+ return a[0] = e / 256, a[1] = e % 256, a[2] = b % 256, String.fromCharCode.apply(null, a)
+ }, (e, b) => {
+ let a, f = [],
+ c = 0,
+ r = "";
+ for (let e = 0; e < 256; e++) f[e] = e;
+ for (let b = 0; b < 256; b++) c = (c + f[b] + e.charCodeAt(b % e.length)) % 256, a = f[b], f[b] = f[c], f[c] = a;
+ let t = 0;
+ c = 0;
+ for (let e = 0; e < b.length; e++) c = (c + f[t = (t + 1) % 256]) % 256, a = f[t], f[t] = f[c], f[c] = a, r += String.fromCharCode(b.charCodeAt(e) ^ f[(f[t] + f[c]) % 256]);
+ return r
+ }, (e, b) => jsvmp("484e4f4a403f524300281018f7b851f02d296e5b00000000000004a21b0002001d1d001e1b00131e00061a001d001f1b000b070200200200210d1b000b070200220200230d1b000b070200240200250d1b000b070200260200270d1b001b000b071b000b05191d00031b000200001d00281b0048001d00291b000b041e002a1b000b0b4803283b1700f11b001b000b04221e002b241b001e0029222d1b00241d00290a0001104900ff2f4810331b000b04221e002b241b001e0029222d1b00241d00290a0001104900ff2f480833301b000b04221e002b241b001e0029222d1b00241d00290a0001104900ff2f301d002c1b00220b091b000b08221e002d241b000b0a4a00fc00002f4812340a000110281d00281b00220b091b000b08221e002d241b000b0a4a0003f0002f480c340a000110281d00281b00220b091b000b08221e002d241b000b0a490fc02f4806340a000110281d00281b00220b091b000b08221e002d241b000b0a483f2f0a000110281d002816ff031b000b041e002a1b000b0b294800391700e01b001b000b04221e002b241b001e0029222d1b00241d00290a0001104900ff2f4810331b000b041e002a1b000b0b3917001e1b000b04221e002b241b000b0b0a0001104900ff2f4808331600054800301d002c1b00220b091b000b08221e002d241b000b0a4a00fc00002f4812340a000110281d00281b00220b091b000b08221e002d241b000b0a4a0003f0002f480c340a000110281d00281b00220b091b000b041e002a1b000b0b3917001e1b000b08221e002d241b000b0a490fc02f4806340a0001101600071b000b06281d00281b00220b091b000b06281d00281b000b090000002e000126207575757575757575757575757575757575757575757575757575757575757575012b0e7776757a7d7643617c637661676a027a77065c717976706708777671667474766107767d65707c77760374766707707c7d607c7f7607757a61767166740a7c66677661447a77677b0a7a7d7d7661447a77677b0b7c666776615b767a747b670b7a7d7d76615b767a747b6709666076615274767d670b677c5f7c64766150726076077a7d77766b5c7508767f767067617c7d09667d7776757a7d76770963617c677c676a637608677c4067617a7d740470727f7f0763617c7076606010487c71797670673363617c707660604e067c717976706705677a677f76047d7c7776012e0125012402602341525150575655545b5a59585f5e5d5c43424140474645444b4a49727170777675747b7a79787f7e7d7c63626160676665646b6a6923222120272625242b2a383c2e0260224157787763747b2749586042512b233c5e75656420254b5a22412126384446527f567a245d5f717c624a475c4366697e5579597d616a6b2a5b45547072406750762e0260214157787763747b2749586042512b233c5e75656420254b5a224121263e4446527f567a245d5f717c624a475c4366697e5579597d616a6b2a5b45547072406750762e02602041525150575655545b5a59585f5e5d5c43424140474645444b4a49727170777675747b7a79787f7e7d7c63626160676665646b6a6923222120272625242b2a3e4c2e012a022222067f767d74677b0a707b7261507c7776526702222306707b72615267", [, , , , e, b]), "undefined" != typeof Date ? Date : void 0, () => 0, (e, b, a, f, c, r, t, d, i, n, s, o, l, _, x, u, h, p, y) => {
+ let v = new Uint8Array(19);
+ return v[0] = e, v[1] = s, v[2] = b, v[3] = o, v[4] = a, v[5] = l, v[6] = f, v[7] = _, v[8] = c, v[9] = x, v[10] = r, v[11] = u, v[12] = t, v[13] = h, v[14] = d, v[15] = p, v[16] = i, v[17] = y, v[18] = n, String.fromCharCode.apply(null, v)
+ }, e => String.fromCharCode(e), (e, b, a) => String.fromCharCode(e) + String.fromCharCode(b) + a, (e, b) => jsvmp("484e4f4a403f524300281018f7b851f02d296e5b00000000000004a21b0002001d1d001e1b00131e00061a001d001f1b000b070200200200210d1b000b070200220200230d1b000b070200240200250d1b000b070200260200270d1b001b000b071b000b05191d00031b000200001d00281b0048001d00291b000b041e002a1b000b0b4803283b1700f11b001b000b04221e002b241b001e0029222d1b00241d00290a0001104900ff2f4810331b000b04221e002b241b001e0029222d1b00241d00290a0001104900ff2f480833301b000b04221e002b241b001e0029222d1b00241d00290a0001104900ff2f301d002c1b00220b091b000b08221e002d241b000b0a4a00fc00002f4812340a000110281d00281b00220b091b000b08221e002d241b000b0a4a0003f0002f480c340a000110281d00281b00220b091b000b08221e002d241b000b0a490fc02f4806340a000110281d00281b00220b091b000b08221e002d241b000b0a483f2f0a000110281d002816ff031b000b041e002a1b000b0b294800391700e01b001b000b04221e002b241b001e0029222d1b00241d00290a0001104900ff2f4810331b000b041e002a1b000b0b3917001e1b000b04221e002b241b000b0b0a0001104900ff2f4808331600054800301d002c1b00220b091b000b08221e002d241b000b0a4a00fc00002f4812340a000110281d00281b00220b091b000b08221e002d241b000b0a4a0003f0002f480c340a000110281d00281b00220b091b000b041e002a1b000b0b3917001e1b000b08221e002d241b000b0a490fc02f4806340a0001101600071b000b06281d00281b00220b091b000b06281d00281b000b090000002e000126207575757575757575757575757575757575757575757575757575757575757575012b0e7776757a7d7643617c637661676a027a77065c717976706708777671667474766107767d65707c77760374766707707c7d607c7f7607757a61767166740a7c66677661447a77677b0a7a7d7d7661447a77677b0b7c666776615b767a747b670b7a7d7d76615b767a747b6709666076615274767d670b677c5f7c64766150726076077a7d77766b5c7508767f767067617c7d09667d7776757a7d76770963617c677c676a637608677c4067617a7d740470727f7f0763617c7076606010487c71797670673363617c707660604e067c717976706705677a677f76047d7c7776012e0125012402602341525150575655545b5a59585f5e5d5c43424140474645444b4a49727170777675747b7a79787f7e7d7c63626160676665646b6a6923222120272625242b2a383c2e0260224157787763747b2749586042512b233c5e75656420254b5a22412126384446527f567a245d5f717c624a475c4366697e5579597d616a6b2a5b45547072406750762e0260214157787763747b2749586042512b233c5e75656420254b5a224121263e4446527f567a245d5f717c624a475c4366697e5579597d616a6b2a5b45547072406750762e02602041525150575655545b5a59585f5e5d5c43424140474645444b4a49727170777675747b7a79787f7e7d7c63626160676665646b6a6923222120272625242b2a3e4c2e012a022222067f767d74677b0a707b7261507c7776526702222306707b72615267", [, , , , e, b]), , sign, e, void 0])
+}
+
+module.exports = {
+ sign
+ };
\ No newline at end of file
diff --git a/src/logger.py b/src/logger.py
new file mode 100644
index 0000000..93faeae
--- /dev/null
+++ b/src/logger.py
@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+
+import os
+import sys
+from loguru import logger
+
+logger.remove()
+
+custom_format = "{time:YYYY-MM-DD HH:mm:ss.SSS} | {level: <8} - {message}"
+
+logger.add(
+ sink=sys.stderr,
+ format=custom_format,
+ level="DEBUG",
+ colorize=True,
+ enqueue=True
+)
+
+script_path = os.path.split(os.path.realpath(sys.argv[0]))[0]
+
+logger.add(
+ f"{script_path}/logs/streamget.log",
+ level="DEBUG",
+ format="{time:YYYY-MM-DD HH:mm:ss.SSS} | {level: <8} | {name}:{function}:{line} - {message}",
+ filter=lambda i: i["level"].name != "INFO",
+ serialize=False,
+ enqueue=True,
+ retention=1,
+ rotation="300 KB",
+ encoding='utf-8'
+)
+
+logger.add(
+ f"{script_path}/logs/PlayURL.log",
+ level="INFO",
+ format="{time:YYYY-MM-DD HH:mm:ss.SSS} | {message}",
+ filter=lambda i: i["level"].name == "INFO",
+ serialize=False,
+ enqueue=True,
+ retention=1,
+ rotation="300 KB",
+ encoding='utf-8'
+)
diff --git a/src/proxy.py b/src/proxy.py
new file mode 100644
index 0000000..28e3148
--- /dev/null
+++ b/src/proxy.py
@@ -0,0 +1,92 @@
+import os
+import sys
+from enum import Enum, auto
+from dataclasses import dataclass, field
+from .utils import logger
+
+
+class ProxyType(Enum):
+ HTTP = auto()
+ HTTPS = auto()
+ SOCKS = auto()
+
+
+@dataclass(frozen=True)
+class ProxyInfo:
+ ip: str = field(default="", repr=True)
+ port: str = field(default="", repr=True)
+
+ def __post_init__(self):
+ if (self.ip and not self.port) or (not self.ip and self.port):
+ raise ValueError("IP or port cannot be empty")
+
+ if (self.ip and self.port) and (not self.port.isdigit() or not (1 <= int(self.port) <= 65535)):
+ raise ValueError("Port must be a digit between 1 and 65535")
+
+
+class ProxyDetector:
+ def __init__(self):
+ if sys.platform.startswith('win'):
+ import winreg
+ self.winreg = winreg
+ self.__path = r'Software\Microsoft\Windows\CurrentVersion\Internet Settings'
+ with winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) as key_user:
+ self.__INTERNET_SETTINGS = winreg.OpenKeyEx(key_user, self.__path, 0, winreg.KEY_ALL_ACCESS)
+ else:
+ self.__is_windows = False
+
+ def get_proxy_info(self) -> ProxyInfo:
+ if sys.platform.startswith('win'):
+ ip, port = self._get_proxy_info_windows()
+ else:
+ ip, port = self._get_proxy_info_linux()
+ return ProxyInfo(ip, port)
+
+ def is_proxy_enabled(self) -> bool:
+ if sys.platform.startswith('win'):
+ return self._is_proxy_enabled_windows()
+ else:
+ return self._is_proxy_enabled_linux()
+
+ def _get_proxy_info_windows(self) -> tuple[str, str]:
+ ip, port = "", ""
+ if self._is_proxy_enabled_windows():
+ try:
+ ip_port = self.winreg.QueryValueEx(self.__INTERNET_SETTINGS, "ProxyServer")[0]
+ if ip_port:
+ ip, port = ip_port.split(":")
+ except FileNotFoundError as err:
+ logger.warning("No proxy information found: " + str(err))
+ except Exception as err:
+ logger.error("An error occurred: " + str(err))
+ else:
+ logger.debug("No proxy is enabled on the system")
+ return ip, port
+
+ def _is_proxy_enabled_windows(self) -> bool:
+ try:
+ if self.winreg.QueryValueEx(self.__INTERNET_SETTINGS, "ProxyEnable")[0] == 1:
+ return True
+ except FileNotFoundError as err:
+ print("No proxy information found: " + str(err))
+ except Exception as err:
+ print("An error occurred: " + str(err))
+ return False
+
+ @staticmethod
+ def _get_proxy_info_linux() -> tuple[str, str]:
+ proxies = {
+ 'http': os.getenv('http_proxy'),
+ 'https': os.getenv('https_proxy'),
+ 'ftp': os.getenv('ftp_proxy')
+ }
+ ip = port = ""
+ for proto, proxy in proxies.items():
+ if proxy:
+ ip, port = proxy.split(':')
+ break
+ return ip, port
+
+ def _is_proxy_enabled_linux(self) -> bool:
+ proxies = self._get_proxy_info_linux()
+ return any(proxy != '' for proxy in proxies)
diff --git a/src/room.py b/src/room.py
new file mode 100644
index 0000000..307187f
--- /dev/null
+++ b/src/room.py
@@ -0,0 +1,150 @@
+# -*- encoding: utf-8 -*-
+
+"""
+Author: Hmily
+GitHub:https://github.com/ihmily
+Date: 2023-07-17 23:52:05
+Update: 2025-02-04 04:57:00
+Copyright (c) 2023 by Hmily, All Rights Reserved.
+"""
+import re
+import urllib.parse
+import execjs
+import httpx
+import urllib.request
+from . import JS_SCRIPT_PATH, utils
+
+no_proxy_handler = urllib.request.ProxyHandler({})
+opener = urllib.request.build_opener(no_proxy_handler)
+
+
+class UnsupportedUrlError(Exception):
+ pass
+
+
+HEADERS = {
+ 'User-Agent': 'Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973U) AppleWebKit/537.36 (KHTML, like Gecko) '
+ 'SamsungBrowser/14.2 Chrome/87.0.4280.141 Mobile Safari/537.36',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'Cookie': 's_v_web_id=verify_lk07kv74_QZYCUApD_xhiB_405x_Ax51_GYO9bUIyZQVf'
+}
+
+HEADERS_PC = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) '
+ 'Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0',
+ 'Cookie': 'sessionid=7494ae59ae06784454373ce25761e864; __ac_nonce=0670497840077ee4c9eb2; '
+ '__ac_signature=_02B4Z6wo00f012DZczQAAIDCJJBb3EjnINdg-XeAAL8-db; '
+ 's_v_web_id=verify_m1ztgtjj_vuHnMLZD_iwZ9_4YO4_BdN1_7wLP3pyqXsf2; '
+ }
+
+
+# X-bogus算法
+async def get_xbogus(url: str, headers: dict | None = None) -> str:
+ if not headers or 'user-agent' not in (k.lower() for k in headers):
+ headers = HEADERS
+ query = urllib.parse.urlparse(url).query
+ xbogus = execjs.compile(open(f'{JS_SCRIPT_PATH}/x-bogus.js').read()).call(
+ 'sign', query, headers.get("User-Agent", "user-agent"))
+ return xbogus
+
+
+# 获取房间ID和用户secID
+async def get_sec_user_id(url: str, proxy_addr: str | None = None, headers: dict | None = None) -> tuple | None:
+ if not headers or all(k.lower() not in ['user-agent', 'cookie'] for k in headers):
+ headers = HEADERS
+
+ try:
+ proxy_addr = utils.handle_proxy_addr(proxy_addr)
+ async with httpx.AsyncClient(proxy=proxy_addr, timeout=15) as client:
+ response = await client.get(url, headers=headers, follow_redirects=True)
+ redirect_url = response.url
+ if 'reflow/' in str(redirect_url):
+ match = re.search(r'sec_user_id=([\w_\-]+)&', str(redirect_url))
+ if match:
+ sec_user_id = match.group(1)
+ room_id = str(redirect_url).split('?')[0].rsplit('/', maxsplit=1)[1]
+ return room_id, sec_user_id
+ else:
+ raise RuntimeError("Could not find sec_user_id in the URL.")
+ else:
+ raise UnsupportedUrlError("The redirect URL does not contain 'reflow/'.")
+ except UnsupportedUrlError as e:
+ raise e
+ except Exception as e:
+ raise RuntimeError(f"An error occurred: {e}")
+
+
+# 获取抖音号
+async def get_unique_id(url: str, proxy_addr: str | None = None, headers: dict | None = None) -> str | None:
+ if not headers or all(k.lower() not in ['user-agent', 'cookie'] for k in headers):
+ headers = HEADERS
+
+ try:
+ proxy_addr = utils.handle_proxy_addr(proxy_addr)
+ async with httpx.AsyncClient(proxy=proxy_addr, timeout=15) as client:
+ response = await client.get(url, headers=headers, follow_redirects=True)
+ redirect_url = str(response.url)
+ if 'reflow/' in str(redirect_url):
+ raise UnsupportedUrlError("Unsupported URL")
+ sec_user_id = redirect_url.split('?')[0].rsplit('/', maxsplit=1)[1]
+ headers['Cookie'] = ('ttwid=1%7C4ejCkU2bKY76IySQENJwvGhg1IQZrgGEupSyTKKfuyk%7C1740470403%7Cbc9a'
+ 'd2ee341f1a162f9e27f4641778030d1ae91e31f9df6553a8f2efa3bdb7b4; __ac_nonce=06'
+ '83e59f3009cc48fbab0; __ac_signature=_02B4Z6wo00f01mG6waQAAIDB9JUCzFb6.TZhmsU'
+ 'AAPBf34; __ac_referer=__ac_blank')
+ user_page_response = await client.get(f'https://www.iesdouyin.com/share/user/{sec_user_id}',
+ headers=headers, follow_redirects=True)
+ matches = re.findall(r'unique_id":"(.*?)","verification_type', user_page_response.text)
+ if matches:
+ unique_id = matches[-1]
+ return unique_id
+ else:
+ raise RuntimeError("Could not find unique_id in the response.")
+ except UnsupportedUrlError as e:
+ raise e
+ except Exception as e:
+ raise RuntimeError(f"An error occurred: {e}")
+
+
+# 获取直播间webID
+async def get_live_room_id(room_id: str, sec_user_id: str, proxy_addr: str | None = None, params: dict | None = None,
+ headers: dict | None = None) -> str:
+ if not headers or all(k.lower() not in ['user-agent', 'cookie'] for k in headers):
+ headers = HEADERS
+
+ if not params:
+ params = {
+ "verifyFp": "verify_lk07kv74_QZYCUApD_xhiB_405x_Ax51_GYO9bUIyZQVf",
+ "type_id": "0",
+ "live_id": "1",
+ "room_id": room_id,
+ "sec_user_id": sec_user_id,
+ "app_id": "1128",
+ "msToken": "wrqzbEaTlsxt52-vxyZo_mIoL0RjNi1ZdDe7gzEGMUTVh_HvmbLLkQrA_1HKVOa2C6gkxb6IiY6TY2z8enAkPEwGq--gM"
+ "-me3Yudck2ailla5Q4osnYIHxd9dI4WtQ==",
+ }
+
+ api = f'https://webcast.amemv.com/webcast/room/reflow/info/?{urllib.parse.urlencode(params)}'
+ xbogus = await get_xbogus(api)
+ api = api + "&X-Bogus=" + xbogus
+
+ try:
+ proxy_addr = utils.handle_proxy_addr(proxy_addr)
+ async with httpx.AsyncClient(proxy=proxy_addr,
+ timeout=15) as client:
+ response = await client.get(api, headers=headers)
+ response.raise_for_status()
+ json_data = response.json()
+ return json_data['data']['room']['owner']['web_rid']
+ except httpx.HTTPStatusError as e:
+ print(f"HTTP status error occurred: {e.response.status_code}")
+ raise
+ except Exception as e:
+ print(f"An exception occurred during get_live_room_id: {e}")
+ raise
+
+
+if __name__ == '__main__':
+ room_url = "https://v.douyin.com/iQLgKSj/"
+ _room_id, sec_uid = get_sec_user_id(room_url)
+ web_rid = get_live_room_id(_room_id, sec_uid)
+ print("return web_rid:", web_rid)
diff --git a/src/spider.py b/src/spider.py
new file mode 100644
index 0000000..2b5c682
--- /dev/null
+++ b/src/spider.py
@@ -0,0 +1,3253 @@
+# -*- encoding: utf-8 -*-
+
+"""
+Author: Hmily
+GitHub: https://github.com/ihmily
+Date: 2023-07-15 23:15:00
+Update: 2025-07-19 17:43:00
+Copyright (c) 2023-2025 by Hmily, All Rights Reserved.
+Function: Get live stream data.
+"""
+
+import hashlib
+import random
+import subprocess
+import time
+import uuid
+from operator import itemgetter
+import urllib.parse
+import urllib.error
+from typing import List
+import httpx
+import ssl
+import re
+import json
+import execjs
+import urllib.request
+from . import JS_SCRIPT_PATH, utils
+from .utils import trace_error_decorator, generate_random_string
+from .logger import script_path
+from .room import get_sec_user_id, get_unique_id, UnsupportedUrlError
+from .http_clients.async_http import async_req
+
+
+ssl_context = ssl.create_default_context()
+ssl_context.check_hostname = False
+ssl_context.verify_mode = ssl.CERT_NONE
+OptionalStr = str | None
+OptionalDict = dict | None
+
+
+def get_params(url: str, params: str) -> OptionalStr:
+ parsed_url = urllib.parse.urlparse(url)
+ query_params = urllib.parse.parse_qs(parsed_url.query)
+
+ if params in query_params:
+ return query_params[params][0]
+
+
+async def get_play_url_list(m3u8: str, proxy: OptionalStr = None, header: OptionalDict = None,
+ abroad: bool = False) -> List[str]:
+ resp = await async_req(url=m3u8, proxy_addr=proxy, headers=header, abroad=abroad)
+ play_url_list = []
+ for i in resp.split('\n'):
+ if i.startswith('https://'):
+ play_url_list.append(i.strip())
+ if not play_url_list:
+ for i in resp.split('\n'):
+ if i.strip().endswith('m3u8'):
+ play_url_list.append(i.strip())
+ bandwidth_pattern = re.compile(r'BANDWIDTH=(\d+)')
+ bandwidth_list = bandwidth_pattern.findall(resp)
+ url_to_bandwidth = {url: int(bandwidth) for bandwidth, url in zip(bandwidth_list, play_url_list)}
+ play_url_list = sorted(play_url_list, key=lambda url: url_to_bandwidth[url], reverse=True)
+ return play_url_list
+
+
+@trace_error_decorator
+async def get_douyin_app_stream_data(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'Referer': 'https://live.douyin.com/',
+ 'Cookie': 'ttwid=1%7CB1qls3GdnZhUov9o2NxOMxxYS2ff6OSvEWbv0ytbES4%7C1680522049%7C280d802d6d478e3e78d0c807f7c487e7ffec0ae4e5fdd6a0fe74c3c6af149511; my_rd=1; passport_csrf_token=3ab34460fa656183fccfb904b16ff742; passport_csrf_token_default=3ab34460fa656183fccfb904b16ff742; d_ticket=9f562383ac0547d0b561904513229d76c9c21; n_mh=hvnJEQ4Q5eiH74-84kTFUyv4VK8xtSrpRZG1AhCeFNI; store-region=cn-fj; store-region-src=uid; LOGIN_STATUS=1; __security_server_data_status=1; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; pwa2=%223%7C0%7C3%7C0%22; download_guide=%223%2F20230729%2F0%22; volume_info=%7B%22isUserMute%22%3Afalse%2C%22isMute%22%3Afalse%2C%22volume%22%3A0.6%7D; strategyABtestKey=%221690824679.923%22; stream_recommend_feed_params=%22%7B%5C%22cookie_enabled%5C%22%3Atrue%2C%5C%22screen_width%5C%22%3A1536%2C%5C%22screen_height%5C%22%3A864%2C%5C%22browser_online%5C%22%3Atrue%2C%5C%22cpu_core_num%5C%22%3A8%2C%5C%22device_memory%5C%22%3A8%2C%5C%22downlink%5C%22%3A10%2C%5C%22effective_type%5C%22%3A%5C%224g%5C%22%2C%5C%22round_trip_time%5C%22%3A150%7D%22; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1691443863751%2C%22type%22%3Anull%7D; home_can_add_dy_2_desktop=%221%22; __live_version__=%221.1.1.2169%22; device_web_cpu_core=8; device_web_memory_size=8; xgplayer_user_id=346045893336; csrf_session_id=2e00356b5cd8544d17a0e66484946f28; odin_tt=724eb4dd23bc6ffaed9a1571ac4c757ef597768a70c75fef695b95845b7ffcd8b1524278c2ac31c2587996d058e03414595f0a4e856c53bd0d5e5f56dc6d82e24004dc77773e6b83ced6f80f1bb70627; __ac_nonce=064caded4009deafd8b89; __ac_signature=_02B4Z6wo00f01HLUuwwAAIDBh6tRkVLvBQBy9L-AAHiHf7; ttcid=2e9619ebbb8449eaa3d5a42d8ce88ec835; webcast_leading_last_show_time=1691016922379; webcast_leading_total_show_times=1; webcast_local_quality=sd; live_can_add_dy_2_desktop=%221%22; msToken=1JDHnVPw_9yTvzIrwb7cQj8dCMNOoesXbA_IooV8cezcOdpe4pzusZE7NB7tZn9TBXPr0ylxmv-KMs5rqbNUBHP4P7VBFUu0ZAht_BEylqrLpzgt3y5ne_38hXDOX8o=; msToken=jV_yeN1IQKUd9PlNtpL7k5vthGKcHo0dEh_QPUQhr8G3cuYv-Jbb4NnIxGDmhVOkZOCSihNpA2kvYtHiTW25XNNX_yrsv5FN8O6zm3qmCIXcEe0LywLn7oBO2gITEeg=; tt_scid=mYfqpfbDjqXrIGJuQ7q-DlQJfUSG51qG.KUdzztuGP83OjuVLXnQHjsz-BRHRJu4e986'
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ async def get_app_data(room_id: str, sec_uid: str) -> dict:
+ app_params = {
+ "verifyFp": "verify_lxj5zv70_7szNlAB7_pxNY_48Vh_ALKF_GA1Uf3yteoOY",
+ "type_id": "0",
+ "live_id": "1",
+ "room_id": room_id,
+ "sec_user_id": sec_uid,
+ "version_code": "99.99.99",
+ "app_id": "1128"
+ }
+ api2 = f'https://webcast.amemv.com/webcast/room/reflow/info/?{urllib.parse.urlencode(app_params)}'
+ json_str2 = await async_req(url=api2, proxy_addr=proxy_addr, headers=headers)
+ json_data2 = json.loads(json_str2)['data']
+ room_data2 = json_data2['room']
+ room_data2['anchor_name'] = room_data2['owner']['nickname']
+ return room_data2
+
+ try:
+ web_rid = url.split('?')[0].split('live.douyin.com/')
+ if len(web_rid) > 1:
+ web_rid = web_rid[1]
+ params = {
+ "aid": "6383",
+ "app_name": "douyin_web",
+ "live_id": "1",
+ "device_platform": "web",
+ "language": "zh-CN",
+ "browser_language": "zh-CN",
+ "browser_platform": "Win32",
+ "browser_name": "Chrome",
+ "browser_version": "116.0.0.0",
+ "web_rid": web_rid,
+ 'msToken': '',
+ 'a_bogus': ''
+
+ }
+ api = f'https://live.douyin.com/webcast/room/web/enter/?{urllib.parse.urlencode(params)}'
+ json_str = await async_req(url=api, proxy_addr=proxy_addr, headers=headers)
+ json_data = json.loads(json_str)['data']
+ room_data = json_data['data'][0]
+ room_data['anchor_name'] = json_data['user']['nickname']
+ else:
+ try:
+ data = await get_sec_user_id(url, proxy_addr=proxy_addr)
+ _room_id, _sec_uid = data
+ room_data = await get_app_data(_room_id, _sec_uid)
+ except UnsupportedUrlError:
+ unique_id = await get_unique_id(url, proxy_addr=proxy_addr)
+ return await get_douyin_stream_data(f'https://live.douyin.com/{unique_id}')
+
+ if room_data['status'] == 2:
+ if 'stream_url' not in room_data:
+ raise RuntimeError(
+ "The live streaming type or gameplay is not supported on the computer side yet, please use the "
+ "app to share the link for recording."
+ )
+ live_core_sdk_data = room_data['stream_url']['live_core_sdk_data']
+ pull_datas = room_data['stream_url']['pull_datas']
+ if live_core_sdk_data:
+ if pull_datas:
+ key = list(pull_datas.keys())[0]
+ json_str = pull_datas[key]['stream_data']
+ else:
+ json_str = live_core_sdk_data['pull_data']['stream_data']
+ json_data = json.loads(json_str)
+ if 'origin' in json_data['data']:
+ stream_data = live_core_sdk_data['pull_data']['stream_data']
+ origin_data = json.loads(stream_data)['data']['origin']['main']
+ sdk_params = json.loads(origin_data['sdk_params'])
+ origin_hls_codec = sdk_params.get('VCodec') or ''
+
+ origin_url_list = json_data['data']['origin']['main']
+ origin_m3u8 = {'ORIGIN': origin_url_list["hls"] + '&codec=' + origin_hls_codec}
+ origin_flv = {'ORIGIN': origin_url_list["flv"] + '&codec=' + origin_hls_codec}
+ hls_pull_url_map = room_data['stream_url']['hls_pull_url_map']
+ flv_pull_url = room_data['stream_url']['flv_pull_url']
+ room_data['stream_url']['hls_pull_url_map'] = {**origin_m3u8, **hls_pull_url_map}
+ room_data['stream_url']['flv_pull_url'] = {**origin_flv, **flv_pull_url}
+ except Exception as e:
+ print(f"Error message: {e} Error line: {e.__traceback__.tb_lineno}")
+ room_data = {'anchor_name': ""}
+ return room_data
+
+
+@trace_error_decorator
+async def get_douyin_stream_data(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'Referer': 'https://live.douyin.com/',
+ 'Cookie': 'ttwid=1%7CB1qls3GdnZhUov9o2NxOMxxYS2ff6OSvEWbv0ytbES4%7C1680522049%7C280d802d6d478e3e78d0c807f7c487e7ffec0ae4e5fdd6a0fe74c3c6af149511; my_rd=1; passport_csrf_token=3ab34460fa656183fccfb904b16ff742; passport_csrf_token_default=3ab34460fa656183fccfb904b16ff742; d_ticket=9f562383ac0547d0b561904513229d76c9c21; n_mh=hvnJEQ4Q5eiH74-84kTFUyv4VK8xtSrpRZG1AhCeFNI; store-region=cn-fj; store-region-src=uid; LOGIN_STATUS=1; __security_server_data_status=1; FORCE_LOGIN=%7B%22videoConsumedRemainSeconds%22%3A180%7D; pwa2=%223%7C0%7C3%7C0%22; download_guide=%223%2F20230729%2F0%22; volume_info=%7B%22isUserMute%22%3Afalse%2C%22isMute%22%3Afalse%2C%22volume%22%3A0.6%7D; strategyABtestKey=%221690824679.923%22; stream_recommend_feed_params=%22%7B%5C%22cookie_enabled%5C%22%3Atrue%2C%5C%22screen_width%5C%22%3A1536%2C%5C%22screen_height%5C%22%3A864%2C%5C%22browser_online%5C%22%3Atrue%2C%5C%22cpu_core_num%5C%22%3A8%2C%5C%22device_memory%5C%22%3A8%2C%5C%22downlink%5C%22%3A10%2C%5C%22effective_type%5C%22%3A%5C%224g%5C%22%2C%5C%22round_trip_time%5C%22%3A150%7D%22; VIDEO_FILTER_MEMO_SELECT=%7B%22expireTime%22%3A1691443863751%2C%22type%22%3Anull%7D; home_can_add_dy_2_desktop=%221%22; __live_version__=%221.1.1.2169%22; device_web_cpu_core=8; device_web_memory_size=8; xgplayer_user_id=346045893336; csrf_session_id=2e00356b5cd8544d17a0e66484946f28; odin_tt=724eb4dd23bc6ffaed9a1571ac4c757ef597768a70c75fef695b95845b7ffcd8b1524278c2ac31c2587996d058e03414595f0a4e856c53bd0d5e5f56dc6d82e24004dc77773e6b83ced6f80f1bb70627; __ac_nonce=064caded4009deafd8b89; __ac_signature=_02B4Z6wo00f01HLUuwwAAIDBh6tRkVLvBQBy9L-AAHiHf7; ttcid=2e9619ebbb8449eaa3d5a42d8ce88ec835; webcast_leading_last_show_time=1691016922379; webcast_leading_total_show_times=1; webcast_local_quality=sd; live_can_add_dy_2_desktop=%221%22; msToken=1JDHnVPw_9yTvzIrwb7cQj8dCMNOoesXbA_IooV8cezcOdpe4pzusZE7NB7tZn9TBXPr0ylxmv-KMs5rqbNUBHP4P7VBFUu0ZAht_BEylqrLpzgt3y5ne_38hXDOX8o=; msToken=jV_yeN1IQKUd9PlNtpL7k5vthGKcHo0dEh_QPUQhr8G3cuYv-Jbb4NnIxGDmhVOkZOCSihNpA2kvYtHiTW25XNNX_yrsv5FN8O6zm3qmCIXcEe0LywLn7oBO2gITEeg=; tt_scid=mYfqpfbDjqXrIGJuQ7q-DlQJfUSG51qG.KUdzztuGP83OjuVLXnQHjsz-BRHRJu4e986'
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ try:
+ origin_url_list = None
+ html_str = await async_req(url=url, proxy_addr=proxy_addr, headers=headers)
+ match_json_str = re.search(r'(\{\\"state\\":.*?)]\\n"]\)', html_str)
+ if not match_json_str:
+ match_json_str = re.search(r'(\{\\"common\\":.*?)]\\n"]\)',
+ html_str, re.DOTALL)[0]
+ except Exception:
+ raise ConnectionError("Please check if your network can access the TikTok website normally")
+ json_data = json.loads(json_str)
+ return json_data
+
+
+@trace_error_decorator
+async def get_kuaishou_stream_data(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+ try:
+ html_str = await async_req(url=url, proxy_addr=proxy_addr, headers=headers)
+ except Exception as e:
+ print(f"Failed to fetch data from {url}.{e}")
+ return {"type": 1, "is_live": False}
+
+ try:
+ json_str = re.search('', html_str)[0]
+ json_data = json.loads(json_str)
+ rid = json_data['pageProps']['room']['roomInfo']['roomInfo']['rid']
+
+ headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0'
+ url2 = f'https://www.douyu.com/betard/{rid}'
+ json_str = await async_req(url=url2, proxy_addr=proxy_addr, headers=headers)
+ json_data = json.loads(json_str)
+ result = {
+ "anchor_name": json_data['room']['nickname'],
+ "is_live": False
+ }
+ if json_data['room']['videoLoop'] == 0 and json_data['room']['show_status'] == 1:
+ result["title"] = json_data['room']['room_name'].replace(' ', '')
+ result["is_live"] = True
+ result["room_id"] = json_data['room']['room_id']
+ return result
+
+
+@trace_error_decorator
+async def get_douyu_stream_data(rid: str, rate: str = '-1', proxy_addr: OptionalStr = None,
+ cookies: OptionalStr = None) -> dict:
+ did = '10000000000000000000000000003306'
+ params_list = await get_token_js(rid, did, proxy_addr=proxy_addr)
+ headers = {
+ 'User-Agent': 'ios/7.830 (ios 17.0; ; iPhone 15 (A2846/A3089/A3090/A3092))',
+ 'Referer': 'https://m.douyu.com/3125893?rid=3125893&dyshid=0-96003918aa5365bc6dcb4933000316p1&dyshci=181',
+ 'Cookie': 'dy_did=413b835d2ae00270f0c69f6400031601; acf_did=413b835d2ae00270f0c69f6400031601; Hm_lvt_e99aee90ec1b2106afe7ec3b199020a7=1692068308,1694003758; m_did=96003918aa5365bc6dcb4933000316p1; dy_teen_mode=%7B%22uid%22%3A%22472647365%22%2C%22status%22%3A0%2C%22birthday%22%3A%22%22%2C%22password%22%3A%22%22%7D; PHPSESSID=td59qi2fu2gepngb8mlehbeme3; acf_auth=94fc9s%2FeNj%2BKlpU%2Br8tZC3Jo9sZ0wz9ClcHQ1akL2Nhb6ZyCmfjVWSlR3LFFPuePWHRAMo0dt9vPSCoezkFPOeNy4mYcdVOM1a8CbW0ZAee4ipyNB%2Bflr58; dy_auth=bec5yzM8bUFYe%2FnVAjmUAljyrsX%2FcwRW%2FyMHaoArYb5qi8FS9tWR%2B96iCzSnmAryLOjB3Qbeu%2BBD42clnI7CR9vNAo9mva5HyyL41HGsbksx1tEYFOEwxSI; wan_auth37wan=5fd69ed5b27fGM%2FGoswWwDo%2BL%2FRMtnEa4Ix9a%2FsH26qF0sR4iddKMqfnPIhgfHZUqkAk%2FA1d8TX%2B6F7SNp7l6buIxAVf3t9YxmSso8bvHY0%2Fa6RUiv8; acf_uid=472647365; acf_username=472647365; acf_nickname=%E7%94%A8%E6%88%B776576662; acf_own_room=0; acf_groupid=1; acf_phonestatus=1; acf_avatar=https%3A%2F%2Fapic.douyucdn.cn%2Fupload%2Favatar%2Fdefault%2F24_; acf_ct=0; acf_ltkid=25305099; acf_biz=1; acf_stk=90754f8ed18f0c24; Hm_lpvt_e99aee90ec1b2106afe7ec3b199020a7=1694003778'
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ data = {
+ 'v': params_list[0],
+ 'did': params_list[1],
+ 'tt': params_list[2],
+ 'sign': params_list[3], # 10分钟有效期
+ 'ver': '22011191',
+ 'rid': rid,
+ 'rate': rate, # 0蓝光、3超清、2高清、-1默认
+ }
+
+ # app_api = 'https://m.douyu.com/hgapi/livenc/room/getStreamUrl'
+ app_api = f'https://www.douyu.com/lapi/live/getH5Play/{rid}'
+ json_str = await async_req(url=app_api, proxy_addr=proxy_addr, headers=headers, data=data)
+ json_data = json.loads(json_str)
+ return json_data
+
+
+@trace_error_decorator
+async def get_yy_stream_data(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'Referer': 'https://www.yy.com/',
+ 'Cookie': 'hd_newui=0.2103068903976506; hdjs_session_id=0.4929014850884579; hdjs_session_time=1694004002636; hiido_ui=0.923076230899782'
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ html_str = await async_req(url=url, proxy_addr=proxy_addr, headers=headers)
+ anchor_name = re.search('nick: "(.*?)",\n\\s+logo', html_str).group(1)
+ cid = re.search('sid : "(.*?)",\n\\s+ssid', html_str, re.DOTALL).group(1)
+
+ data = '{"head":{"seq":1701869217590,"appidstr":"0","bidstr":"121","cidstr":"' + cid + '","sidstr":"' + cid + '","uid64":0,"client_type":108,"client_ver":"5.17.0","stream_sys_ver":1,"app":"yylive_web","playersdk_ver":"5.17.0","thundersdk_ver":"0","streamsdk_ver":"5.17.0"},"client_attribute":{"client":"web","model":"web0","cpu":"","graphics_card":"","os":"chrome","osversion":"0","vsdk_version":"","app_identify":"","app_version":"","business":"","width":"1920","height":"1080","scale":"","client_type":8,"h265":0},"avp_parameter":{"version":1,"client_type":8,"service_type":0,"imsi":0,"send_time":1701869217,"line_seq":-1,"gear":4,"ssl":1,"stream_format":0}}'
+ data_bytes = data.encode('utf-8')
+ params = {
+ "uid": "0",
+ "cid": cid,
+ "sid": cid,
+ "appid": "0",
+ "sequence": "1701869217590",
+ "encode": "json"
+ }
+ url2 = f'https://stream-manager.yy.com/v3/channel/streams?{urllib.parse.urlencode(params)}'
+ json_str = await async_req(url=url2, data=data_bytes, proxy_addr=proxy_addr, headers=headers)
+ json_data = json.loads(json_str)
+ json_data['anchor_name'] = anchor_name
+
+ params = {
+ 'uid': '',
+ 'sid': cid,
+ 'ssid': cid,
+ '_': int(time.time() * 1000),
+ }
+ detail_api = f'https://www.yy.com/live/detail?{urllib.parse.urlencode(params)}'
+ json_str2 = await async_req(detail_api, proxy_addr=proxy_addr, headers=headers)
+ json_data2 = json.loads(json_str2)
+ json_data['title'] = json_data2['data']['roomName']
+ return json_data
+
+
+@trace_error_decorator
+async def get_bilibili_room_info_h5(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> str:
+ headers = {
+ 'user-agent': 'Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973U) AppleWebKit/537.36 (KHTML, like Gecko) '
+ 'SamsungBrowser/14.2 Chrome/87.0.4280.141 Mobile Safari/537.36',
+ 'accept-language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'cookie': '',
+ 'origin': 'https://live.bilibili.com',
+ 'referer': 'https://live.bilibili.com/26066074',
+ }
+ if cookies:
+ headers['cookie'] = cookies
+
+ room_id = url.split('?')[0].rsplit('/', maxsplit=1)[1]
+ api = f'https://api.live.bilibili.com/xlive/web-room/v1/index/getH5InfoByRoom?room_id={room_id}'
+ json_str = await async_req(api, proxy_addr=proxy_addr, headers=headers)
+ room_info = json.loads(json_str)
+ title = room_info['data']['room_info'].get('title') if room_info.get('data') else ''
+ return title
+
+
+@trace_error_decorator
+async def get_bilibili_room_info(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0',
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ try:
+ room_id = url.split('?')[0].rsplit('/', maxsplit=1)[1]
+ json_str = await async_req(f'https://api.live.bilibili.com/room/v1/Room/room_init?id={room_id}',
+ proxy_addr=proxy_addr, headers=headers)
+ room_info = json.loads(json_str)
+ uid = room_info['data']['uid']
+ live_status = True if room_info['data']['live_status'] == 1 else False
+
+ api = f'https://api.live.bilibili.com/live_user/v1/Master/info?uid={uid}'
+ json_str2 = await async_req(url=api, proxy_addr=proxy_addr, headers=headers)
+ anchor_info = json.loads(json_str2)
+ anchor_name = anchor_info['data']['info']['uname']
+
+ title = await get_bilibili_room_info_h5(url, proxy_addr, cookies)
+ return {"anchor_name": anchor_name, "live_status": live_status, "room_url": url, "title": title}
+ except Exception as e:
+ print(e)
+ return {"anchor_name": '', "live_status": False, "room_url": url}
+
+
+@trace_error_decorator
+async def get_bilibili_stream_data(url: str, qn: str = '10000', platform: str = 'web', proxy_addr: OptionalStr = None,
+ cookies: OptionalStr = None) -> OptionalStr:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'origin': 'https://live.bilibili.com',
+ 'referer': 'https://live.bilibili.com/26066074',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ room_id = url.split('?')[0].rsplit('/', maxsplit=1)[1]
+ params = {
+ 'cid': room_id,
+ 'qn': qn,
+ 'platform': platform,
+ }
+ play_api = f'https://api.live.bilibili.com/room/v1/Room/playUrl?{urllib.parse.urlencode(params)}'
+ json_str = await async_req(play_api, proxy_addr=proxy_addr, headers=headers)
+ json_data = json.loads(json_str)
+ if json_data and json_data['code'] == 0:
+ for i in json_data['data']['durl']:
+ if 'd1--cn-gotcha' in i['url']:
+ return i['url']
+ return json_data['data']['durl'][-1]['url']
+ else:
+ params = {
+ "room_id": room_id,
+ "protocol": "0,1",
+ "format": "0,1,2",
+ "codec": "0,1,2",
+ "qn": qn,
+ "platform": "web",
+ "ptype": "8",
+ "dolby": "5",
+ "panorama": "1",
+ "hdr_type": "0,1"
+ }
+
+ # 此接口因网页上有限制, 需要配置登录后的cookie才能获取最高画质
+ api = f'https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo?{urllib.parse.urlencode(params)}'
+ json_str = await async_req(api, proxy_addr=proxy_addr, headers=headers)
+ json_data = json.loads(json_str)
+ if json_data['data']['live_status'] == 0:
+ print("The anchor did not start broadcasting.")
+ return
+ playurl_info = json_data['data']['playurl_info']
+ format_list = playurl_info['playurl']['stream'][0]['format']
+ stream_data_list = format_list[0]['codec']
+ sorted_stream_list = sorted(stream_data_list, key=itemgetter("current_qn"), reverse=True)
+ # qn: 30000=杜比 20000=4K 10000=原画 400=蓝光 250=超清 150=高清 80=流畅
+ video_quality_options = {'10000': 0, '400': 1, '250': 2, '150': 3, '80': 4}
+ qn_count = len(sorted_stream_list)
+ select_stream_index = min(video_quality_options[qn], qn_count - 1)
+ stream_data: dict = sorted_stream_list[select_stream_index]
+ base_url = stream_data['base_url']
+ host = stream_data['url_info'][0]['host']
+ extra = stream_data['url_info'][0]['extra']
+ m3u8_url = host + base_url + extra
+ return m3u8_url
+
+@trace_error_decorator
+async def get_xhs_stream_url(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'ios/7.830 (ios 17.0; ; iPhone 15 (A2846/A3089/A3090/A3092))',
+ 'xy-common-params': 'platform=iOS&sid=session.1722166379345546829388',
+ 'referer': 'https://app.xhs.cn/',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ if "xhslink.com" in url:
+ url = await async_req(url, proxy_addr=proxy_addr, headers=headers, redirect_url=True)
+
+ host_id = get_params(url, "host_id")
+ user_id = re.search("/user/profile/(.*?)(?=/|\\?|$)", url)
+ user_id = user_id.group(1) if user_id else host_id
+ result = {"anchor_name": '', "is_live": False}
+ html_str = await async_req(url, proxy_addr=proxy_addr, headers=headers)
+ match_data = re.search("", html_str)
+
+ if match_data:
+ json_str = match_data.group(1).replace("undefined", "null")
+ json_data = json.loads(json_str)
+
+ if json_data.get("liveStream"):
+ stream_data = json_data["liveStream"]
+ if stream_data.get("liveStatus") == "success":
+ room_info = stream_data["roomData"]["roomInfo"]
+ title = room_info.get("roomTitle")
+ if title and "回放" not in title:
+ live_link = room_info["deeplink"]
+ anchor_name = get_params(live_link, "host_nickname")
+ flv_url = get_params(live_link, "flvUrl")
+ room_id = flv_url.split('live/')[1].split('.')[0]
+ flv_url = f"http://live-source-play.xhscdn.com/live/{room_id}.flv"
+ m3u8_url = flv_url.replace('.flv', '.m3u8')
+ result |= {
+ "anchor_name": anchor_name,
+ "is_live": True,
+ "title": title,
+ "flv_url": flv_url,
+ "m3u8_url": m3u8_url,
+ 'record_url': flv_url
+ }
+ return result
+
+ profile_url = f"https://www.xiaohongshu.com/user/profile/{user_id}"
+ html_str = await async_req(profile_url, proxy_addr=proxy_addr, headers=headers)
+ anchor_name = re.search("
@(.*?) 的个人主页", html_str)
+ if anchor_name:
+ result["anchor_name"] = anchor_name.group(1)
+
+ return result
+
+
+@trace_error_decorator
+async def get_bigo_stream_url(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
+ 'Referer': 'https://www.bigo.tv/',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ if 'bigo.tv' not in url:
+ html_str = await async_req(url, proxy_addr=proxy_addr, headers=headers)
+ web_url = re.search(
+ '',
+ html_str).group(1)
+ room_id = web_url.split('&h=')[-1]
+ else:
+ if '&h=' in url:
+ room_id = url.split('&h=')[-1]
+ else:
+ room_id = url.split("?")[0].rsplit("/", maxsplit=1)[-1]
+
+ data = {'siteId': room_id} # roomId
+ url2 = 'https://ta.bigo.tv/official_website/studio/getInternalStudioInfo'
+ json_str = await async_req(url=url2, proxy_addr=proxy_addr, headers=headers, data=data)
+ json_data = json.loads(json_str)
+ anchor_name = json_data['data']['nick_name']
+ live_status = json_data['data']['alive']
+ result = {"anchor_name": anchor_name, "is_live": False}
+
+ if live_status == 1:
+ live_title = json_data['data']['roomTopic']
+ m3u8_url = json_data['data']['hls_src']
+ result['m3u8_url'] = m3u8_url
+ result['record_url'] = m3u8_url
+ result |= {"title": live_title, "is_live": True, "m3u8_url": m3u8_url, 'record_url': m3u8_url}
+ elif result['anchor_name'] == '':
+ html_str = await async_req(url=f'https://www.bigo.tv/{url.split("/")[3]}/{room_id}',
+ proxy_addr=proxy_addr, headers=headers)
+ match_anchor_name = re.search('欢迎来到(.*?)的直播间', html_str, re.DOTALL)
+ if match_anchor_name:
+ anchor_name = match_anchor_name.group(1)
+ else:
+ match_anchor_name = re.search('', html_str, re.DOTALL)
+ anchor_name = match_anchor_name.group(1)
+ result['anchor_name'] = anchor_name
+
+ return result
+
+
+@trace_error_decorator
+async def get_blued_stream_url(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'ios/7.830 (ios 17.0; ; iPhone 15 (A2846/A3089/A3090/A3092))',
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ html_str = await async_req(url=url, proxy_addr=proxy_addr, headers=headers)
+ json_str = re.search('decodeURIComponent\\(\"(.*?)\"\\)\\),window\\.Promise', html_str, re.DOTALL).group(1)
+ json_str = urllib.parse.unquote(json_str)
+ json_data = json.loads(json_str)
+ anchor_name = json_data['userInfo']['name']
+ live_status = json_data['userInfo']['onLive']
+ result = {"anchor_name": anchor_name, "is_live": False}
+
+ if live_status:
+ m3u8_url = json_data['liveInfo']['liveUrl']
+ result |= {"is_live": True, "m3u8_url": m3u8_url, 'record_url': m3u8_url}
+ return result
+
+
+@trace_error_decorator
+async def login_sooplive(username: str, password: str, proxy_addr: OptionalStr = None) -> OptionalStr:
+ if len(username) < 6 or len(password) < 10:
+ raise RuntimeError("sooplive login failed! Please enter the correct account and password for the sooplive "
+ "platform in the config.ini file.")
+
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0',
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
+ 'Origin': 'https://play.sooplive.co.kr',
+ 'Referer': 'https://play.sooplive.co.kr/superbsw123/277837074',
+ }
+
+ data = {
+ 'szWork': 'login',
+ 'szType': 'json',
+ 'szUid': username,
+ 'szPassword': password,
+ 'isSaveId': 'true',
+ 'isSavePw': 'true',
+ 'isSaveJoin': 'true',
+ 'isLoginRetain': 'Y',
+ }
+
+ url = 'https://login.sooplive.co.kr/app/LoginAction.php'
+
+ try:
+ cookie_dict = await async_req(url, proxy_addr=proxy_addr, headers=headers,
+ data=data, return_cookies=True, timeout=20)
+ cookie_str = '; '.join([f"{k}={v}" for k, v in cookie_dict.items()])
+ return cookie_str
+ except Exception as e:
+ print(f"An error occurred during login: {e}")
+ raise Exception(
+ "sooplive login failed, please check if the account password in the configuration file is correct."
+ )
+
+
+@trace_error_decorator
+async def get_sooplive_cdn_url(broad_no: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'Origin': 'https://play.sooplive.co.kr',
+ 'Referer': 'https://play.sooplive.co.kr/oul282/249469582',
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ params = {
+ 'return_type': 'gcp_cdn',
+ 'use_cors': 'false',
+ 'cors_origin_url': 'play.sooplive.co.kr',
+ 'broad_key': f'{broad_no}-common-master-hls',
+ 'time': '8361.086329376785',
+ }
+
+ url2 = 'http://livestream-manager.sooplive.co.kr/broad_stream_assign.html?' + urllib.parse.urlencode(params)
+ json_str = await async_req(url=url2, proxy_addr=proxy_addr, headers=headers, abroad=True)
+ json_data = json.loads(json_str)
+
+ return json_data
+
+
+@trace_error_decorator
+async def get_sooplive_tk(url: str, rtype: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> str | tuple:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0',
+ 'Origin': 'https://play.sooplive.co.kr',
+ 'Referer': 'https://play.sooplive.co.kr/secretx/250989857',
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ }
+
+ if cookies:
+ headers['Cookie'] = cookies
+
+ split_url = url.split('/')
+ bj_id = split_url[3] if len(split_url) < 6 else split_url[5]
+ room_password = get_params(url, "pwd")
+ if not room_password:
+ room_password = ''
+ data = {
+ 'bid': bj_id,
+ 'bno': '',
+ 'type': rtype,
+ 'pwd': room_password,
+ 'player_type': 'html5',
+ 'stream_type': 'common',
+ 'quality': 'master',
+ 'mode': 'landing',
+ 'from_api': '0',
+ 'is_revive': 'false',
+ }
+
+ url2 = f'https://live.sooplive.co.kr/afreeca/player_live_api.php?bjid={bj_id}'
+ json_str = await async_req(url=url2, proxy_addr=proxy_addr, headers=headers, data=data, abroad=True)
+ json_data = json.loads(json_str)
+
+ if rtype == 'aid':
+ token = json_data["CHANNEL"]["AID"]
+ return token
+ else:
+ bj_name = json_data['CHANNEL']['BJNICK']
+ bj_id = json_data['CHANNEL']['BJID']
+ return f"{bj_name}-{bj_id}", json_data['CHANNEL']['BNO']
+
+
+@trace_error_decorator
+async def get_sooplive_stream_data(
+ url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None,
+ username: OptionalStr = None, password: OptionalStr = None
+) -> dict:
+ headers = {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0',
+ 'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
+ 'Referer': 'https://m.sooplive.co.kr/',
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+
+ split_url = url.split('/')
+ bj_id = split_url[3] if len(split_url) < 6 else split_url[5]
+
+ data = {
+ 'bj_id': bj_id,
+ 'broad_no': '',
+ 'agent': 'web',
+ 'confirm_adult': 'true',
+ 'player_type': 'webm',
+ 'mode': 'live',
+ }
+
+ url2 = 'http://api.m.sooplive.co.kr/broad/a/watch'
+
+ json_str = await async_req(url=url2, proxy_addr=proxy_addr, headers=headers, data=data, abroad=True)
+ json_data = json.loads(json_str)
+
+ if 'user_nick' in json_data['data']:
+ anchor_name = json_data['data']['user_nick']
+ if "bj_id" in json_data['data']:
+ anchor_name = f"{anchor_name}-{json_data['data']['bj_id']}"
+ else:
+ anchor_name = ''
+
+ result = {"anchor_name": anchor_name or '' ,"is_live": False}
+
+ async def get_url_list(m3u8: str) -> List[str]:
+ resp = await async_req(url=m3u8, proxy_addr=proxy_addr, headers=headers, abroad=True)
+ play_url_list = []
+ url_prefix = m3u8.rsplit('/', maxsplit=1)[0] + '/'
+ for i in resp.split('\n'):
+ if i.startswith('auth_playlist'):
+ play_url_list.append(url_prefix + i.strip())
+ bandwidth_pattern = re.compile(r'BANDWIDTH=(\d+)')
+ bandwidth_list = bandwidth_pattern.findall(resp)
+ url_to_bandwidth = {purl: int(bandwidth) for bandwidth, purl in zip(bandwidth_list, play_url_list)}
+ play_url_list = sorted(play_url_list, key=lambda purl: url_to_bandwidth[purl], reverse=True)
+ return play_url_list
+
+ if not anchor_name:
+ async def handle_login() -> OptionalStr:
+ cookie = await login_sooplive(username, password, proxy_addr=proxy_addr)
+ if 'AuthTicket=' in cookie:
+ print("sooplive platform login successful! Starting to fetch live streaming data...")
+ return cookie
+
+ async def fetch_data(cookie, _result) -> dict:
+ aid_token = await get_sooplive_tk(url, rtype='aid', proxy_addr=proxy_addr, cookies=cookie)
+ _anchor_name, _broad_no = await get_sooplive_tk(url, rtype='info', proxy_addr=proxy_addr, cookies=cookie)
+ _view_url_data = await get_sooplive_cdn_url(_broad_no, proxy_addr=proxy_addr)
+ _view_url = _view_url_data['view_url']
+ _m3u8_url = _view_url + '?aid=' + aid_token
+ _result |= {
+ "anchor_name": _anchor_name,
+ "is_live": True,
+ "m3u8_url": _m3u8_url,
+ 'play_url_list': await get_url_list(_m3u8_url),
+ 'new_cookies': cookie
+ }
+ return _result
+
+ if json_data['data']['code'] == -3001:
+ print("sooplive live stream failed to retrieve, the live stream just ended.")
+ return result
+
+ elif json_data['data']['code'] == -3002:
+ print("sooplive live stream retrieval failed, the live needs 19+, you are not logged in.")
+ print("Attempting to log in to the sooplive live streaming platform with your account and password, "
+ "please ensure it is configured.")
+ new_cookie = await handle_login()
+ if new_cookie and len(new_cookie) > 0:
+ return await fetch_data(new_cookie, result)
+ raise RuntimeError("sooplive login failed, please check if the account and password are correct")
+
+ elif json_data['data']['code'] == -3004:
+ if cookies and len(cookies) > 0:
+ return await fetch_data(cookies, result)
+ else:
+ raise RuntimeError("sooplive login failed, please check if the account and password are correct")
+ elif json_data['data']['code'] == -6001:
+ print("error message:Please check if the input sooplive live room address "
+ "is correct.")
+ return result
+ if json_data['result'] == 1 and anchor_name:
+ broad_no = json_data['data']['broad_no']
+ hls_authentication_key = json_data['data']['hls_authentication_key']
+ view_url_data = await get_sooplive_cdn_url(broad_no, proxy_addr=proxy_addr)
+ view_url = view_url_data['view_url']
+ m3u8_url = view_url + '?aid=' + hls_authentication_key
+ result |= {'is_live': True, 'm3u8_url': m3u8_url, 'play_url_list': await get_url_list(m3u8_url)}
+ result['new_cookies'] = None
+ return result
+
+
+@trace_error_decorator
+async def get_netease_stream_data(url: str, proxy_addr: OptionalStr = None, cookies: OptionalStr = None) -> dict:
+ headers = {
+ 'accept': 'application/json, text/plain, */*',
+ 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
+ 'referer': 'https://cc.163.com/',
+ 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0',
+ }
+ if cookies:
+ headers['Cookie'] = cookies
+ url = url + '/' if url[-1] != '/' else url
+
+ html_str = await async_req(url=url, proxy_addr=proxy_addr, headers=headers)
+ json_str = re.search('