├── sinp ├── iqiyiCmd5x.sinp.txt ├── wasuAes.sinp.txt ├── youkuUtid.sinp.txt ├── wasuStreamCode.sinp.txt ├── pptvH5crypto.sinp.txt └── qqKe.sinp.txt ├── README.md └── js ├── hmacSha1.js └── pack.js /sinp/iqiyiCmd5x.sinp.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * from: http://static.iqiyi.com/js/common/7d183edd03bc4414b315e8964fb41826.js 3 | * parse: vf 4 | * des: cmd5x算法,适用于pc端dash/html5端tmts 5 | * salt: h2l6suw1************************ 6 | */ 7 | 8 | js = curl('http://static.iqiyi.com/js/common/7d183edd03bc4414b315e8964fb41826.js') 9 | ctx = execjs.compile(js) 10 | vf = ctx.call('cmd5x', tmts) -------------------------------------------------------------------------------- /sinp/wasuAes.sinp.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * form: https://s.wasu.cn/portal/mobile/js/video.js?t=2018053000001 3 | * parse: https://apiontime.wasu.cn/Auth/getVideoUrl?id=8121053&mode=2&key=' +key + '&url=' + url + '&type=jsonp 4 | * des:wasu手机端aes加密 5 | */ 6 | 7 | this.loadVU = function(_0xE628) { 8 | if (_0xE628.indexOf(".m" + "p4") > -1 || _0xE628.indexOf(".m3" + "u8") > -1) { 9 | return _0xE628 10 | }; 11 | var _0xE5B6 = "0" + "1424364" + "0" + "586" + "0" + "819"; 12 | var _0xE50B = "5162271485" + "0" + "9" + "0" + "109"; 13 | var _0xE5EF = "14" + "0" + "24364586" + "00" + "819"; 14 | var _0xE544 = "51622714859" + "00" + "109"; 15 | try { 16 | var _0xE57D = CryptoJS.enc.Utf8.parse(_0xE5B6); 17 | var _0xE4D2 = CryptoJS.enc.Utf8.parse(_0xE50B); 18 | var _0xE499 = CryptoJS.AES.decrypt(_0xE628, _0xE57D, { 19 | iv: _0xE4D2, 20 | mode: CryptoJS.mode.CBC, 21 | padding: CryptoJS.pad.ZeroPadding 22 | }); 23 | var _0xE661 = CryptoJS.enc.Utf8.stringify(_0xE499).toString() 24 | } catch (e) { 25 | try { 26 | var _0xE57D = CryptoJS.enc.Utf8.parse(_0xE5EF); 27 | var _0xE4D2 = CryptoJS.enc.Utf8.parse(_0xE544); 28 | var _0xE499 = CryptoJS.AES.decrypt(_0xE628, _0xE57D, { 29 | iv: _0xE4D2, 30 | mode: CryptoJS.mode.CBC, 31 | padding: CryptoJS.pad.ZeroPadding 32 | }); 33 | var _0xE661 = CryptoJS.enc.Utf8.stringify(_0xE499).toString() 34 | } catch (e) { 35 | return _0xE628 36 | } 37 | }; 38 | return _0xE661 39 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # VideoParse 4 | ##尊重版权,将少回复QQ/YOUKU相关ISSUES 5 | ![](https://upfile.asqql.com/2009pasdfasdfic2009s305985-ts/2016-7/20167112512365720.jpg) 6 | ## 优酷/youku 7 | 优酷的 ccode 经常变动,会导致解析器不可用,其一般限制useragent/referer/ckey/utid/cookies 8 | 9 | 当前的解析器,大多以更换ccode为主,大体可以分为: 10 | * App 11 | 1. youku/tudou/cibn/合作方app,ccode大多为01010101多位数字字符串 12 | 2. 此类ccode可以解析全长视频 13 | 3. 依赖utid参数,由app算法生成,全平台app共用此utid 14 | 4. 依赖useragent 15 | 5. 默认ckey: `7B19C0AB12633B22E7FE81271162026020570708D6CC189E4924503C49D243A0DE6CD84A766832C2C99898FC5ED31F3709BB3CDD82C96492E721BDD381735026` 16 | * 网页 17 | 1. ccode经常变动/限制 18 | 2. 全长:0502/0511/0512/0515/0519... 预览:0505/0503/0516/0517/0590.. 19 | 3. 部分视频使用预览ccode不能解析全长视频,具体由json.data.show.copyright字段控制 20 | 4. 目前有效的解决方法为带cookies访问,或者带ckey(110#/112#/113#)访问 21 | 5. 同个ckey(115#)有解析时效限制 22 | 6. ckey(115#)获取,一般可以使用phantomjs/webdriver,或者nodejs跑js获取 23 | 7. ckey相关js: `https://aeu.alicdn.com/js/cj/115.js` 24 | 8. 各版本ckey所能解析的ccode有点差异 25 | 9. 页面通过script标签引入js,因相关参数缺失以及代码限制,生成的ckey不一定可用 26 | 10. 默认ckey: `DIl58SLFxFNndSV1GFNnMQVYkx1PP5tKe1siZu%2F86PR1u%2FWh1Ptd%2BWOZsHHWxysSfAOhNJpdVWsdVJNsfJ8Sxd8WKVvNfAS8aS8fAOzYARzPyPc3JvtnPHjTdKfESTdnuTW6ZPvk2pNDh4uFzotgdMEFkzQ5wZVXl2Pf1%2FY6hLK0OnCNxBj3%2Bnb0v72gZ6b0td%2BWOZsHHWxysSo%2F0y9D2K42SaB8Y%2F%2BaD2K42SaB8Y%2F%2BahU%2BWOZsHcrxysooUeND` 27 | 28 | 现状 29 | * ups/acs频率限制,解析太多会出现账户异常 30 | * 加cookies能解决部分问题,但一次解析太多还是会被限制 31 | * js_ckey算法也受限制,不用那么麻烦去算115# 32 | * 普通用户少量解析不受影响,第三方api基本要采用ip代理池 33 | * 非独播/动漫/资讯/片段等, ups算法 ccode=0512 default_ckey 34 | * 独播/电影等等, acs/app算法 ccode=0502/010301010X js_ckey/app_ckey 35 | * 见过ctype=30,旧app算法应该可用 36 | 37 | ## 爱奇艺/iqiyi 38 | * dash与tmts算法一致,依赖cmd5x算法 39 | * cmd5x: `http://static.iqiyi.com/js/common/7d183edd03bc4414b315e8964fb41826.js` 40 | * encrypt: `md5(tmts + salt)` 41 | * salt: `h2l6suw1************************` 42 | 43 | ## 搜狐/sohu 44 | uid要经过上报流程,链接才不会卡顿 45 | 46 | `r.pingback("//z.m.tv.sohu.com/h5_cc.gif?" + d.stringify(f))` 47 | ## 腾讯/qq 48 | url要经过上报流程,链接才不会卡顿 49 | 50 | 51 | -------------------------------------------------------------------------------- /sinp/youkuUtid.sinp.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * from: apk 3 | * parse: utid 4 | * des: app端utid算法 5 | */ 6 | 7 | private static String _calcHmac(byte[] paramArrayOfByte) 8 | throws Exception 9 | { 10 | Mac localMac = Mac.getInstance("HmacSHA1"); 11 | localMac.init(new SecretKeySpec("d6fc3a4a06adbde89223bvefedc24fecde188aaa9161".getBytes(), localMac.getAlgorithm())); 12 | return Base64.encodeToString(localMac.doFinal(paramArrayOfByte), 2); 13 | } 14 | 15 | private final byte[] _generateUtdid() 16 | throws Exception 17 | { 18 | ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream(); 19 | int i = (int)(System.currentTimeMillis() / 1000L); 20 | int j = new Random().nextInt(); 21 | Object localObject = IntUtils.getBytes(i); 22 | byte[] arrayOfByte = IntUtils.getBytes(j); 23 | localByteArrayOutputStream.write((byte[])localObject, 0, 4); 24 | localByteArrayOutputStream.write(arrayOfByte, 0, 4); 25 | localByteArrayOutputStream.write(3); 26 | localByteArrayOutputStream.write(0); 27 | try 28 | { 29 | localObject = PhoneInfoUtils.getImei(this.mContext); 30 | localByteArrayOutputStream.write(IntUtils.getBytes(StringUtils.hashCode((String)localObject)), 0, 4); 31 | localByteArrayOutputStream.write(IntUtils.getBytes(StringUtils.hashCode(_calcHmac(localByteArrayOutputStream.toByteArray())))); 32 | return localByteArrayOutputStream.toByteArray(); 33 | } 34 | catch (Exception localException) 35 | { 36 | for (;;) 37 | { 38 | String str = "" + new Random().nextInt(); 39 | } 40 | } 41 | } 42 | 43 | 44 | package com.ta.utdid2.android.utils; 45 | 46 | public class IntUtils 47 | { 48 | public static byte[] getBytes(int paramInt) 49 | { 50 | int i = (byte)(paramInt % 256); 51 | paramInt >>= 8; 52 | int j = (byte)(paramInt % 256); 53 | paramInt >>= 8; 54 | int k = (byte)(paramInt % 256); 55 | return new byte[] { (byte)((paramInt >> 8) % 256), k, j, i }; 56 | } 57 | 58 | public static byte[] getBytes(byte[] paramArrayOfByte, int paramInt) 59 | { 60 | if (paramArrayOfByte.length == 4) 61 | { 62 | paramArrayOfByte[3] = ((byte)(paramInt % 256)); 63 | paramInt >>= 8; 64 | paramArrayOfByte[2] = ((byte)(paramInt % 256)); 65 | paramInt >>= 8; 66 | paramArrayOfByte[1] = ((byte)(paramInt % 256)); 67 | paramArrayOfByte[0] = ((byte)((paramInt >> 8) % 256)); 68 | } 69 | for (;;) 70 | { 71 | return paramArrayOfByte; 72 | paramArrayOfByte = null; 73 | } 74 | } 75 | } 76 | 77 | public static int hashCode(String paramString) 78 | { 79 | int k = 0; 80 | int i = 0; 81 | int j = k; 82 | if (0 == 0) 83 | { 84 | j = k; 85 | if (paramString.length() > 0) 86 | { 87 | paramString = paramString.toCharArray(); 88 | for (k = 0;; k++) 89 | { 90 | j = i; 91 | if (k >= paramString.length) { 92 | break; 93 | } 94 | i = i * 31 + paramString[k]; 95 | } 96 | } 97 | } 98 | return j; 99 | } 100 | -------------------------------------------------------------------------------- /js/hmacSha1.js: -------------------------------------------------------------------------------- 1 | /* OAuthSimple 2 | * A simpler version of OAuth 3 | * 4 | * from: https://github.com/pH200/hmacsha1-js/blob/master/index.js 5 | * author: jr conlin 6 | * mail: src@anticipatr.com 7 | * copyright: unitedHeroes.net 8 | * version: 1.0 9 | * url: http://unitedHeroes.net/OAuthSimple 10 | * 11 | * Copyright (c) 2009, unitedHeroes.net 12 | * All rights reserved. 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions are met: 16 | * * Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * * Neither the name of the unitedHeroes.net nor the 22 | * names of its contributors may be used to endorse or promote products 23 | * derived from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY UNITEDHEROES.NET ''AS IS'' AND ANY 26 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | * DISCLAIMED. IN NO EVENT SHALL UNITEDHEROES.NET BE LIABLE FOR ANY 29 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | */ 36 | /** 37 | * Computes a HMAC-SHA1 code. 38 | * 39 | * @param {string} k Secret key. 40 | * @param {string} d Data to be hashed. 41 | * @return {string} The hashed string. 42 | */ 43 | function b64_hmac_sha1(k,d,_p,_z){ 44 | // heavily optimized and compressed version of http://pajhome.org.uk/crypt/md5/sha1.js 45 | // _p = b64pad, _z = character size; not used here but I left them available just in case 46 | if(!_p){_p='=';}if(!_z){_z=8;}function _f(t,b,c,d){if(t<20){return(b&c)|((~b)&d);}if(t<40){return b^c^d;}if(t<60){return(b&c)|(b&d)|(c&d);}return b^c^d;}function _k(t){return(t<20)?1518500249:(t<40)?1859775393:(t<60)?-1894007588:-899497514;}function _s(x,y){var l=(x&0xFFFF)+(y&0xFFFF),m=(x>>16)+(y>>16)+(l>>16);return(m<<16)|(l&0xFFFF);}function _r(n,c){return(n<>>(32-c));}function _c(x,l){x[l>>5]|=0x80<<(24-l%32);x[((l+64>>9)<<4)+15]=l;var w=[80],a=1732584193,b=-271733879,c=-1732584194,d=271733878,e=-1009589776;for(var i=0;i>5]|=(s.charCodeAt(i/8)&m)<<(32-_z-i%32);}return b;}function _h(k,d){var b=_b(k);if(b.length>16){b=_c(b,k.length*_z);}var p=[16],o=[16];for(var i=0;i<16;i++){p[i]=b[i]^0x36363636;o[i]=b[i]^0x5C5C5C5C;}var h=_c(p.concat(_b(d)),512+d.length*_z);return _c(o.concat(h),512+160);}function _n(b){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s='';for(var i=0;i>2]>>8*(3-i%4))&0xFF)<<16)|(((b[i+1>>2]>>8*(3-(i+1)%4))&0xFF)<<8)|((b[i+2>>2]>>8*(3-(i+2)%4))&0xFF);for(var j=0;j<4;j++){if(i*8+j*6>b.length*32){s+=_p;}else{s+=t.charAt((r>>6*(3-j))&0x3F);}}}return s;}function _x(k,d){return _n(_h(k,d));}return _x(k,d); 47 | } 48 | module.exports = b64_hmac_sha1; -------------------------------------------------------------------------------- /sinp/wasuStreamCode.sinp.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * form: https://s.wasu.cn/portal/player/20180801/WsPlayer.swf 3 | * parse: streamAuth 4 | * des:wasu播放器streamAuth streamCode算法 5 | */ 6 | package longyu.widgets.utils 7 | { 8 | import com.adobe.crypto.MD5; 9 | import flash.utils.ByteArray; 10 | 11 | public class StreamUtils 12 | { 13 | 14 | 15 | public function StreamUtils() 16 | { 17 | super(); 18 | } 19 | 20 | public static function streamCode(param1:String, param2:String) : * 21 | { 22 | var _loc3_:String = "wasu!@#48217#$@#1"; 23 | if(param1.indexOf(".mp4") > 0) 24 | { 25 | return param1; 26 | } 27 | return streamAuth(param1,_loc3_,param2,86400); 28 | } 29 | 30 | public static function streamAuth(param1:String, param2:String, param3:String, param4:int) : * 31 | { 32 | var _loc16_:int = 0; 33 | var _loc17_:int = 0; 34 | var _loc18_:int = 0; 35 | var _loc19_:int = 0; 36 | var _loc21_:String = null; 37 | var _loc22_:String = null; 38 | var _loc23_:String = null; 39 | var _loc24_:String = null; 40 | var _loc25_:String = null; 41 | var _loc5_:int = 4; 42 | param2 = getMD5(param2 != ""?param2:"12345678"); 43 | var _loc6_:String = param2; 44 | var _loc7_:String = getMD5(param2.substring(0,16)); 45 | var _loc8_:String = getMD5(_loc6_.substring(16,32)); 46 | var _loc9_:String = param1; 47 | var _loc10_:String = _loc5_ > 0?param3 == "DECODE"?_loc9_.substring(0,_loc5_):getMD5(String(new Date().getTime() / 1000)).substring(32 - _loc5_):""; 48 | var _loc11_:String = _loc7_ + getMD5(_loc7_ + _loc10_); 49 | var _loc12_:Number = _loc11_.length; 50 | param1 = param3 == "DECODE"?String(Base64Util.decodeToByteArray(param1.substring(_loc5_))):(param4 > 0?param4 + int(new Date().getTime() / 1000):"0000000000") + "" + getMD5(param1 + _loc8_).substring(0,16) + param1; 51 | var _loc13_:Number = param1.length; 52 | var _loc14_:Array = []; 53 | var _loc15_:Array = []; 54 | _loc16_ = 0; 55 | while(_loc16_ < 128) 56 | { 57 | _loc14_[_loc16_] = _loc16_; 58 | _loc15_[_loc16_] = _loc11_.charCodeAt(_loc16_ % _loc12_) & 255; 59 | _loc16_++; 60 | } 61 | _loc17_ = _loc16_ = 0; 62 | while(_loc16_ < 128) 63 | { 64 | _loc17_ = (_loc17_ + _loc14_[_loc16_] + _loc15_[_loc16_]) % 128; 65 | _loc19_ = _loc14_[_loc16_]; 66 | _loc14_[_loc16_] = _loc14_[_loc17_]; 67 | _loc14_[_loc17_] = _loc19_; 68 | _loc16_++; 69 | } 70 | var _loc20_:ByteArray = new ByteArray(); 71 | _loc18_ = _loc17_ = _loc16_ = 0; 72 | while(_loc16_ < _loc13_) 73 | { 74 | _loc18_ = (_loc18_ + 1) % 128; 75 | _loc17_ = (_loc17_ + _loc14_[_loc18_]) % 128; 76 | _loc19_ = _loc14_[_loc18_]; 77 | _loc14_[_loc18_] = _loc14_[_loc17_]; 78 | _loc14_[_loc17_] = _loc19_; 79 | _loc20_.writeByte(param1.charCodeAt(_loc16_) & 255 ^ _loc14_[(_loc14_[_loc18_] + _loc14_[_loc17_]) % 128]); 80 | _loc16_++; 81 | } 82 | if(param3 == "DECODE") 83 | { 84 | _loc21_ = _loc22_ = _loc23_ = _loc24_ = _loc25_ = String(_loc20_); 85 | if((int(_loc22_.substring(0,10)) == 0 || int(_loc23_.substring(0,10)) - int(new Date().getTime() / 1000) > 0) && _loc24_.substring(10,26) == getMD5(_loc25_.substring(26) + _loc8_).substring(0,16)) 86 | { 87 | return _loc21_.substring(26); 88 | } 89 | return ""; 90 | } 91 | return _loc10_ + Base64Util.encodeByteArray(_loc20_); 92 | } 93 | 94 | private static function getMD5(param1:String) : * 95 | { 96 | return MD5.hash(param1); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /sinp/pptvH5crypto.sinp.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * from: http://static9.pplive.cn/corporate/player/v_20180921114929_06bed7/dist/player-min.js 3 | * parse: k 4 | * des: html5端k算法, AES/ECB/NoPadding 5 | */ 6 | 7 | function(e, t, n) { 8 | "use strict"; 9 | Object.defineProperty(t, "__esModule", { 10 | value: !0 11 | }), t.H5Crypto = void 0; 12 | var i, a = n(207), 13 | o = n(34), 14 | r = (i = n(205)) && i.__esModule ? i : { 15 | default: i 16 | }, 17 | s = r.default.enc.Hex, 18 | l = r.default.lib.WordArray, 19 | u = r.default.SHA256; 20 | t.H5Crypto = { 21 | SC_KEY: "UwlJsRX59+ldn2gWmrUnxxFiVuzGL3V@", 22 | getRandom: function() { 23 | for (var e = "", t = 0; t < 16; t++) { 24 | var n = 93 * Math.random() + 33 >> 0; 25 | e += String.fromCharCode(n) 26 | } 27 | return e 28 | }, 29 | getSignature: function(e, t) { 30 | var n = this.getRandom(), 31 | i = n + e + t, 32 | a = this.toHexStr(i), 33 | o = u(s.parse(a)); 34 | return { 35 | sign: s.stringify(o), 36 | random: this.toHexStr(n) 37 | } 38 | }, 39 | toHexStr: function(e) { 40 | for (var t = "", n = 0; n < e.length; n++) t += e.charCodeAt(n).toString(16); 41 | return t 42 | }, 43 | BytesToStr: function(e) { 44 | for (var t, n = e.length, i = [], a = 0; a < n; a++) t = e[a], i.push(String.fromCharCode(t)); 45 | return i.join("") 46 | }, 47 | secure_key_decrypt: function(e, t, n) { 48 | var i = new o.Stream; 49 | if (t.length / 2 < 49) return this.BytesToStr(i.pool); 50 | var d = s.parse(n), 51 | c = new o.Stream(a.bytes.fromBits(d.words)), 52 | f = new o.Stream; 53 | f.writeUTF(e, !0); 54 | var h = new o.Stream; 55 | if (c.position = 0, d.sigBytes < 16) return this.BytesToStr(i.pool); 56 | f.position = 0, c.readBytes(h, 0, 8), f.readBytes(h, h.length(), f.length()), c.readBytes(h, h.length(), 8); 57 | var p = l.create(a.bytes.toBits(h.pool)), 58 | _ = u(p), 59 | v = new o.Stream(a.bytes.fromBits(_.words)); 60 | v.position = 0; 61 | var m = new o.Stream(a.bytes.fromBits(s.parse(t).words)), 62 | g = m.readByte(), 63 | y = new o.Stream; 64 | m.readBytes(y, 0, m.length() - 1 - 32); 65 | var b = new o.Stream; 66 | m.readBytes(b, 0, 32); 67 | var I = r.default.AES, 68 | E = r.default.lib.CipherParams, 69 | k = l.create(a.bytes.toBits(v.pool)), 70 | C = l.create(a.bytes.toBits(y.pool)), 71 | T = I.decrypt(E.create({ 72 | ciphertext: C 73 | }), k, { 74 | mode: r.default.mode.ECB, 75 | padding: r.default.pad.NoPadding 76 | }), 77 | w = a.bytes.fromBits(T.words); 78 | y.writeBytes(w, 0, w.length), h.clear(), c.position = 8, y.position = 0, c.readBytes(h, 0, 8), y.readBytes(h, h.length(), y.length() - g), c.position = 0, c.readBytes(h, h.length(), 8), h.position = 0, l.create(a.bytes.toBits(h.pool)); 79 | var S = u(p), 80 | O = new o.Stream(a.bytes.fromBits(S.words)); 81 | return this.eqByteArray(O, b) && (y.position = 0, y.readBytes(i, 0, y.length() - g)), this.BytesToStr(i.pool) 82 | }, 83 | eqByteArray: function(e, t) { 84 | if (e.length != t.length) return !1; 85 | var n = e.position, 86 | i = t.position, 87 | a = !0; 88 | for (e.position = t.position = 0; e.length >= 4;) 89 | if (e.readInt() != t.readInt()) { 90 | a = !1; 91 | break 92 | } 93 | if (a && 0 != e.length) { 94 | var o = e.length; 95 | a = 1 == o ? e.readByte() == t.readByte() : 2 == o ? e.readShort() == t.readShort() : 3 != o || e.readShort() == t.readShort() && e.readByte() == t.readByte() 96 | } 97 | return e.position = n, t.position = i, a 98 | } 99 | } 100 | } -------------------------------------------------------------------------------- /js/pack.js: -------------------------------------------------------------------------------- 1 | module.exports = function pack (format) { 2 | // from: https://github.com/kvz/locutus/blob/master/src/php/misc/pack.js 3 | // discuss at: http://locutus.io/php/pack/ 4 | // original by: Tim de Koning (http://www.kingsquare.nl) 5 | // parts by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) 6 | // bugfixed by: Tim de Koning (http://www.kingsquare.nl) 7 | // note 1: Float encoding by: Jonas Raoni Soares Silva 8 | // note 1: Home: http://www.kingsquare.nl/blog/12-12-2009/13507444 9 | // note 1: Feedback: phpjs-pack@kingsquare.nl 10 | // note 1: "machine dependent byte order and size" aren't 11 | // note 1: applicable for JavaScript; pack works as on a 32bit, 12 | // note 1: little endian machine. 13 | // example 1: pack('nvc*', 0x1234, 0x5678, 65, 66) 14 | // returns 1: '\u00124xVAB' 15 | // example 2: pack('H4', '2345') 16 | // returns 2: '#E' 17 | // example 3: pack('H*', 'D5') 18 | // returns 3: 'Õ' 19 | // example 4: pack('d', -100.876) 20 | // returns 4: "\u0000\u0000\u0000\u0000\u00008YÀ" 21 | // test: skip-1 22 | 23 | var formatPointer = 0 24 | var argumentPointer = 1 25 | var result = '' 26 | var argument = '' 27 | var i = 0 28 | var r = [] 29 | var instruction, quantifier, word, precisionBits, exponentBits, extraNullCount 30 | 31 | // vars used by float encoding 32 | var bias 33 | var minExp 34 | var maxExp 35 | var minUnnormExp 36 | var status 37 | var exp 38 | var len 39 | var bin 40 | var signal 41 | var n 42 | var intPart 43 | var floatPart 44 | var lastBit 45 | var rounded 46 | var j 47 | var k 48 | var tmpResult 49 | 50 | while (formatPointer < format.length) { 51 | instruction = format.charAt(formatPointer) 52 | quantifier = '' 53 | formatPointer++ 54 | while ((formatPointer < format.length) && (format.charAt(formatPointer) 55 | .match(/[\d*]/) !== null)) { 56 | quantifier += format.charAt(formatPointer) 57 | formatPointer++ 58 | } 59 | if (quantifier === '') { 60 | quantifier = '1' 61 | } 62 | 63 | // Now pack variables: 'quantifier' times 'instruction' 64 | switch (instruction) { 65 | case 'a': 66 | case 'A': 67 | // NUL-padded string 68 | // SPACE-padded string 69 | if (typeof arguments[argumentPointer] === 'undefined') { 70 | throw new Error('Warning: pack() Type ' + instruction + ': not enough arguments') 71 | } else { 72 | argument = String(arguments[argumentPointer]) 73 | } 74 | if (quantifier === '*') { 75 | quantifier = argument.length 76 | } 77 | for (i = 0; i < quantifier; i++) { 78 | if (typeof argument[i] === 'undefined') { 79 | if (instruction === 'a') { 80 | result += String.fromCharCode(0) 81 | } else { 82 | result += ' ' 83 | } 84 | } else { 85 | result += argument[i] 86 | } 87 | } 88 | argumentPointer++ 89 | break 90 | case 'h': 91 | case 'H': 92 | // Hex string, low nibble first 93 | // Hex string, high nibble first 94 | if (typeof arguments[argumentPointer] === 'undefined') { 95 | throw new Error('Warning: pack() Type ' + instruction + ': not enough arguments') 96 | } else { 97 | argument = arguments[argumentPointer] 98 | } 99 | if (quantifier === '*') { 100 | quantifier = argument.length 101 | } 102 | if (quantifier > argument.length) { 103 | var msg = 'Warning: pack() Type ' + instruction + ': not enough characters in string' 104 | throw new Error(msg) 105 | } 106 | 107 | for (i = 0; i < quantifier; i += 2) { 108 | // Always get per 2 bytes... 109 | word = argument[i] 110 | if (((i + 1) >= quantifier) || typeof argument[i + 1] === 'undefined') { 111 | word += '0' 112 | } else { 113 | word += argument[i + 1] 114 | } 115 | // The fastest way to reverse? 116 | if (instruction === 'h') { 117 | word = word[1] + word[0] 118 | } 119 | result += String.fromCharCode(parseInt(word, 16)) 120 | } 121 | argumentPointer++ 122 | break 123 | 124 | case 'c': 125 | case 'C': 126 | // signed char 127 | // unsigned char 128 | // c and C is the same in pack 129 | if (quantifier === '*') { 130 | quantifier = arguments.length - argumentPointer 131 | } 132 | if (quantifier > (arguments.length - argumentPointer)) { 133 | throw new Error('Warning: pack() Type ' + instruction + ': too few arguments') 134 | } 135 | 136 | for (i = 0; i < quantifier; i++) { 137 | result += String.fromCharCode(arguments[argumentPointer]) 138 | argumentPointer++ 139 | } 140 | break 141 | 142 | case 's': 143 | case 'S': 144 | case 'v': 145 | // signed short (always 16 bit, machine byte order) 146 | // unsigned short (always 16 bit, machine byte order) 147 | // s and S is the same in pack 148 | if (quantifier === '*') { 149 | quantifier = arguments.length - argumentPointer 150 | } 151 | if (quantifier > (arguments.length - argumentPointer)) { 152 | throw new Error('Warning: pack() Type ' + instruction + ': too few arguments') 153 | } 154 | 155 | for (i = 0; i < quantifier; i++) { 156 | result += String.fromCharCode(arguments[argumentPointer] & 0xFF) 157 | result += String.fromCharCode(arguments[argumentPointer] >> 8 & 0xFF) 158 | argumentPointer++ 159 | } 160 | break 161 | 162 | case 'n': 163 | // unsigned short (always 16 bit, big endian byte order) 164 | if (quantifier === '*') { 165 | quantifier = arguments.length - argumentPointer 166 | } 167 | if (quantifier > (arguments.length - argumentPointer)) { 168 | throw new Error('Warning: pack() Type ' + instruction + ': too few arguments') 169 | } 170 | 171 | for (i = 0; i < quantifier; i++) { 172 | result += String.fromCharCode(arguments[argumentPointer] >> 8 & 0xFF) 173 | result += String.fromCharCode(arguments[argumentPointer] & 0xFF) 174 | argumentPointer++ 175 | } 176 | break 177 | 178 | case 'i': 179 | case 'I': 180 | case 'l': 181 | case 'L': 182 | case 'V': 183 | // signed integer (machine dependent size and byte order) 184 | // unsigned integer (machine dependent size and byte order) 185 | // signed long (always 32 bit, machine byte order) 186 | // unsigned long (always 32 bit, machine byte order) 187 | // unsigned long (always 32 bit, little endian byte order) 188 | if (quantifier === '*') { 189 | quantifier = arguments.length - argumentPointer 190 | } 191 | if (quantifier > (arguments.length - argumentPointer)) { 192 | throw new Error('Warning: pack() Type ' + instruction + ': too few arguments') 193 | } 194 | 195 | for (i = 0; i < quantifier; i++) { 196 | result += String.fromCharCode(arguments[argumentPointer] & 0xFF) 197 | result += String.fromCharCode(arguments[argumentPointer] >> 8 & 0xFF) 198 | result += String.fromCharCode(arguments[argumentPointer] >> 16 & 0xFF) 199 | result += String.fromCharCode(arguments[argumentPointer] >> 24 & 0xFF) 200 | argumentPointer++ 201 | } 202 | 203 | break 204 | case 'N': 205 | // unsigned long (always 32 bit, big endian byte order) 206 | if (quantifier === '*') { 207 | quantifier = arguments.length - argumentPointer 208 | } 209 | if (quantifier > (arguments.length - argumentPointer)) { 210 | throw new Error('Warning: pack() Type ' + instruction + ': too few arguments') 211 | } 212 | 213 | for (i = 0; i < quantifier; i++) { 214 | result += String.fromCharCode(arguments[argumentPointer] >> 24 & 0xFF) 215 | result += String.fromCharCode(arguments[argumentPointer] >> 16 & 0xFF) 216 | result += String.fromCharCode(arguments[argumentPointer] >> 8 & 0xFF) 217 | result += String.fromCharCode(arguments[argumentPointer] & 0xFF) 218 | argumentPointer++ 219 | } 220 | break 221 | 222 | case 'f': 223 | case 'd': 224 | // float (machine dependent size and representation) 225 | // double (machine dependent size and representation) 226 | // version based on IEEE754 227 | precisionBits = 23 228 | exponentBits = 8 229 | if (instruction === 'd') { 230 | precisionBits = 52 231 | exponentBits = 11 232 | } 233 | 234 | if (quantifier === '*') { 235 | quantifier = arguments.length - argumentPointer 236 | } 237 | if (quantifier > (arguments.length - argumentPointer)) { 238 | throw new Error('Warning: pack() Type ' + instruction + ': too few arguments') 239 | } 240 | for (i = 0; i < quantifier; i++) { 241 | argument = arguments[argumentPointer] 242 | bias = Math.pow(2, exponentBits - 1) - 1 243 | minExp = -bias + 1 244 | maxExp = bias 245 | minUnnormExp = minExp - precisionBits 246 | status = isNaN(n = parseFloat(argument)) || n === -Infinity || n === +Infinity ? n : 0 247 | exp = 0 248 | len = 2 * bias + 1 + precisionBits + 3 249 | bin = new Array(len) 250 | signal = (n = status !== 0 ? 0 : n) < 0 251 | n = Math.abs(n) 252 | intPart = Math.floor(n) 253 | floatPart = n - intPart 254 | 255 | for (k = len; k;) { 256 | bin[--k] = 0 257 | } 258 | for (k = bias + 2; intPart && k;) { 259 | bin[--k] = intPart % 2 260 | intPart = Math.floor(intPart / 2) 261 | } 262 | for (k = bias + 1; floatPart > 0 && k; --floatPart) { 263 | (bin[++k] = ((floatPart *= 2) >= 1) - 0) 264 | } 265 | for (k = -1; ++k < len && !bin[k];) {} 266 | 267 | // @todo: Make this more readable: 268 | var key = (lastBit = precisionBits - 1 + 269 | (k = 270 | (exp = bias + 1 - k) >= minExp && 271 | exp <= maxExp ? k + 1 : bias + 1 - (exp = minExp - 1))) + 1 272 | 273 | if (bin[key]) { 274 | if (!(rounded = bin[lastBit])) { 275 | for (j = lastBit + 2; !rounded && j < len; rounded = bin[j++]) {} 276 | } 277 | for (j = lastBit + 1; rounded && --j >= 0; 278 | (bin[j] = !bin[j] - 0) && (rounded = 0)) {} 279 | } 280 | 281 | for (k = k - 2 < 0 ? -1 : k - 3; ++k < len && !bin[k];) {} 282 | 283 | if ((exp = bias + 1 - k) >= minExp && exp <= maxExp) { 284 | ++k 285 | } else { 286 | if (exp < minExp) { 287 | if (exp !== bias + 1 - len && exp < minUnnormExp) { 288 | // "encodeFloat::float underflow" 289 | } 290 | k = bias + 1 - (exp = minExp - 1) 291 | } 292 | } 293 | 294 | if (intPart || status !== 0) { 295 | exp = maxExp + 1 296 | k = bias + 2 297 | if (status === -Infinity) { 298 | signal = 1 299 | } else if (isNaN(status)) { 300 | bin[k] = 1 301 | } 302 | } 303 | 304 | n = Math.abs(exp + bias) 305 | tmpResult = '' 306 | 307 | for (j = exponentBits + 1; --j;) { 308 | tmpResult = (n % 2) + tmpResult 309 | n = n >>= 1 310 | } 311 | 312 | n = 0 313 | j = 0 314 | k = (tmpResult = (signal ? '1' : '0') + tmpResult + (bin 315 | .slice(k, k + precisionBits) 316 | .join('')) 317 | ).length 318 | r = [] 319 | 320 | for (; k;) { 321 | n += (1 << j) * tmpResult.charAt(--k) 322 | if (j === 7) { 323 | r[r.length] = String.fromCharCode(n) 324 | n = 0 325 | } 326 | j = (j + 1) % 8 327 | } 328 | 329 | r[r.length] = n ? String.fromCharCode(n) : '' 330 | result += r.join('') 331 | argumentPointer++ 332 | } 333 | break 334 | 335 | case 'x': 336 | // NUL byte 337 | if (quantifier === '*') { 338 | throw new Error('Warning: pack(): Type x: \'*\' ignored') 339 | } 340 | for (i = 0; i < quantifier; i++) { 341 | result += String.fromCharCode(0) 342 | } 343 | break 344 | 345 | case 'X': 346 | // Back up one byte 347 | if (quantifier === '*') { 348 | throw new Error('Warning: pack(): Type X: \'*\' ignored') 349 | } 350 | for (i = 0; i < quantifier; i++) { 351 | if (result.length === 0) { 352 | throw new Error('Warning: pack(): Type X:' + ' outside of string') 353 | } else { 354 | result = result.substring(0, result.length - 1) 355 | } 356 | } 357 | break 358 | 359 | case '@': 360 | // NUL-fill to absolute position 361 | if (quantifier === '*') { 362 | throw new Error('Warning: pack(): Type X: \'*\' ignored') 363 | } 364 | if (quantifier > result.length) { 365 | extraNullCount = quantifier - result.length 366 | for (i = 0; i < extraNullCount; i++) { 367 | result += String.fromCharCode(0) 368 | } 369 | } 370 | if (quantifier < result.length) { 371 | result = result.substring(0, quantifier) 372 | } 373 | break 374 | 375 | default: 376 | throw new Error('Warning: pack() Type ' + instruction + ': unknown format code') 377 | } 378 | } 379 | if (argumentPointer < arguments.length) { 380 | var msg2 = 'Warning: pack(): ' + (arguments.length - argumentPointer) + ' arguments unused' 381 | throw new Error(msg2) 382 | } 383 | 384 | return result 385 | } -------------------------------------------------------------------------------- /sinp/qqKe.sinp.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * from: https://7.url.cn/edu/webcourse/index_9000b3e.js 3 | * parse: auth_ext 4 | * des: 腾讯课堂auth_ext相关算法 5 | */ 6 | i.exports = { 7 | data: { 8 | isShow: !1, 9 | playType: null, 10 | isTryListen: !1 11 | }, 12 | filters: {}, 13 | directives: {}, 14 | methods: { 15 | config: function() { 16 | var e = this; 17 | return n.extend(!0, p, e.size()) 18 | }, 19 | eduext: function() { 20 | var e = ["uid_uin", "uid_a2", "uid_type", "_guest_type", "uuid", "uin", "luin", "skey", "lskey", "pSkey", "p_skey", "p_uin", "p_lskey", "p_luin", "uid_appid"], 21 | t = function() { 22 | var t = document.cookie, 23 | i = new RegExp("(^| )(" + e.join("|") + ")=([^;]*)(;|$)", "g"), 24 | a = t.match(i) || []; 25 | return n.trim(a.join("")) 26 | }, 27 | i = { 28 | course_id: parseInt(this.course_id, 10), 29 | term_id: parseInt(this.term_id, 10), 30 | type: 2, 31 | action: 0, 32 | cookie: t() 33 | }, 34 | a = o.getHash("taid") || o.query("taid"); 35 | "" !== a && (i.taid = parseInt(a, 10)); 36 | var r = v.encode(JSON.stringify(i)); 37 | return r 38 | }, 39 | videoTryListen: function(e, t, i, a) { 40 | var r = this, 41 | o = !1, 42 | s = 0; 43 | n(a).each(function(i, a) { 44 | a.taid !== t || a.vid !== e || 1 !== a.tryListenType && 2 !== a.tryListenType || (o = !0, s = a.tryListenTime) 45 | }), r.$el.innerHTML += '

