#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import time
import subprocess
import execjs
import requests
from urllib.parse import quote
import re
fp = open("./jiemi.js")
jsdemo = fp.read()
def get_token(k):
exec = execjs.compile(jsdemo)
token = exec.call("decryptAES", k).get("k")
return token
def get_signature(httpSessionId,courseid, lessonid):
ts = int(time.time() * 1000)
url = f"https://study.163.com/dwr/call/plaincall/LessonLearnBean.getVideoLearnInfo.dwr?{ts}"
print(url)
data = """callCount=1
scriptSessionId=${scriptSessionId}190
httpSessionId=%s
c0-scriptName=LessonLearnBean
c0-methodName=getVideoLearnInfo
c0-id=0
c0-param0=string:%s
c0-param1=string:%s
batchId=1704360573476""" % (httpSessionId,lessonid, courseid)
print(data)
print(len(data))
head = {
"cookie": cookie,
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"Content-Type": "text/plain",
"Content-Length": str(len(data)),
"Origin": "https://study.163.com",
"Referer": "https://study.163.com/course/courseLearn.htm?courseId=1005094002&share=1&shareId=1564449636"
}
print(head)
result = requests.post(url, data=data, headers=head)
print(result.text)
res = re.compile('s1.signature="(.*?)";s1.srtKeys=null')
resx = re.compile('s1.videoId=(.*?);s1.videoImgUrl=null')
signature = res.search(result.text).group(1)
videoId = resx.search(result.text).group(1)
print(videoId, signature)
return signature, videoId
def get_videoUrl(signature, videoId):
url = f"https://vod.study.163.com/eds/api/v1/vod/video?videoId={videoId}&signature={signature}&clientType=1"
head = {
"cookie": cookie,
"Content-Type": "application/x-www-form-urlencoded",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
}
result = requests.get(url, headers=head)
print(result.json())
result_json = result.json()
v = result_json.get("result").get("videos")[2]
return v.get("k"), v.get("videoUrl")
def planNewBeanPayload(httpSessionId,courseId):
url = "https://study.163.com/dwr/call/plaincall/PlanNewBean.getPlanCourseDetail.dwr"
data = """callCount=1
scriptSessionId=\${scriptSessionId}190
httpSessionId=%s
c0-scriptName=PlanNewBean
c0-methodName=getPlanCourseDetail
c0-id=0
c0-param0=string:%s
c0-param1=number:0
c0-param2=null:null
batchId=1704360573476
""" % (httpSessionId,courseId)
header = {
"cookie": cookie,
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"Content-Type": "text/plain",
"Content-Length": str(len(data)),
"Origin": "https://study.163.com",
}
result = requests.post(url, data=data, headers=header)
# print(result.text)
les = re.compile('s\d+\.lessonName="(.*?)";s\d+\.level')
lessonIdRex = re.compile('s\d+\.id=(.*?);s\d+\.last')
lessonName_list = les.findall(result.text)
lessonId = lessonIdRex.findall(result.text)
# print(lessonName_list)
length = len(lessonName_list)
print(length, len(lessonId))
result_lessonName_list = []
result_lessonId_list = []
print("lessonName_list: ", lessonName_list)
print("lessonId: ", lessonId)
for i in range(length):
# print(lessonName_list[i].encode().decode("unicode_escape"), lessonId[i], )
print(lessonName_list[i].encode().decode("unicode_escape"))
print(lessonId[i + 1])
result_lessonName_list.append(lessonName_list[i].encode().decode("unicode_escape"))
result_lessonId_list.append(lessonId[i + 1])
return result_lessonName_list, result_lessonId_list
if __name__ == '__main__':
courseId = ""
httpSessionId = "" #cookie的NTESSTUDYSI
cookie = """"""
lessonName_list, lessonId_list = planNewBeanPayload(httpSessionId,courseId)
length = len(lessonName_list)
for i in range(length):
print(courseId, lessonId_list[i])
signature, videoId = get_signature(httpSessionId,courseId, lessonId_list[i])
k, videoUrk = get_videoUrl(signature, videoId)
token = get_token(k)
print(token)
t = int(time.time() * 1000)
m3u8_url = videoUrk + "&token=https:" + quote(token) + "&t=" + str(t)
print(m3u8_url)
result = requests.get(m3u8_url)
print(result.text)
# 这里,windows 改成 ffmpeg.exe
inputs = f"ffmpeg -i '{m3u8_url}' '课时{i + 1} {lessonName_list[i]}.mp4' "
subprocess.check_output(inputs, shell=True)
let cryptojs = {};
let aseKey = "3fp4xs922ouw5q72";
!function (t, e) {
"object" == typeof exports ? module.exports = exports = e() : "function" == typeof define && define.amd ? define([], e) : t.CryptoJS = e();
cryptojs = e()
}(this, function () {
var n, o, s, a, h, t, e, l, r, i, c, f, d, u, p, S, x, b, A, H, z, _, v, g, y, B, w, k, m, C, D, E, R, M, F, P, W,
O, I, U = U || function (h) {
var i;
if ("undefined" != typeof window && window.crypto && (i = window.crypto), "undefined" != typeof self && self.crypto && (i = self.crypto), !(i = !(i = !(i = "undefined" != typeof globalThis && globalThis.crypto ? globalThis.crypto : i) && "undefined" != typeof window && window.msCrypto ? window.msCrypto : i) && "undefined" != typeof global && global.crypto ? global.crypto : i) && "function" == typeof require) try {
i = require("crypto")
} catch (t) {
}
var r = Object.create || function (t) {
return e.prototype = t, t = new e, e.prototype = null, t
};
function e() {
}
var t = {}, n = t.lib = {}, o = n.Base = {
extend: function (t) {
var e = r(this);
return t && e.mixIn(t), e.hasOwnProperty("init") && this.init !== e.init || (e.init = function () {
e.$super.init.apply(this, arguments)
}), (e.init.prototype = e).$super = this, e
}, create: function () {
var t = this.extend();
return t.init.apply(t, arguments), t
}, init: function () {
}, mixIn: function (t) {
for (var e in t) t.hasOwnProperty(e) && (this[e] = t[e]);
t.hasOwnProperty("toString") && (this.toString = t.toString)
}, clone: function () {
return this.init.prototype.extend(this)
}
}, l = n.WordArray = o.extend({
init: function (t, e) {
t = this.words = t || [], this.sigBytes = null != e ? e : 4 * t.length
}, toString: function (t) {
return (t || c).stringify(this)
}, concat: function (t) {
var e = this.words, r = t.words, i = this.sigBytes, n = t.sigBytes;
if (this.clamp(), i % 4) for (var o = 0; o >> 2] >>> 24 - o % 4 * 8 & 255;
e[i + o >>> 2] |= s >> 2] = r[c >>> 2];
return this.sigBytes += n, this
}, clamp: function () {
var t = this.words, e = this.sigBytes;
t[e >>> 2] &= 4294967295 >> 2] >>> 24 - n % 4 * 8 & 255;
i.push((o >>> 4).toString(16)), i.push((15 & o).toString(16))
}
return i.join("")
}, parse: function (t) {
for (var e = t.length, r = [], i = 0; i >> 3] |= parseInt(t.substr(i, 2), 16) >> 2] >>> 24 - n % 4 * 8 & 255;
i.push(String.fromCharCode(o))
}
return i.join("")
}, parse: function (t) {
for (var e = t.length, r = [], i = 0; i >> 2] |= (255 & t.charCodeAt(i)) >> 32 - e
}
function j(t, e, r, i) {
var n, o = this._iv;
o ? (n = o.slice(0), this._iv = void 0) : n = this._prevBlock, i.encryptBlock(n, 0);
for (var s = 0; s > 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 += e >> 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 >> 16;
R[r] = ((n * n >>> 17) + n * o >>> 15) + o * o ^ ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0)
}
t[0] = R[0] + (R[7] >> 16) + (R[6] >> 16) | 0, t[1] = R[1] + (R[0] >> 24) + R[7] | 0, t[2] = R[2] + (R[1] >> 16) + (R[0] >> 16) | 0, t[3] = R[3] + (R[2] >> 24) + R[1] | 0, t[4] = R[4] + (R[3] >> 16) + (R[2] >> 16) | 0, t[5] = R[5] + (R[4] >> 24) + R[3] | 0, t[6] = R[6] + (R[5] >> 16) + (R[4] >> 16) | 0, t[7] = R[7] + (R[6] >> 24) + R[5] | 0
}
function q() {
for (var t = this._X, e = this._C, r = 0; r >> 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 >> 16;
I[r] = ((n * n >>> 17) + n * o >>> 15) + o * o ^ ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0)
}
t[0] = I[0] + (I[7] >> 16) + (I[6] >> 16) | 0, t[1] = I[1] + (I[0] >> 24) + I[7] | 0, t[2] = I[2] + (I[1] >> 16) + (I[0] >> 16) | 0, t[3] = I[3] + (I[2] >> 24) + I[1] | 0, t[4] = I[4] + (I[3] >> 16) + (I[2] >> 16) | 0, t[5] = I[5] + (I[4] >> 24) + I[3] | 0, t[6] = I[6] + (I[5] >> 16) + (I[4] >> 16) | 0, t[7] = I[7] + (I[6] >> 24) + I[5] | 0
}
return F = (M = U).lib, n = F.Base, o = F.WordArray, (M = M.x64 = {}).Word = n.extend({
init: function (t, e) {
this.high = t, this.low = e
}
}), M.WordArray = n.extend({
init: function (t, e) {
t = this.words = t || [], this.sigBytes = null != e ? e : 8 * t.length
}, toX32: function () {
for (var t = this.words, e = t.length, r = [], i = 0; i >> 2] |= t[i] >> 2] >>> 16 - n % 4 * 8 & 65535;
i.push(String.fromCharCode(o))
}
return i.join("")
}, parse: function (t) {
for (var e = t.length, r = [], i = 0; i >> 1] |= t.charCodeAt(i) >> 8 & 16711935
}
t.Utf16LE = {
stringify: function (t) {
for (var e = t.words, r = t.sigBytes, i = [], n = 0; n >> 2] >>> 16 - n % 4 * 8 & 65535);
i.push(String.fromCharCode(o))
}
return i.join("")
}, parse: function (t) {
for (var e = t.length, r = [], i = 0; i >> 1] |= s(t.charCodeAt(i) >> 2] >>> 24 - o % 4 * 8 & 255) >> 2] >>> 24 - (o + 1) % 4 * 8 & 255) >> 2] >>> 24 - (o + 2) % 4 * 8 & 255, c = 0; c >> 6 * (3 - c) & 63));
var a = i.charAt(64);
if (a) for (; n.length % 4;) n.push(a);
return n.join("")
}, parse: function (t) {
var e = t.length, r = this._map;
if (!(i = this._reverseMap)) for (var i = this._reverseMap = [], n = 0; n >> 6 - o % 4 * 2, c = s | c, i[n >>> 2] |= c >> 2] >>> 24 - s % 4 * 8 & 255) >> 2] >>> 24 - (s + 1) % 4 * 8 & 255) >> 2] >>> 24 - (s + 2) % 4 * 8 & 255, a = 0; a >> 6 * (3 - a) & 63));
var h = n.charAt(64);
if (h) for (; o.length % 4;) o.push(h);
return o.join("")
},
parse: function (t, e = !0) {
var r = t.length, i = e ? this._safe_map : this._map;
if (!(n = this._reverseMap)) for (var n = this._reverseMap = [], o = 0; o >> 6 - o % 4 * 2, c = s | c, i[n >>> 2] |= c >> 24) | 4278255360 & (n >> 8)
}
var o = this._hash.words, s = t[e + 0], c = t[e + 1], a = t[e + 2], h = t[e + 3], l = t[e + 4],
f = t[e + 5], d = t[e + 6], u = t[e + 7], p = t[e + 8], _ = t[e + 9], y = t[e + 10], v = t[e + 11],
g = t[e + 12], B = t[e + 13], w = t[e + 14], k = t[e + 15],
m = H(m = o[0], b = o[1], x = o[2], S = o[3], s, 7, A[0]), S = H(S, m, b, x, c, 12, A[1]),
x = H(x, S, m, b, a, 17, A[2]), b = H(b, x, S, m, h, 22, A[3]);
m = H(m, b, x, S, l, 7, A[4]), S = H(S, m, b, x, f, 12, A[5]), x = H(x, S, m, b, d, 17, A[6]), b = H(b, x, S, m, u, 22, A[7]), m = H(m, b, x, S, p, 7, A[8]), S = H(S, m, b, x, _, 12, A[9]), x = H(x, S, m, b, y, 17, A[10]), b = H(b, x, S, m, v, 22, A[11]), m = H(m, b, x, S, g, 7, A[12]), S = H(S, m, b, x, B, 12, A[13]), x = H(x, S, m, b, w, 17, A[14]), m = z(m, b = H(b, x, S, m, k, 22, A[15]), x, S, c, 5, A[16]), S = z(S, m, b, x, d, 9, A[17]), x = z(x, S, m, b, v, 14, A[18]), b = z(b, x, S, m, s, 20, A[19]), m = z(m, b, x, S, f, 5, A[20]), S = z(S, m, b, x, y, 9, A[21]), x = z(x, S, m, b, k, 14, A[22]), b = z(b, x, S, m, l, 20, A[23]), m = z(m, b, x, S, _, 5, A[24]), S = z(S, m, b, x, w, 9, A[25]), x = z(x, S, m, b, h, 14, A[26]), b = z(b, x, S, m, p, 20, A[27]), m = z(m, b, x, S, B, 5, A[28]), S = z(S, m, b, x, a, 9, A[29]), x = z(x, S, m, b, u, 14, A[30]), m = C(m, b = z(b, x, S, m, g, 20, A[31]), x, S, f, 4, A[32]), S = C(S, m, b, x, p, 11, A[33]), x = C(x, S, m, b, v, 16, A[34]), b = C(b, x, S, m, w, 23, A[35]), m = C(m, b, x, S, c, 4, A[36]), S = C(S, m, b, x, l, 11, A[37]), x = C(x, S, m, b, u, 16, A[38]), b = C(b, x, S, m, y, 23, A[39]), m = C(m, b, x, S, B, 4, A[40]), S = C(S, m, b, x, s, 11, A[41]), x = C(x, S, m, b, h, 16, A[42]), b = C(b, x, S, m, d, 23, A[43]), m = C(m, b, x, S, _, 4, A[44]), S = C(S, m, b, x, g, 11, A[45]), x = C(x, S, m, b, k, 16, A[46]), m = D(m, b = C(b, x, S, m, a, 23, A[47]), x, S, s, 6, A[48]), S = D(S, m, b, x, u, 10, A[49]), x = D(x, S, m, b, w, 15, A[50]), b = D(b, x, S, m, f, 21, A[51]), m = D(m, b, x, S, g, 6, A[52]), S = D(S, m, b, x, h, 10, A[53]), x = D(x, S, m, b, y, 15, A[54]), b = D(b, x, S, m, c, 21, A[55]), m = D(m, b, x, S, p, 6, A[56]), S = D(S, m, b, x, k, 10, A[57]), x = D(x, S, m, b, d, 15, A[58]), b = D(b, x, S, m, B, 21, A[59]), m = D(m, b, x, S, l, 6, A[60]), S = D(S, m, b, x, v, 10, A[61]), x = D(x, S, m, b, a, 15, A[62]), b = D(b, x, S, m, _, 21, A[63]), o[0] = o[0] + m | 0, o[1] = o[1] + b | 0, o[2] = o[2] + x | 0, o[3] = o[3] + S | 0
}, _doFinalize: function () {
var t = this._data, e = t.words, r = 8 * this._nDataBytes, i = 8 * t.sigBytes;
e[i >>> 5] |= 128 >> 9 >> 24) | 4278255360 & (n >> 8), e[14 + (64 + i >>> 9 >> 24) | 4278255360 & (r >> 8), t.sigBytes = 4 * (e.length + 1), this._process();
for (var e = this._hash, o = e.words, s = 0; s >> 24) | 4278255360 & (c >> 8)
}
return e
}, clone: function () {
var t = i.clone.call(this);
return t._hash = this._hash.clone(), t
}
});
function H(t, e, r, i, n, o, s) {
s = t + (e & r | ~e & i) + n + s;
return (s >> 32 - o) + e
}
function z(t, e, r, i, n, o, s) {
s = t + (e & i | r & ~i) + n + s;
return (s >> 32 - o) + e
}
function C(t, e, r, i, n, o, s) {
s = t + (e ^ r ^ i) + n + s;
return (s >> 32 - o) + e
}
function D(t, e, r, i, n, o, s) {
s = t + (r ^ (e | ~i)) + n + s;
return (s >> 32 - o) + e
}
t.MD5 = i._createHelper(e), t.HmacMD5 = i._createHmacHelper(e)
}(Math), P = (M = U).lib, t = P.WordArray, e = P.Hasher, P = M.algo, l = [], P = P.SHA1 = e.extend({
_doReset: function () {
this._hash = new t.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520])
}, _doProcessBlock: function (t, e) {
for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], s = r[3], c = r[4], a = 0; a >> 31);
var h = (i >> 27) + c + l[a];
h += a >> 2, n = i, i = h
}
r[0] = r[0] + i | 0, r[1] = r[1] + n | 0, r[2] = r[2] + o | 0, r[3] = r[3] + s | 0, r[4] = r[4] + c | 0
}, _doFinalize: function () {
var t = this._data, e = t.words, r = 8 * this._nDataBytes, i = 8 * t.sigBytes;
return e[i >>> 5] |= 128 >> 9 >> 9 >> 7) ^ (d >> 18) ^ d >>> 3) + _[f - 7] + ((u >> 17) ^ (u >> 19) ^ u >>> 10) + _[f - 16]);
var d = i & n ^ i & o ^ n & o,
u = l + ((c >> 6) ^ (c >> 11) ^ (c >> 25)) + (c & a ^ ~c & h) + p[f] + _[f],
l = h, h = a, a = c, c = s + u | 0, s = o, o = n, n = i,
i = u + (((i >> 2) ^ (i >> 13) ^ (i >> 22)) + d) | 0
}
r[0] = r[0] + i | 0, r[1] = r[1] + n | 0, r[2] = r[2] + o | 0, r[3] = r[3] + s | 0, r[4] = r[4] + c | 0, r[5] = r[5] + a | 0, r[6] = r[6] + h | 0, r[7] = r[7] + l | 0
}, _doFinalize: function () {
var t = this._data, e = t.words, r = 8 * this._nDataBytes, i = 8 * t.sigBytes;
return e[i >>> 5] |= 128 >> 9 >> 9 >> 1 | J >> 8 | J >> 7) + Z + ((j = (Z = (J >>> 1 | $ >> 8 | $ >> 7 | $ >> 0 >> 0 ? 1 : 0)) + ((G >>> 19 | V >> 29) ^ G >>> 6) + ((j += J = (V >>> 19 | G >> 29) ^ (V >>> 6 | G >> 0 >> 0 ? 1 : 0), j += $ = Q.low, N.high = T = T + Y + (j >>> 0 >> 0 ? 1 : 0), N.low = j);
var q = F & W ^ ~F & I, Z = P & O ^ ~P & U, V = A & z ^ A & D ^ z & D,
G = (H >>> 28 | A >> 2) ^ (H >> 7), J = t1[L], Q = J.high,
Y = J.low, $ = X + ((P >>> 14 | F >> 18 | F >> 9)),
N = K + ((F >>> 14 | P >> 18 | P >> 9)) + ($ >>> 0 >> 0 ? 1 : 0),
J = G + (H & C ^ H & E ^ C & E), K = I, X = U, I = W, U = O, W = F, O = P,
F = R + (N = (N = (N = N + q + (($ = $ + Z) >>> 0 >> 0 ? 1 : 0)) + Q + (($ = $ + Y) >>> 0 >> 0 ? 1 : 0)) + T + (($ = $ + j) >>> 0 >> 0 ? 1 : 0)) + ((P = M + $ | 0) >>> 0 >> 0 ? 1 : 0) | 0,
R = D, M = E, D = z, E = C, z = A, C = H,
A = N + (((A >>> 28 | H >> 2) ^ (A >> 7)) + V + (J >>> 0 >> 0 ? 1 : 0)) + ((H = $ + J | 0) >>> 0 >> 0 ? 1 : 0) | 0
}
d = i.low = d + H, i.high = f + A + (d >>> 0 >> 0 ? 1 : 0), p = n.low = p + C, n.high = u + z + (p >>> 0 >> 0 ? 1 : 0), y = o.low = y + E, o.high = _ + D + (y >>> 0 >> 0 ? 1 : 0), g = s.low = g + M, s.high = v + R + (g >>> 0 >> 0 ? 1 : 0), w = c.low = w + P, c.high = B + F + (w >>> 0 >> 0 ? 1 : 0), m = a.low = m + O, a.high = k + W + (m >>> 0 >> 0 ? 1 : 0), x = h.low = x + U, h.high = S + I + (x >>> 0 >> 0 ? 1 : 0), r = l.low = r + X, l.high = b + K + (r >>> 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 >> 10 >> 10 >> 24) | 4278255360 & (o >> 8);
(m = r[n]).high ^= s = 16711935 & (s >> 24) | 4278255360 & (s >> 8), m.low ^= o
}
for (var c = 0; c >> 31), l = u.low ^ (p >> 31), f = 0; f >> 32 - B, g >> 32 - B) : (h = g >> 64 - B, v >> 64 - B);
B = C[H[y]];
B.high = h, B.low = l
}
var w = C[0], k = r[0];
w.high = k.high, w.low = k.low;
for (a = 0; a >> 5] |= 1 >> 5) - 1] |= 128, t.sigBytes = 4 * e.length, this._process();
for (var n = this._state, e = this.cfg.outputLength / 8, o = e / 8, s = [], c = 0; c >> 24) | 4278255360 & (h >> 8);
s.push(a = 16711935 & (a >> 24) | 4278255360 & (a >> 8)), s.push(h)
}
return new f.init(s, e)
}, clone: function () {
for (var t = i.clone.call(this), e = t._state = this._state.slice(0), r = 0; r >> 24) | 4278255360 & (n >> 8)
}
for (var o, s, c, a, h, l, f = this._hash.words, d = H.words, u = z.words, p = S.words, _ = x.words, y = b.words, v = A.words, g = o = f[0], B = s = f[1], w = c = f[2], k = a = f[3], m = h = f[4], r = 0; r >> 5] |= 128 >> 9 >> 24) | 4278255360 & (r >> 8), t.sigBytes = 4 * (e.length + 1), this._process();
for (var e = this._hash, n = e.words, o = 0; o >> 24) | 4278255360 & (s >> 8)
}
return e
}, clone: function () {
var t = p.clone.call(this);
return t._hash = this._hash.clone(), t
}
}), w.RIPEMD160 = p._createHelper(F), w.HmacRIPEMD160 = p._createHmacHelper(F), P = (M = U).lib.Base, _ = M.enc.Utf8, M.algo.HMAC = P.extend({
init: function (t, e) {
t = this._hasher = new t.init, "string" == typeof e && (e = _.parse(e));
var r = t.blockSize, i = 4 * r;
(e = e.sigBytes > i ? t.finalize(e) : e).clamp();
for (var t = this._oKey = e.clone(), e = this._iKey = e.clone(), n = t.words, o = e.words, s = 0; s >> 2];
t.sigBytes -= e
}
}, d = (e.BlockCipher = a.extend({
cfg: a.cfg.extend({mode: n, padding: l}), reset: function () {
var t;
a.reset.call(this);
var 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
}), e.CipherParams = r.extend({
init: function (t) {
this.mixIn(t)
}, toString: function (t) {
return (t || this.formatter).stringify(this)
}
})), l = (t.format = {}).OpenSSL = {
stringify: function (t) {
var e = t.ciphertext, t = t.salt, e = t ? s.create([1398893684, 1701076831]).concat(t).concat(e) : e;
return e.toString(o)
}, parse: function (t) {
var e, r = o.parse(t), t = r.words;
return 1398893684 == t[0] && 1701076831 == t[1] && (e = s.create(t.slice(2, 4)), t.splice(0, 4), r.sigBytes -= 16), d.create({
ciphertext: r,
salt: e
})
}
}, u = e.SerializableCipher = r.extend({
cfg: r.extend({format: l}), encrypt: function (t, e, r, i) {
i = this.cfg.extend(i);
var n = t.createEncryptor(r, i), e = n.finalize(e), n = n.cfg;
return d.create({
ciphertext: e,
key: r,
iv: n.iv,
algorithm: t,
mode: n.mode,
padding: n.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
}
}), t = (t.kdf = {}).OpenSSL = {
execute: function (t, e, r, i) {
i = i || s.random(8);
t = c.create({keySize: e + r}).compute(t, i), r = s.create(t.words.slice(e), 4 * r);
return t.sigBytes = 4 * e, d.create({key: t, iv: r, salt: i})
}
}, p = e.PasswordBasedCipher = u.extend({
cfg: u.cfg.extend({kdf: t}), encrypt: function (t, e, r, i) {
r = (i = this.cfg.extend(i)).kdf.execute(r, t.keySize, t.ivSize);
i.iv = r.iv;
i = u.encrypt.call(this, t, e, r.key, i);
return i.mixIn(r), i
}, 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);
return i.iv = r.iv, u.decrypt.call(this, t, e, r.key, i)
}
})
}(), U.mode.CFB = ((F = U.lib.BlockCipherMode.extend()).Encryptor = F.extend({
processBlock: function (t, e) {
var r = this._cipher, i = r.blockSize;
j.call(this, t, e, i, r), this._prevBlock = t.slice(e, e + i)
}
}), F.Decryptor = F.extend({
processBlock: function (t, e) {
var r = this._cipher, i = r.blockSize, n = t.slice(e, e + i);
j.call(this, t, e, i, r), this._prevBlock = n
}
}), F), U.mode.CTR = (M = U.lib.BlockCipherMode.extend(), P = M.Encryptor = M.extend({
processBlock: function (t, e) {
var r = this._cipher, i = r.blockSize, n = this._iv, o = this._counter;
n && (o = this._counter = n.slice(0), this._iv = void 0);
var s = o.slice(0);
r.encryptBlock(s, 0), o[i - 1] = o[i - 1] + 1 | 0;
for (var c = 0; c >> 2] |= e >> 2];
t.sigBytes -= e
}
}, U.pad.Iso10126 = {
pad: function (t, e) {
e *= 4, e -= t.sigBytes % e;
t.concat(U.lib.WordArray.random(e - 1)).concat(U.lib.WordArray.create([e >> 2];
t.sigBytes -= e
}
}, U.pad.Iso97971 = {
pad: function (t, e) {
t.concat(U.lib.WordArray.create([2147483648], 1)), U.pad.ZeroPadding.pad(t, e)
}, unpad: function (t) {
U.pad.ZeroPadding.unpad(t), t.sigBytes--
}
}, U.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 >> 2] >>> 24 - r % 4 * 8 & 255) {
t.sigBytes = r + 1;
break
}
}
}, U.pad.NoPadding = {
pad: function () {
}, unpad: function () {
}
}, m = (P = U).lib.CipherParams, C = P.enc.Hex, P.format.Hex = {
stringify: function (t) {
return t.ciphertext.toString(C)
}, parse: function (t) {
t = C.parse(t);
return m.create({ciphertext: t})
}
}, function () {
var t = U, e = t.lib.BlockCipher, r = t.algo, h = [], l = [], f = [], d = [], u = [], p = [], _ = [], y = [],
v = [], g = [];
!function () {
for (var t = [], e = 0; e >> 8 ^ 255 & n ^ 99;
var o = t[l[n] = r], s = t[o], c = t[s], a = 257 * t[n] ^ 16843008 * n;
f[r] = a >> 8, d[r] = a >> 16, u[r] = a >> 24, p[r] = a, _[n] = (a = 16843009 * c ^ 65537 * s ^ 257 * o ^ 16843008 * r) >> 8, y[n] = a >> 16, v[n] = a >> 24, g[n] = a, r ? (r = o ^ t[t[t[c ^ o]]], i ^= t[t[i]]) : r = i = 1
}
}();
var B = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], r = r.AES = e.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)), n = this._keySchedule = [], o = 0; o >> 24] >> 16 & 255] >> 8 & 255] >> 24) >>> 24] >> 16 & 255] >> 8 & 255] >> 24]] ^ y[h[a >>> 16 & 255]] ^ v[h[a >>> 8 & 255]] ^ g[h[255 & a]]
}
}
}, encryptBlock: function (t, e) {
this._doCryptBlock(t, e, this._keySchedule, f, d, u, p, h)
}, decryptBlock: function (t, e) {
var r = t[e + 1];
t[e + 1] = t[e + 3], t[e + 3] = r, this._doCryptBlock(t, e, this._invKeySchedule, _, y, v, g, l);
r = t[e + 1];
t[e + 1] = t[e + 3], t[e + 3] = r
}, _doCryptBlock: function (t, e, r, i, n, o, 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] ^ n[l >>> 16 & 255] ^ o[f >>> 8 & 255] ^ s[255 & d] ^ r[u++], y = i[l >>> 24] ^ n[f >>> 16 & 255] ^ o[d >>> 8 & 255] ^ s[255 & h] ^ r[u++], v = i[f >>> 24] ^ n[d >>> 16 & 255] ^ o[h >>> 8 & 255] ^ s[255 & l] ^ r[u++], g = i[d >>> 24] ^ n[h >>> 16 & 255] ^ o[l >>> 8 & 255] ^ s[255 & f] ^ r[u++], h = _, l = y, f = v, d = g;
_ = (c[h >>> 24] >> 16 & 255] >> 8 & 255] >> 24] >> 16 & 255] >> 8 & 255] >> 24] >> 16 & 255] >> 8 & 255] >> 24] >> 16 & 255] >> 8 & 255] >> 5] >>> 31 - i % 32 & 1
}
for (var n = this._subKeys = [], o = 0; o >> 31;
for (r = 1; r >> 4 * (r - 1) + 3;
s[7] = s[7] >> 27
}
for (var a = this._invSubKeys = [], r = 0; r >> 0];
this._lBlock = s, this._rBlock = o ^ c
}
var h = this._lBlock;
this._lBlock = this._rBlock, this._rBlock = h, p.call(this, 1, 1431655765), _.call(this, 8, 16711935), _.call(this, 2, 858993459), p.call(this, 16, 65535), p.call(this, 4, 252645135), t[e] = this._lBlock, t[e + 1] = this._rBlock
}, keySize: 2, ivSize: 2, blockSize: 2
});
function p(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 >> 2] >>> 24 - s % 4 * 8 & 255, o = (o + i[n] + s) % 256, s = i[n];
i[n] = i[o], i[o] = s
}
this._i = this._j = 0
}, _doProcessBlock: function (t, e) {
t[e] ^= n.call(this)
}, keySize: 8, ivSize: 0
});
function n() {
for (var t = this._S, e = this._i, r = this._j, i = 0, n = 0; n >> 24) | 4278255360 & (t[r] >> 8);
for (var i = this._X = [t[0], t[3] >> 16, t[1], t[0] >> 16, t[2], t[1] >> 16, t[3], t[2] >> 16], n = this._C = [t[2] >> 16, 4294901760 & t[0] | 65535 & t[1], t[3] >> 16, 4294901760 & t[1] | 65535 & t[2], t[0] >> 16, 4294901760 & t[2] | 65535 & t[3], t[1] >> 16, 4294901760 & t[3] | 65535 & t[0]], r = this._b = 0; r >> 24) | 4278255360 & (s >> 8),
o = 16711935 & (c >> 24) | 4278255360 & (c >> 8),
s = e >>> 16 | 4294901760 & o, c = o >> 16 ^ r[3] >> 16 ^ r[5] >> 16 ^ r[7] >> 16 ^ r[1] >> 24) | 4278255360 & (D[i] >> 8), t[e + i] ^= D[i]
}, blockSize: 4, ivSize: 2
}), M.Rabbit = F._createHelper(P), F = (M = U).lib.StreamCipher, P = M.algo, W = [], O = [], I = [], P = P.RabbitLegacy = F.extend({
_doReset: function () {
for (var t = this._key.words, e = this.cfg.iv, r = this._X = [t[0], t[3] >> 16, t[1], t[0] >> 16, t[2], t[1] >> 16, t[3], t[2] >> 16], i = this._C = [t[2] >> 16, 4294901760 & t[0] | 65535 & t[1], t[3] >> 16, 4294901760 & t[1] | 65535 & t[2], t[0] >> 16, 4294901760 & t[2] | 65535 & t[3], t[1] >> 16, 4294901760 & t[3] | 65535 & t[0]], n = this._b = 0; n >> 24) | 4278255360 & (s >> 8),
o = 16711935 & (t >> 24) | 4278255360 & (t >> 8),
s = e >>> 16 | 4294901760 & o, t = o >> 16 ^ r[3] >> 16 ^ r[5] >> 16 ^ r[7] >> 16 ^ r[1] >> 24) | 4278255360 & (W[i] >> 8), t[e + i] ^= W[i]
}, blockSize: 4, ivSize: 2
}), M.RabbitLegacy = F._createHelper(P), U
});
function _(e) {
return String.fromCharCode.apply(null, e)
}
function f(e) {
var t = [], i, n, a;
for (n = 0; n = 0; --a)
t.push(i >> 8 * a & 255)
}
return t
}
function h(e) {
var t = new ArrayBuffer(e.length);
var i = new Uint8Array(t);
for (var n = 0, a = e.length; n