可试看5分钟,购买课程后看完整版

' 46 | }, 47 | isTryListenFunc: function(e, t, i, a) { 48 | var r = !1; 49 | return n(a).each(function(i, a) { 50 | a.taid !== t || a.vid !== e || 1 !== a.tryListenType && 2 !== a.tryListenType || (r = !0) 51 | }), r 52 | }, 53 | getPrice: function(e) { 54 | var t = 0; 55 | return n(e.terms).each(function(e, i) { 56 | t = i.price 57 | }), t 58 | }, 59 | play: function(e, t, i, a, r) { 60 | var s = []; 61 | r = r._up || {}, this.$set("playType", i), this.$set("isTryListen", this.isTryListenFunc(e, t, i, a, r)), r.length && n.each(r._keys, function(e, t) { 62 | t = r[t], t && 5 === t.type && t.vid && s.push(t.vid) 63 | }); 64 | var l = this; 65 | l.playing = !0, x = 2 === (a || {}).agencytype ? 1 : 0; 66 | var d = function() { 67 | var r = l.config(), 68 | d = n.cookie.uin(); 69 | if (l.player || (l.$el.innerHTML = '
'), l.getPrice(a) > 0 ? f.show(d + "正在观看视频") : f.hide(), r.vid = e, r.authext = l.eduext(), r.flashvar = r.flashvar || {}, r.flashvar.eduext = r.authext, r.flashvar.loadingswf = "http://vm.gtimg.cn/minivideo_v1/vd/res/skins/ke_loading.swf", d && e && t && i) { 70 | l.history_key = ["vplayer", "history", d, e, t, i].join("_"); 71 | var c = parseInt(u.get(l.history_key), 10); 72 | r.connectionPlayTime = c > 0 ? c : 0 73 | } 74 | l.txplayerPlay(r); 75 | var p = o.getHash("taid") || o.query("taid"), 76 | h = function() { 77 | y && y.start(l.player, { 78 | vid: e, 79 | taid: p, 80 | term_id: l.term_id, 81 | agency_type: "" + x, 82 | course_id: l.course_id, 83 | needSign: l.needSign, 84 | source: 1 === i ? 1 : 0 85 | }) 86 | }; 87 | h(), l.autoplay = function() { 88 | var i = s.indexOf(e), 89 | a = s.length; 90 | return a > 1 && a - 1 > i ? (e = s[++i], l.$emit("autoplay", e, t), r.vid = e, l.player.play(r), h(), !0) : !1 91 | }, l.multiVideo = s.length > 0 92 | }; 93 | window.Txplayer ? d(window.Txplayer) : l.loadTVP("//vm.gtimg.cn/tencentvideo/txp/js/txplayer.js", d) 94 | }, 95 | hideFlashHack: function() { 96 | var e = document.getElementsByClassName("txp_overlay_expired"); 97 | e.length > 0 && (e[0].innerHTML = '

抱歉,您的浏览器不支持播放我们的课程

请下载 Chrome浏览器 观看

', clearInterval(l)) 98 | }, 99 | txplayerPlay: function(e) { 100 | this.player ? this.player.play(e) : (this.player = new Txplayer(e), this.registEventListen(this.player)), T = e, this.show() 101 | }, 102 | registEventListen: function(e) { 103 | e.videoOK = !1; 104 | var t = this; 105 | e.on("ready", function() { 106 | if (n(".txp_overlay_loading_content").hide(), "flash" !== e.getPlayerType()) { 107 | b.show(); 108 | var i = function() { 109 | 1 === e.getPlayerState() && t.$emit("vplayer.paused") 110 | }; 111 | n(".txp_btn_play").on("click", i), n(".txp_shadow").on("click", i) 112 | } 113 | }), e.on("playStateChange", function(i) { 114 | switch (i.state) { 115 | case -1: 116 | r(); 117 | break; 118 | case 0: 119 | if (e.isWindowFullscreen()) break; 120 | var o = !1; 121 | t.playend = !0, t.sethistory(!0), y && y.stop(), t.$emit("vplayer.allend"), o = t.autoplay(), t.multiVideo || (t.$emit("vplayer.nexttask"), setTimeout(function() { 122 | t.hide() 123 | }, 20)); 124 | break; 125 | case 1: 126 | if (!e.videoOK) { 127 | e.videoOK = !0, t.playend = !1, $({ 128 | action: "Play_clk" 129 | }), t.$emit("vplayer.videoOK"), _("播放成功总量", 2722706); 130 | var s = u.get("client_download_tips") || !1; 131 | if (!s && !P) { 132 | var l = (n(".txp_player.txp_player_external"), n(".txp_progress_bar_container")), 133 | d = n('
安装电脑客户端,播放更流畅下载安装
'); 134 | l.length && d.insertBefore(l), n(".js-download-close").click(function() { 135 | n(".js-download-ctn").hide(), u.set("client_download_tips", !0) 136 | }) 137 | } 138 | } 139 | "flash" !== e.getPlayerType() && b.hide(), y && y.start(); 140 | break; 141 | case 2: 142 | t.sethistory(), y && y.stop(), $({ 143 | action: "Pause_clk" 144 | }), "flash" === e.getPlayerType() && t.$emit("vplayer.paused"), a(t); 145 | break; 146 | case 3: 147 | "flash" !== e.getPlayerType() && (n(".txp_overlay_loading").hide(), b.show()); 148 | break; 149 | default: 150 | console.log("playStateChange other state", i) 151 | } 152 | }), e.on("windowFullscreenChange", function(e) { 153 | e && $({ 154 | action: "FullScreen_clk" 155 | }) 156 | }), e.on("timeupdate", function() { 157 | t.sethistory() 158 | }), e.on("error", function(e) { 159 | var i = window.metaData || {}, 160 | a = i.terms && i.terms[0] || {}, 161 | r = a.price > 0; 162 | r && t.handleError(e), t.isTryListen ? _("试听失败", 2563448) : 2 === t.playType ? _("录播失败", 2563446) : 5 === t.playType && _("回放失败", 2563447), !m.isLogin() && r ? _("视频播放失败,用户未登录", 2730167) : e && 101 === e.exem ? _("录播鉴权失败(未报名)", 2810132) : (_("播放失败总量", 2722707), w(2810287)), e && -700 === e.code && _("播放失败-700错误码", 2722847), window.BJ_REPORT.info({ 163 | msg: "tvpOnError, " + JSON.stringify(e), 164 | ext: { 165 | msid: 2118575 166 | } 167 | }), $({ 168 | action: "video_play_error", 169 | obj1: k, 170 | obj2: n.cookie.uin(), 171 | ver3: o.getUrlParam("vid"), 172 | ver5: JSON.stringify(e) 173 | }), t.$emit("vplayer.videoErr", e) 174 | }), e.on("showUIVipGuide", function(e) { 175 | e && e.trialFinish && h.get("flash").trigger("showPay") 176 | }) 177 | }, 178 | handleError: function() { 179 | m.isLogin() || 2 === self.playType || m.show() 180 | }, 181 | loadTVP: function(e, t) { 182 | var i = this; 183 | j(e, function() { 184 | t(window.Txplayer) 185 | }, function() { 186 | var a = "//vm.gtimg.cn/tencentvideo/txp/js/txplayer.js"; 187 | e != a ? i.loadTVP(a, t) : _("tvp 拉取失败", 2893523) 188 | }, function() { 189 | return window.Txplayer 190 | }) 191 | }, 192 | size: function() { 193 | var e = this.$header.outerWidth(), 194 | t = Math.max(n(window).height() - (P ? 0 : 60), 300); 195 | return n("body").css(window.innerHeight <= 380 ? { 196 | "overflow-y": "auto" 197 | } : { 198 | "overflow-y": "hidden" 199 | }), { 200 | width: e, 201 | height: t 202 | } 203 | }, 204 | resize: function() { 205 | var e = this.size(); 206 | this.player && this.player.resize && this.player.resize(e) 207 | }, 208 | sethistory: function(e) { 209 | var t = this; 210 | e ? u.remove(t.history_key) : t.history_key && t.player && t.player.getCurrentTime && u.set(t.history_key, t.player.getCurrentTime()) 211 | }, 212 | gethistory: function() { 213 | return this.player && this.player.getCurrentTime ? this.player.getCurrentTime() || 0 : 0 214 | }, 215 | unplay: function() { 216 | var e = this; 217 | e.sethistory(), e.hide(), e.playing = !1, y && y.stop() 218 | }, 219 | pause: function() { 220 | this.playing = !1, this.player && this.player.pause && this.player.pause() 221 | }, 222 | replay: function() { 223 | this.sethistory(!0), T.connectionPlayTime = 0, this.txplayerPlay(T) 224 | }, 225 | show: function() { 226 | this.$set("isShow", !0), this.$emit("vplayer.show") 227 | }, 228 | hide: function() { 229 | this.$emit("vplayer.hide"), this.$set("isShow", !1), f.hide() 230 | } 231 | }, 232 | ready: function() { 233 | var e = this; 234 | e.$header = n("#ke-header"), e.term_id = o.getHash("term_id") || o.query("term_id"), e.course_id = k, window.__tenplay_showPayTips = function(e) { 235 | var t = "(errCode: " + e.em + "." + e.exem + ")"; 236 | if (83 === e.em) switch (e.exem) { 237 | case 12: 238 | n.modal.alert("参数错误" + t); 239 | break; 240 | case 13: 241 | case 19: 242 | n.modal.alert("超时" + t); 243 | break; 244 | case 14: 245 | n.modal.alert("后台服务错误" + t); 246 | break; 247 | case 101: 248 | h.get("flash").trigger("showPay"); 249 | break; 250 | case 107: 251 | n.modal.alert("课程不存在" + t); 252 | break; 253 | case 111: 254 | case 112: 255 | n.modal.alert("黑名单" + t); 256 | break; 257 | case 200: 258 | m.isLogin() ? n.modal.alert("登录态失效,请退出重新登录" + t) : (m.show(), _("视频播放失败,用户未登录", 2730167)); 259 | break; 260 | case 201: 261 | n.modal.alert("试听失败" + t); 262 | break; 263 | case 203: 264 | n.modal.alert("禁止下载" + t); 265 | break; 266 | default: 267 | n.modal.alert("播放失败" + t) 268 | } else e && "previewover" === e.type ? h.get("flash").trigger("showPay") : n.modal.alert("播放失败" + t) 269 | }, n(window).on("resize", o.throttleV2(function() { 270 | e.playing && e.resize() 271 | }, 20, 50)).on("beforeunload", function() { 272 | !e.playend && e.sethistory() 273 | }), $({ 274 | action: "Exposure", 275 | ver1: e.course_id 276 | }) 277 | } 278 | } --------------------------------------------------------------------------------