正文
增加 178 行删除 178 行
37 行未改动38394041424344454612 行未改动59606162636465666711 行未改动7980818283848586878889909147 行未改动13914014114214314414514614714814915015115217 行未改动17017117217317417517617717861 行未改动24024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227334 行未改动308309310311312313314315316179 行未改动全部展开49649749849950050150250350450550650750850911 行未改动52152252352452552652752852953097 行未改动6286296306316326336346356363 行未改动64064164264364464564664764857 行未改动70670770870971071171271371444 行未改动75976076176276376476576676735 行未改动8038048058068078088098108118127 行未改动82082182282382482582682782855 行未改动8848858868878888898908918928938948958968978988999009019028 行未改动91191291391491591691791891936 行未改动9569579589599609619629639649 行未改动97497597697797897998098198228 行未改动1011101210131014101510161017101810191020102177 行未改动109911001101110211031104110511061107110811094 行未改动11141115111611171118111911201121112210 行未改动11331134113511361137113811391140114115 行未改动115711581159116011611162116311641165120 行未改动全部展开12861287128812891290129112921293129499 行未改动13941395139613971398139914001401140214037 行未改动14111412141314141415141614171418141917 行未改动14371438143914401441144214431444144514461447144814491450145151 行未改动150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153013 行未改动15441545154615471548154915501551155226 行未改动15791580158115821583158415851586158724 行未改动16121613161416151616161716181619162016213 行未改动1625162616271628162916301631163216331634102 行未改动全部展开17371738173917401741174217431744174570 行未改动18161817181818191820182118221823182421 行未改动18461847184818491850185118521853185418557 行未改动18631864186518661867186818691870187117 行未改动188918901891189218931894189518961897189818991900190119021903190453 行未改动19581959196019611962196319641965196615 行未改动19821983198419851986198719881989199019911992199319941995199619978 行未改动2006200720082009201020112012201320147 行未改动20222023202420252026202720282029203078 行未改动2109211021112112211321142115211621172118211921202121212218 行未改动214121422143214421452146214721482149215024 行未改动2175217621772178217921802181218221832184218575 行未改动22612262226322642265226622672268226921 行未改动22912292229322942295229622972298229912 行未改动23122313231423152316231723182319232023212322232323242325232623272328232923302331233251 行未改动23842385238623872388238923902391239270 行未改动24632464246524662467246824692470247121 行未改动24932494249524962497249824992500250125027 行未改动25102511251225132514251525162517251817 行未改动253625372538253925402541254225432544254525462547254825492550145 行未改动全部展开2696269726982699270027012702270327042705270627072708270927102711271227133 行未改动27172718271927202721272227232724272520 行未改动27462747274827492750275127522753275427552756275727582759276027613 行未改动2765276627672768276927702771277227735 行未改动27792780278127822783278427852786278788 行未改动28762877287828792880288128822883288470 行未改动29552956295729582959296029612962296321 行未改动29852986298729882989299029912992299329947 行未改动30023003300430053006300730083009301017 行未改动30283029303030313032303330343035303630373038303930403041304280 行未改动3123312431253126312731283129313031313132313331343135313631373138313916 行未改动31563157315831593160316131623163316439 行未改动320432053206320732083209321032113212321313 行未改动322732283229323032313232323332343235323690 行未改动3327332833293330333133323333333433353336333733383339334033413342334333446 行未改动33513352335333543355335633573358335943 行未改动34033404340534063407340834093410341168 行未改动348034813482348334843485348634873488144 行未改动全部展开36333634363536363637363836393640364154 行未改动3696369736983699370037013702370337043 行未改动370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373222 行未改动375537563757375837593760376137623763376437653766376737684 行未改动37733774377537763777377837793780378137823783378437853786131 行未改动全部展开39183919392039213922392339243925392643 行未改动39703971397239733974397539763977397842 行未改动40214022402340244025402640274028402912 行未改动404240434044404540464047404840494050405140524053405475 行未改动4130413141324133413441354136413741387 行未改动4146414741484149415041514152415341544 行未改动41594160416141624163416441654166416711 行未改动41794180418141824183418441854186418741882 行未改动4191419241934194419541964197419841993 行未改动420342044205420642074208420942104211421250 行未改动42634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429274 行未改动4367436843694370437143724373437443758 行未改动43844385438643874388438943904391439243934394439543964397439839 行未改动44384439444044414442444344444445444642 行未改动44894490449144924493449444954496449715 行未改动45134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945406 行未改动45474548454945504551455245534554455535 行未改动4591459245934594459545964597459845994600460130 行未改动37 行未改动}function _defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, _toPropertyKey(o.key), o);}}function _toPropertyKey(t) {12 行未改动var user = new (function() {function User() {!function _classCallCheck(a, n) {if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, User), this.is_login = !1, this.vip_status = 0, this.mid = "", this.uname = "",this.has_init = !1, this.lazyInit();}return function _createClass(e, r, t) {return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {11 行未改动}}, {key: "lazyInit",value: function lazyInit(last_init) {this.has_init || (window.__BILI_USER_INFO__ ? (this.is_login = window.__BILI_USER_INFO__.isLogin,this.vip_status = window.__BILI_USER_INFO__.vipStatus, this.mid = window.__BILI_USER_INFO__.mid || "",this.uname = window.__BILI_USER_INFO__.uname || "") : window.__BiliUser__ && (this.is_login = window.__BiliUser__.isLogin,window.__BiliUser__.cache ? (this.vip_status = window.__BiliUser__.cache.data.vipStatus,this.mid = window.__BiliUser__.cache.data.mid || "", this.uname = window.__BiliUser__.cache.data.uname || "") : (this.vip_status = 0,this.mid = "", this.uname = "")), this.has_init = last_init);}} ]), User;}());47 行未改动}function cache_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, cache_toPropertyKey(o.key), o);}}function cache_createClass(e, r, t) {return r && cache_defineProperties(e.prototype, r), t && cache_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}17 行未改动return cache_createClass(CacheFactory, null, [ {key: "get",value: function get() {var name = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "default", cache = new Cache;return CacheFactory.map[name] instanceof Cache ? cache = CacheFactory.map[name] : CacheFactory.map[name] = cache,cache;}}, {key: "setValue",61 行未改动$("body").css("overflow", "hidden");}}, message = '<div class="message-bg"></div> <div id="message_box"> <div class="message-box-mark"></div> <div class="message-box-bg"> <span style="font-size:20px"><b>提示:</b></span> <div id="message_box_context" style="margin:2% 0">...</div><br/><br/> <div class="message-box-btn"> <button name="affirm">确定</button> <button name="cancel">取消</button> </div> </div> </div> <style>.message-bg{position:fixed;float:right;right:0;top:2%;z-index:30000}.message{margin-bottom:15px;padding:2% 2%;width:300px;display:flex;margin-top:-70px;opacity:0}.message-success{background-color:#dfd;border-left:6px solid #4caf50}.message-error{background-color:#fdd;border-left:6px solid #f44336}.message-info{background-color:#e7f3fe;border-left:6px solid #0c86de}.message-warning{background-color:#ffc;border-left:6px solid #ffeb3b}.message-context{font-size:21px;word-wrap:break-word;word-break:break-all}.message-context p{margin:0}#message_box{opacity:0;display:none;position:fixed;inset:0px;top:0;left:0;width:100%;height:100%;z-index:20000}.message-box-bg{position:absolute;background:#fff;border-radius:10px;padding:20px;top:50%;left:50%;transform:translate(-50%,-50%);width:500px;z-index:20001}.message-box-mark{width:100%;height:100%;position:fixed;top:0;left:0;background:rgba(0,0,0,.5);z-index:20000}.message-box-btn{text-align:right}.message-box-btn button{margin:0 5px;width:120px;height:40px;border-width:0;border-radius:3px;background:#1e90ff;cursor:pointer;outline:0;color:#fff;font-size:17px}.message-box-btn button:hover{background:#59f}</style> ';function messageBox(ctx, type) {"confirm" === type ? $('.message-box-btn button[name="cancel"]').show() : "alert" === type && $('.message-box-btn button[name="cancel"]').hide(),ctx.html ? $("#message_box_context").html('<div style="font-size:18px">'.concat(ctx.html, "</div>")) : $("#message_box_context").html('<div style="font-size:18px">╰( ̄▽ ̄)╮</div>'),scroll_scroll.hide(), $("#message_box").show(), $("#message_box").animate({opacity: "1"}, 300);var option = {affirm: function affirm() {$("#message_box").hide(), $("#message_box").css("opacity", 0), scroll_scroll.show(),ctx.callback && ctx.callback.affirm && ctx.callback.affirm();},cancel: function cancel() {$("#message_box").hide(), $("#message_box").css("opacity", 0), scroll_scroll.show(),ctx.callback && ctx.callback.cancel && ctx.callback.cancel();}};return $('.message-box-btn button[name="affirm"]')[0].onclick = option.affirm, $('.message-box-btn button[name="cancel"]')[0].onclick = option.cancel,option;}var id = 0;function message_message(html, type) {console.info("[Message] ".concat(type, " : ").concat(html)), function messageEnQueue(message, id) {$(".message-bg").append(message), $("#message_".concat(id)).animate({"margin-top": "+=70px",opacity: "1"}, 300);}('<div id="message_'.concat(id += 1, '" class="message message-').concat(type, '"><div class="message-context"><p><strong>').concat(type, ":</strong></p><p>").concat(html, "</p></div></div>"), id),function messageDeQueue(id) {var time = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 3;setTimeout(function() {var e = "div#message_".concat(id);34 行未改动};function ajax(obj) {return new Promise(function(resolve, reject) {obj.success = function(res) {res && res.code && message_Message_warning("".concat(res.message || "CODE:".concat(res.code))),resolve(res);}, obj.error = function(err) {message_Message_error("网络异常"), reject(err);}, $.ajax(obj);179 行未改动全部展开}function video_base_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, video_base_toPropertyKey(o.key), o);}}function video_base_createClass(e, r, t) {return r && video_base_defineProperties(e.prototype, r), t && video_base_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}11 行未改动return "symbol" == video_base_typeof(i) ? i : i + "";}var clazzMap = {}, VideoBase = function() {function VideoBase(video_type, main_title, state) {video_base_classCallCheck(this, VideoBase), this.constructor.name in clazzMap || (clazzMap[this.constructor.name] = this.constructor),this.video_type = video_type || "video", this.main_title = main_title || "", this.state = state,this.page = state && parseInt(state.p) || 1;}return video_base_createClass(VideoBase, [ {key: "getVideo",97 行未改动_inherits(Video, _VideoBase);var _super = _createSuper(Video);function Video(main_title, state) {var _state$sectionsInfo, _this2;video_base_classCallCheck(this, Video), (_this2 = _super.call(this, "video", main_title, state)).video_list = [],_this2.epList = [];var sections = state.sections || (null === (_state$sectionsInfo = state.sectionsInfo) || void 0 === _state$sectionsInfo ? void 0 : _state$sectionsInfo.sections) || [];if (!sections.length) return _possibleConstructorReturn(_this2);var _step, _iterator = _createForOfIteratorHelper(sections);3 行未改动try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {for (var video = _step2.value, i = 0, length = video.pages && video.pages.length || 0; i < length; ) {var _video = Object.assign({}, video);_video.title = video.title + (length > 1 ? " P".concat(i + 1, " ").concat(video.pages[i].part) : ""),_video.cid = video.pages[i].cid || 0, _this2.video_list.push(_video), i++;}_this2.epList.push(video);}57 行未改动var _step3, video_list = [], _iterator3 = _createForOfIteratorHelper(state.resourceList || []);try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) for (var video = _step3.value, i = 0, length = video.pages && video.pages.length || 0; i < length; ) {var _video = Object.assign({}, video);_video.title = video.title + (length > 1 ? " P".concat(i + 1, " ").concat(video.pages[i].title) : ""),_video.cid = video.pages[i].cid || 0, video_list.push(_video), i++;}} catch (err) {_iterator3.e(err);44 行未改动_inherits(VideoFestival, _VideoBase3);var _super3 = _createSuper(VideoFestival);function VideoFestival(main_title, state) {var _this4;return video_base_classCallCheck(this, VideoFestival), (_this4 = _super3.call(this, "video", main_title, state)).video_info = state.videoInfo,_this4.video_list = state.sectionEpisodes || [], _this4;}return video_base_createClass(VideoFestival, [ {key: "total",35 行未改动_inherits(Bangumi, _VideoBase4);var _super4 = _createSuper(Bangumi);function Bangumi(main_title, state) {var _this5;return video_base_classCallCheck(this, Bangumi), (_this5 = _super4.call(this, "bangumi", main_title, state)).epInfo = state.epInfo,_this5.epList = state.epList, _this5.epId = state.epId, _this5.epMap = state.epMap,_this5.isEpMap = state.isEpMap, _this5;}return video_base_createClass(Bangumi, [ {key: "total",7 行未改动}}, {key: "getEpPadLen",value: function getEpPadLen() {for (var n = Object.keys(this.isEpMap).length, len = n < 10 ? 1 : 0; n >= 1; ) n /= 10,len++;return len;}}, {55 行未改动var bangumiCache = cache.get("Bangumi");if (location.href == bangumiCache.get("href") && bangumiCache.get("build")) return bangumiCache.get("build");bangumiCache.set("build", null);var main_title, sid, epid, epMap = {}, pathname = location.pathname.toLowerCase();pathname.startsWith("/bangumi/play/ss") ? (sid = pathname.match(/ss(\d+)/), sid = parseInt(sid[1])) : pathname.startsWith("/bangumi/play/ep") && (epid = pathname.match(/ep(\d+)/),epid = parseInt(epid[1]));try {console.log("location sid:", sid, "epid:", epid);var page_data = JSON.parse($(".toolbar").attr("mr-show"));main_title = page_data.msg.title, sid = sid || page_data.msg.season_id, epid = epid || page_data.msg.ep_id,console.log("mr-show get sid:", sid, "epid:", epid);} catch (_unused) {console.warn("mr-show get err");}if (sid != bangumiCache.get("sid") && (bangumiCache.set("sid", sid), bangumiCache.set("epid", ""),bangumiCache.set("hasData", !1)), sid && !epid && _ajax({type: "GET",url: "https://api.bilibili.com/pgc/player/web/v2/playurl?support_multi_audio=true&qn=80&fnver=0&fnval=4048&fourk=1&gaia_source=&from_client=BROWSER&is_main_page=true&need_fragment=true&season_id=".concat(sid, "&isGaiaAvoided=false&voice_balance=1&drm_tech_type=2"),dataType: "json",8 行未改动url: "https://api.bilibili.com/pgc/view/web/ep/list?season_id=".concat(sid = sid || "", "&ep_id=").concat(epid),dataType: "json",cache: !0}).then(function(res) {res && !res.code && (bangumiCache.set("hasData", !0), bangumiCache.set("episodes", res.result.episodes || []),bangumiCache.set("section", res.result.section || []));}).finally(function() {bangumiCache.set("lock", !1);}), bangumiCache.set("href", location.href), !epid && !bangumiCache.get("epid")) throw "epid not found !";36 行未改动} finally {_iterator5.f();}epid = epid || bangumiCache.get("epid");for (var _id = 0, i = 0; i < episodes.length; i++) epMap[episodes[i].id] = episodes[i],episodes[i].id == epid && (_id = i);var bangumi = new Bangumi(main_title, {p: _id + 1,epId: epid,9 行未改动_inherits(Cheese, _VideoBase5);var _super5 = _createSuper(Cheese);function Cheese(main_title, state) {var _this6;return video_base_classCallCheck(this, Cheese), (_this6 = _super5.call(this, "cheese", main_title, state)).episodes = state.episodes,_this6;}return video_base_createClass(Cheese, [ {key: "total",28 行未改动} ], [ {key: "build",value: function build() {var epid, cheeseCache = cache.get("Cheese"), sid = (location.href.match(/\/cheese\/play\/ss(\d+)/i) || [ "", "" ])[1];if (sid || (epid = (location.href.match(/\/cheese\/play\/ep(\d+)/i) || [ "", "" ])[1]),epid || (epid = parseInt($(".bpx-state-active").eq(0).attr("data-episodeid"))),sid && sid != cheeseCache.get("sid") && (cheeseCache.set("sid", sid), cheeseCache.set("episodes", null)),!cheeseCache.get("episodes")) {if (cheeseCache.get("lock")) throw "cheese request waiting !";if (cheeseCache.set("lock", !0), !sid && !epid) return void console.log("get_season error");_ajax({77 行未改动} else {var keys = Object.keys(videoQualityMap), _q2 = parseInt(("video" === _type ? $("li.bpx-player-ctrl-quality-menu-item.bpx-state-active") : $("li.squirtle-select-item.active")).attr("data-value")), _q_max2 = parseInt($(("video" === _type ? $("li.bpx-player-ctrl-quality-menu-item") : $("li.squirtle-select-item")).get(0)).attr("data-value"));_q = keys.indexOf("".concat(_q2)) > -1 ? _q2 : 0, _q_max = keys.indexOf("".concat(_q_max2)) > -1 ? _q_max2 : 0;}return _q || (_q = parseInt($("li.bpx-player-ctrl-quality-menu-item.bpx-state-active").attr("data-value") || _q)),_q_max || (_q_max = parseInt($("li.bpx-player-ctrl-quality-menu-item").attr("data-value") || _q_max)),!_q_max && (_q_max = 80) && console.error("video get quality max error"), !_q && (_q = _q_max < 80 ? _q_max : 80),user.isVIP() || (_q = _q > 80 ? 80 : _q), {q: _q,q_max: _q_max};4 行未改动var k = $(this).text();q_map[k] && quality_list.push(q_map[k]);}); else {var keys = Object.keys(videoQualityMap);(list = [ "video", "list" ].includes(_type) ? $("li.bpx-player-ctrl-quality-menu-item") : $("li.squirtle-select-item"))[0] || (list = $("li.bpx-player-ctrl-quality-menu-item")),list && list.length && list.each(function() {var q = "".concat(parseInt($(this).attr("data-value")));keys.indexOf(q) > -1 && quality_list.push(q);});10 行未改动}function store_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, store_toPropertyKey(o.key), o);}}function store_toPropertyKey(t) {15 行未改动if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, Store), this.prefix = "bp_";}return function store_createClass(e, r, t) {return r && store_defineProperties(e.prototype, r), t && store_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(Store, [ {120 行未改动全部展开return r(_t, o);} finally {e.next = n.n;}}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v,e.next = n.n;try {return r.call(this, e);} finally {99 行未改动};function d(r, n) {for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {var o, i = p[t], d = G.p, l = i[2];r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n,G.n = l, c = 0));}if (o || r > 1) return a;throw y = !0, n;7 行未改动if (c || (o = "next"), t = i[o]) {if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");if (!t.done) return t;u = t.value, c < 2 && (c = 0);} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"),c = 1);i = e;} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;} catch (t) {17 行未改动var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function() {return this;}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);function f(e) {return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u),e;}return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction),GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"),_regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function() {return this;}), _regeneratorDefine2(u, "toString", function() {return "[object Generator]";51 行未改动"auto" === request_type && user.needReplace() && (request_type = "remote");var base_api, url_replace_cdn = function url_replace_cdn(url) {if ("0" === config_config.host_key) return url;var url_tmp = url.split("/"), mapping = hostMap[config_config.host_key];return "string" == typeof mapping && mapping.length ? mapping.at(0).match(/[a-z]/) && (url_tmp[2] = mapping) : "function" == typeof mapping && (url_tmp[2] = mapping()),url = url_tmp.join("/");}, ajax_obj = {type: "GET",dataType: "json"};if ("auto" === request_type || "local" === request_type) {var fnver, fnval;"cheese" === type ? (base_api = "https://api.bilibili.com/pugv/player/web/playurl",fnver = "mp4" === format ? 1 : 0, fnval = 80) : (base_api = "video" === type ? "https://api.bilibili.com/x/player/playurl" : "https://api.bilibili.com/pgc/player/web/playurl",fnver = 0, fnval = {dash: 4048,flv: 4049,mp4: 0}[format] || 0), base_api += "?avid=".concat(aid, "&bvid=").concat(bvid, "&cid=").concat(cid, "&qn=").concat(q, "&fnver=").concat(fnver, "&fnval=").concat(fnval, "&fourk=1&ep_id=").concat(epid, "&type=").concat(format, "&otype=json"),base_api += "mp4" === format ? "&platform=html5&high_quality=1" : "", ajax_obj.xhrFields = {withCredentials: !0};} else {base_api = config_config.base_api, base_api += "?av=".concat(aid, "&bv=").concat(bvid, "&cid=").concat(cid, "&ep=").concat(epid, "&q=").concat(q, "&type=").concat(type, "&format=").concat(format, "&otype=json"),page && (base_api += "&s");var _ref2 = [ store.get("auth_id"), store.get("auth_sec") ], auth_id = _ref2[0], auth_sec = _ref2[1];auth_id && auth_sec && (base_api += "&auth_id=".concat(auth_id, "&auth_sec=").concat(auth_sec));}13 行未改动}) : Promise.resolve(key);};new Promise(function(resolve, reject) {var promiseList = [], valueList = [];data.url ? promiseList.push(checkTask("url", "backup_url")) : (promiseList.push(checkTask("video", "backup_video")),promiseList.push(checkTask("audio", "backup_audio")));var timer = setTimeout(function() {resolve(valueList);}, 1500), index = 0;26 行未改动case 6:_context.prev = 6, _context.t0 = _context.catch(0), result = _context.t0;case 9:console.log("use " + result), valueList[index++] = result, index == promiseList.length && (clearInterval(timer),resolve(valueList));case 12:case "end":24 行未改动});};ajax_obj.url = base_api, ajax(ajax_obj).then(function(res) {var data;if (res.code || (data = res.result || res.data), !data) return "auto" === request_type ? void get_url_base(page, quality, video_format, success, error, "remote") : (res.url && (res.url = url_replace_cdn(res.url)),res.video && (res.video = url_replace_cdn(res.video)), res.audio && (res.audio = url_replace_cdn(res.audio)),void resultConvertor(res, _success));if (data.dash) {for (var result = {code: 0,3 行未改动audio: ""}, videos = data.dash.video, i = 0; i < videos.length; i++) {var _video = videos[i];if (_video.id <= q) {result.video = url_replace_cdn(_video.base_url), result.audio = url_replace_cdn(data.dash.audio[0].base_url),result.backup_video = _video.backup_url && url_replace_cdn(_video.backup_url[0]),result.backup_audio = data.dash.audio[0].backup_url && url_replace_cdn(data.dash.audio[0].backup_url[0]);break;}}102 行未改动全部展开return r(_t, o);} finally {e.next = n.n;}}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v,e.next = n.n;try {return r.call(this, e);} finally {70 行未改动f(t);}}var r;this.next || (runtime_lib_regeneratorDefine2(runtime_lib_regeneratorAsyncIterator.prototype),runtime_lib_regeneratorDefine2(runtime_lib_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {return this;})), runtime_lib_regeneratorDefine2(this, "_invoke", function(t, o, i) {function f() {21 行未改动};function d(r, n) {for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {var o, i = p[t], d = G.p, l = i[2];r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n,G.n = l, c = 0));}if (o || r > 1) return a;throw y = !0, n;7 行未改动if (c || (o = "next"), t = i[o]) {if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");if (!t.done) return t;u = t.value, c < 2 && (c = 0);} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"),c = 1);i = e;} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;} catch (t) {17 行未改动var c = [][n] ? t(t([][n]())) : (runtime_lib_regeneratorDefine2(t = {}, n, function() {return this;}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);function f(e) {return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,runtime_lib_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u),e;}return GeneratorFunction.prototype = GeneratorFunctionPrototype, runtime_lib_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype),runtime_lib_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction),GeneratorFunction.displayName = "GeneratorFunction", runtime_lib_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"),runtime_lib_regeneratorDefine2(u), runtime_lib_regeneratorDefine2(u, o, "Generator"),runtime_lib_regeneratorDefine2(u, n, function() {return this;}), runtime_lib_regeneratorDefine2(u, "toString", function() {return "[object Generator]";53 行未改动}function runtime_lib_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, runtime_lib_toPropertyKey(o.key), o);}}function runtime_lib_toPropertyKey(t) {15 行未改动if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, RuntimeLib), this.config = config, this.moduleAsync, this.anyResolved = !1;}return function runtime_lib_createClass(e, r, t) {return r && runtime_lib_defineProperties(e.prototype, r), t && runtime_lib_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(RuntimeLib, [ {key: "getModulePromise",value: function getModulePromise() {var _this = this, _this$config = this.config, urls = _this$config.urls, errs = (_this$config.getModule,[]);return urls && urls.length ? new Promise(function(resolve, reject) {var i = 0;urls.forEach(function(url) {8 行未改动}return _context.abrupt("return");case 3:return console.log("[Runtime Library] Start download from ".concat(url)), _context.next = 6,_ajax({url: url,type: "GET",dataType: "text",7 行未改动}return _context.abrupt("return");case 9:console.log("[Runtime Library] Downloaded from ".concat(url, " , length = ").concat(code.length)),_this.anyResolved = !0, resolve(code), _context.next = 20;break;case 14:78 行未改动case 6:_context2.t1 = _context2.sent, _context2.t2 = [ _context2.t1 ], _context2.t3 = {type: "text/javascript"}, blob = new _context2.t0(_context2.t2, _context2.t3), blob_url = URL.createObjectURL(blob),(script_tag = document.createElement("script")).src = blob_url, script_tag.onload = function() {console.log("[Runtime Library] Loaded ".concat(name, " from local")), getModule(window),URL.revokeObjectURL(blob_url);}, script_tag.onerror = function() {console.error("[Runtime Library] Failed to load ".concat(name, " from local")),URL.revokeObjectURL(blob_url);}, runtime_div.appendChild(script_tag);case 16:18 行未改动}function recover_player() {if (window.bp_dplayer) {var bili_video = $(bili_video_tag())[0];bili_video && bili_video.removeEventListener("play", bili_video_stop, !1), window.bp_dplayer.destroy(),window.bp_dplayer = null, $("#bp_dplayer").remove(), window.bp_dplayer_2 && (window.bp_dplayer_2.destroy(),window.bp_dplayer_2 = null, $("#bp_dplayer_2").remove()), $(get_bili_player_id()).show();}}function danmaku_config() {24 行未改动recover_player();var bili_video = $(bili_video_tag())[0];bili_video_stop(), bili_video && bili_video.addEventListener("play", bili_video_stop, !1);var bili_player_id = get_bili_player_id();$("#bilibiliPlayer")[0] ? ($(bili_player_id).before('<div id="bp_dplayer" class="bilibili-player relative bilibili-player-no-cursor">'),$(bili_player_id).hide()) : $("#bilibili-player")[0] ? ($(bili_player_id).before('<div id="bp_dplayer" class="bilibili-player relative bilibili-player-no-cursor" style="width:100%;height:100%;z-index:1000;"></div>'),$(bili_player_id).hide()) : $("#edu-player")[0] ? ($(bili_player_id).before('<div id="bp_dplayer" style="width:100%;height:100%;z-index:1000;"></div>'),$(bili_player_id).hide()) : MessageBox_alert('<div id="bp_dplayer" style="width:100%;height:100%;"></div>', function() {recover_player();}), api.get_subtitle_url(0, function dplayer_init() {var subtitle_url = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";75 行未改动!bp_dplayer.paused && bp_dplayer_2.play();}), bp_dplayer.on("playing", function() {!bp_dplayer.paused && bp_dplayer_2.play();}), bp_dplayer.on("timeupdate", function() {Math.abs(bp_dplayer.video.currentTime - bp_dplayer_2.video.currentTime) > 1 && (bp_dplayer_2.pause(),bp_dplayer_2.seek(bp_dplayer.video.currentTime)), !bp_dplayer.paused && bp_dplayer_2.play();}), bp_dplayer.on("seeking", function() {bp_dplayer_2.pause(), bp_dplayer_2.seek(bp_dplayer.video.currentTime);}), bp_dplayer.on("waiting", function() {21 行未改动}function check_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, check_toPropertyKey(o.key), o);}}function check_toPropertyKey(t) {12 行未改动var check = new (function() {function Check() {!function check_classCallCheck(a, n) {if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, Check), this.href = "", this.aid = "", this.cid = "", this.q = "", this.epid = "",this.locked = !1;}return function check_createClass(e, r, t) {return r && check_defineProperties(e.prototype, r), t && check_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(Check, [ {key: "refresh",value: function refresh() {if (!this.locked) {this.locked = !0, console.log("refresh..."), $("#video_download").hide(), $("#video_download_2").hide(),player.recover_player();try {this.href = location.href;var vb = video.base();51 行未改动return r(_t, o);} finally {e.next = n.n;}}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v,e.next = n.n;try {return r.call(this, e);} finally {70 行未改动f(t);}}var r;this.next || (common_regeneratorDefine2(common_regeneratorAsyncIterator.prototype),common_regeneratorDefine2(common_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {return this;})), common_regeneratorDefine2(this, "_invoke", function(t, o, i) {function f() {21 行未改动};function d(r, n) {for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {var o, i = p[t], d = G.p, l = i[2];r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n,G.n = l, c = 0));}if (o || r > 1) return a;throw y = !0, n;7 行未改动if (c || (o = "next"), t = i[o]) {if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");if (!t.done) return t;u = t.value, c < 2 && (c = 0);} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"),c = 1);i = e;} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;} catch (t) {17 行未改动var c = [][n] ? t(t([][n]())) : (common_regeneratorDefine2(t = {}, n, function() {return this;}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);function f(e) {return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,common_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u),e;}return GeneratorFunction.prototype = GeneratorFunctionPrototype, common_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype),common_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction),GeneratorFunction.displayName = "GeneratorFunction", common_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"),common_regeneratorDefine2(u), common_regeneratorDefine2(u, o, "Generator"), common_regeneratorDefine2(u, n, function() {return this;}), common_regeneratorDefine2(u, "toString", function() {return "[object Generator]";145 行未改动全部展开if ((response = _context.sent).ok) {_context.next = 8;break;}throw errorMsg = "toBlobURL: Failed to fetch ".concat(url, ": ").concat(response.status, " ").concat(response.statusText),console.error(errorMsg), new Error(errorMsg);case 8:return _context.next = 10, response.arrayBuffer();case 10:return buffer = _context.sent, blob = new Blob([ buffer ], {type: mimeType}), blobUrl = URL.createObjectURL(blob), console.log("toBlobURL: Created Blob URL for ".concat(url)),_context.abrupt("return", blobUrl);case 15:case "end":3 行未改动}))).apply(this, arguments);}function downloadBlobURL(blobUrl, downloadname) {var a = document.createElement("a");a.href = blobUrl, a.download = downloadname, a.style.display = "none", document.body.appendChild(a),a.click(), document.body.removeChild(a), setTimeout(function() {return URL.revokeObjectURL(blobUrl);}, 100);}20 行未改动}throw new Error("URL下载失败: " + url);case 6:contentLength = res.headers.get("content-length"), total = contentLength ? parseInt(contentLength, 10) : 0,reader = res.body.getReader(), loaded = 0, chunks = [];case 11:return _context3.next = 14, reader.read();case 14:if (_yield$reader$read = _context3.sent, done = _yield$reader$read.done, (value = _yield$reader$read.value) && (chunks.push(value),loaded += value.length, onProgress && onProgress(loaded, total)), !done) {_context3.next = 20;break;}3 行未改动_context3.next = 11;break;case 22:for (dataArray = new Uint8Array(loaded), pos = 0, _i = 0, _chunks = chunks; _i < _chunks.length; _i++) chunk = _chunks[_i],dataArray.set(chunk, pos), pos += chunk.length;return _context3.abrupt("return", dataArray);case 26:5 行未改动}function prettyBytes(bytes) {var decimalPlaces = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2;if (0 === bytes) return "0 B";for (var units = [ "B", "KB", "MB", "GB", "TB" ], size = bytes, unitIndex = 0; size >= 1024 && unitIndex < units.length - 1; ) size /= 1024,unitIndex++;var formatted = size.toFixed(decimalPlaces);return "".concat(formatted, " ").concat(units[unitIndex]);}88 行未改动return r(_t, o);} finally {e.next = n.n;}}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v,e.next = n.n;try {return r.call(this, e);} finally {70 行未改动f(t);}}var r;this.next || (ffmpeg_regeneratorDefine2(ffmpeg_regeneratorAsyncIterator.prototype),ffmpeg_regeneratorDefine2(ffmpeg_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {return this;})), ffmpeg_regeneratorDefine2(this, "_invoke", function(t, o, i) {function f() {21 行未改动};function d(r, n) {for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {var o, i = p[t], d = G.p, l = i[2];r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n,G.n = l, c = 0));}if (o || r > 1) return a;throw y = !0, n;7 行未改动if (c || (o = "next"), t = i[o]) {if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");if (!t.done) return t;u = t.value, c < 2 && (c = 0);} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"),c = 1);i = e;} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;} catch (t) {17 行未改动var c = [][n] ? t(t([][n]())) : (ffmpeg_regeneratorDefine2(t = {}, n, function() {return this;}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);function f(e) {return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,ffmpeg_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u),e;}return GeneratorFunction.prototype = GeneratorFunctionPrototype, ffmpeg_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype),ffmpeg_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction),GeneratorFunction.displayName = "GeneratorFunction", ffmpeg_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"),ffmpeg_regeneratorDefine2(u), ffmpeg_regeneratorDefine2(u, o, "Generator"), ffmpeg_regeneratorDefine2(u, n, function() {return this;}), ffmpeg_regeneratorDefine2(u, "toString", function() {return "[object Generator]";80 行未改动var baseFFmpegUrl, baseCoreUrl, baseCoreMTUrl;return ffmpeg_regeneratorRuntime().wrap(function _callee$(_context) {for (;;) switch (_context.prev = _context.next) {case 0:if (baseFFmpegUrl = "https://unpkg.com/@ffmpeg/ffmpeg@0.12.15/dist/umd", baseCoreUrl = "https://unpkg.com/@ffmpeg/core@0.12.10/dist/umd",baseCoreMTUrl = "https://unpkg.com/@ffmpeg/core-mt@0.12.10/dist/umd", ffmpeg.on("log", function(_ref3) {var message = _ref3.message;console.log("[ffmpeg]", message);}), !window.crossOriginIsolated) {_context.next = 25;break;}return console.log("[ffmpeg] 多线程模式"), _context.t0 = ffmpeg, _context.next = 10,toBlobURL("".concat(baseCoreMTUrl, "/ffmpeg-core.js"), "text/javascript");case 10:return _context.t1 = _context.sent, _context.next = 13, toBlobURL("".concat(baseCoreMTUrl, "/ffmpeg-core.wasm"), "application/wasm");16 行未改动_context.next = 39;break;case 25:return console.log("[ffmpeg] 单线程模式"), _context.t6 = ffmpeg, _context.next = 29,toBlobURL("".concat(baseCoreUrl, "/ffmpeg-core.js"), "text/javascript");case 29:return _context.t7 = _context.sent, _context.next = 32, toBlobURL("".concat(baseCoreUrl, "/ffmpeg-core.wasm"), "application/wasm");39 行未改动signal: controller.signal}) ]);case 20:return _yield$Promise$all = _context2.sent, _yield$Promise$all2 = ffmpeg_slicedToArray(_yield$Promise$all, 2),videoData = _yield$Promise$all2[0], audioData = _yield$Promise$all2[1], _context2.next = 26,ffmpeg.writeFile("video.m4s", videoData);case 26:return _context2.next = 28, ffmpeg.writeFile("audio.m4s", audioData);13 行未改动type: "video/mp4"})));case 38:return _context2.prev = 38, _context2.t0 = _context2.catch(11), controller && controller.signal && !controller.signal.aborted && (controller.abort(),message_Message_error("任务被迫中止")), console.error("Error merging streams:", _context2.t0),_context2.abrupt("return", Promise.reject(_context2.t0));case 43:case "end":90 行未改动var i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, videos = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];if (video_tasks.length) {if (i >= video_tasks.length) {var type = rpc_type();return videos.length > 0 && (download_videos_rpc(videos, type), videos.length = 0),void MessageBox_alert("批量下载执行结束!");}var task = video_tasks[i], msg = "第".concat(i + 1, "(").concat(i + 1, "/").concat(video_tasks.length, ")个视频");MessageBox_alert("".concat(msg, ":获取中..."));api.get_urls(task.p, task.q, task.format, function success(res) {if (setTimeout(function() {download_videos(video_tasks, i + 1, videos);}, 4e3), !res.code) {message_Message_success("请求成功" + (res.times ? "<br/>今日剩余请求次数".concat(res.times) : "")),MessageBox_alert("".concat(msg, ":获取成功!"));var _ref3 = [ res.url, rpc_type(), res.video, res.audio ], url = _ref3[0], type = _ref3[1], video_url = _ref3[2], audio_url = _ref3[3];"dash" === task.format ? (task.dl_video && videos.push({url: video_url,6 行未改动})) : videos.push({url: url,filename: task.filename + format(url),rpc_dir: task.rpc_dir}), "post" === type ? videos.length > 3 && (download_videos_rpc(videos, type), videos.length = 0) : "ariang" === type && (download_videos_rpc(videos, type),videos.length = 0);}}, function error() {download_videos(video_tasks, i + 1, videos);43 行未改动}(), message_Message_success("已连接到 Motrix,任务已发送"));});}, 500);}if ("1" === config_config.show_motrix_confirm_open_auto) return window.open("motrix://"),void startPolling();MessageBox_confirm("未检测到运行的 Motrix,是否启动?", function() {window.open("motrix://"), startPolling();}, function() {68 行未改动bp_aria2_window && !bp_aria2_window.closed || (open_ariang(), time = 3e3), setTimeout(function() {var bp_aria2_window = window.bp_aria2_window, cmd = [ "url=".concat(encodeURIComponent(window.btoa(video.url))), "out=".concat(encodeURIComponent(video.filename)), "header=User-Agent:".concat(window.navigator.userAgent), "header=Referer:".concat(window.location.origin) ];(video.rpc_dir || config_config.ariang_dir) && cmd.push("dir=".concat(encodeURIComponent(video.rpc_dir || config_config.ariang_dir)));var task_hash = "#!/new/task?" + cmd.join("&");bp_aria2_window && !bp_aria2_window.closed ? (bp_aria2_window.location.href = config_config.ariang_host + task_hash,message_Message_success("发送RPC请求")) : message_Message_warning("AriaNg页面未打开");}, time);}(videos.pop()), setTimeout(function() {download_rpc_ariang.apply(void 0, videos);144 行未改动全部展开}var _document$head$innerH, Download = {url_format: format,download: function download(url, filename, type) {filename = filename.replace(/[\/\\*|]+/g, "-").replace(/:/g, ":").replace(/\?/g, "?").replace(/"/g, "'").replace(/</g, "《").replace(/>/g, "》"),"blob" === type ? download_blob(url, filename) : "rpc" === type ? function download_rpc(url, filename, rpc_dir) {var type = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "post";if ("post" === type) {if ("0" === config_config.show_motrix_confirm) return void download_rpc_post({54 行未改动mergedBlob && 0 !== mergedBlob.size ? (show_merge_progress({isFinished: !0}), downloadBlob(mergedBlob, filename)) : message_Message_error("合并视频失败");}).catch(function(error) {console.error(error), "AbortError" !== error.name ? (controller.signal.aborted || controller.abort(),message_Message_error("合并下载失败")) : message_Message_warning("已取消下载");}).finally(function() {download_blob_merge_clicked = !1;});3 行未改动$("body").on("click", 'input[name="option_video"]', function(event) {function get_option_index(element) {return element && parseInt(element.id.split("_")[1]) || 0;}if ($(this).is(":checked") ? $(this).parent().css("color", "rgba(0,0,0,1)") : $(this).parent().css("color", "rgba(0,0,0,0.5)"),event.ctrlKey || event.altKey) {var current_select_option_index = get_option_index(event.target), option_videos = download_toConsumableArray(document.getElementsByName("option_video"));if (event.target.checked) for (var i = get_option_index(option_videos.filter(function(e) {return e.checked && get_option_index(e) < current_select_option_index;}).slice(-1)[0]); i < current_select_option_index; i++) option_videos[i].checked = !0,option_videos[i].parentNode.style.color = "rgba(0,0,0,1)"; else for (var _i = get_option_index(option_videos.filter(function(e) {return !e.checked && get_option_index(e) < current_select_option_index;}).slice(-1)[0]); _i < current_select_option_index; _i++) option_videos[_i].checked = !1,option_videos[_i].parentNode.style.color = "rgba(0,0,0,0.5)";}});for (var video_html = "", i = 0; i < total; i++) video_html += "" + '<label for="option_'.concat(i, '"><div style="color:rgba(0,0,0,0.5);">\n <input type="checkbox" id="option_').concat(i, '" name="option_video" value="').concat(i, '">\n P').concat(i + 1, " ").concat(vb.title(i + 1), "\n </div></label><hr>");var all_checked = !1;$("body").on("click", "button#checkbox_btn", function() {all_checked ? (all_checked = !1, $('input[name="option_video"]').prop("checked", all_checked),$('input[name="option_video"]').parent().css("color", "rgba(0,0,0,0.5)")) : (all_checked = !0,$('input[name="option_video"]').prop("checked", all_checked), $('input[name="option_video"]').parent().css("color", "rgb(0,0,0)"));});var _step, option_support_html = "", _iterator = download_createForOfIteratorHelper(video.get_quality_support());try {22 行未改动});}(dl_video || dl_audio) && ("post" === rpc_type() && "0" !== config_config.show_motrix_confirm ? checkMotrixRunningBeforeExecute(function() {download_videos([].concat(video_tasks));}) : download_videos([].concat(video_tasks))), dl_subtitle && (1 === video_tasks.length ? download_subtitle_vtt(video_tasks[0].p, video_tasks[0].filename) : download_subtitle_vtt_zip([].concat(video_tasks), new JSZip)),dl_danmaku && (1 === video_tasks.length ? download_danmaku_ass(video_tasks[0].cid, video_tasks[0].filename) : download_danmaku_ass_zip([].concat(video_tasks), new JSZip));}), $("#dl_format").val(config_config.format), $("#dl_quality").val(q);var dl_format_change_evt = function dl_format_change_evt(format) {"dash" === format ? ($("#dl_audio").prop("checked", !0).parent().css("color", "rgba(0,0,0,1)"),$("#dl_audio").prop("disabled", !1)) : ($("#dl_audio").prop("checked", !1).parent().css("color", "rgba(0,0,0,0.5)"),$("#dl_audio").prop("disabled", !0));};if (dl_format_change_evt(config_config.format), $("body").on("change", "#dl_format", function() {var format = $(this).val();4 行未改动var _$$, h = null === (_$$ = $("#playlist-video-action-list")[0]) || void 0 === _$$ ? void 0 : _$$.scrollHeight;if (!h) return;var timer1 = null, timer2 = null, old_h = h, change_count = 0, not_change_count = 0, load_down = !0;timer1 = setInterval(function() {load_down ? $("#playlist-video-action-list").scrollTop($("#playlist-video-action-list")[0].scrollHeight) : $("#playlist-video-action-list").scrollTop(0),load_down = !load_down, not_change_count > 12 && clearInterval(timer1);}, 1500), timer2 = setInterval(function() {(h = $("#playlist-video-action-list")[0].scrollHeight) > old_h ? (!change_count && MessageBox_confirm("正在加载视频列表,请稍后...", null, function() {clearInterval(timer1), clearInterval(timer2);}), change_count++, not_change_count = 0) : not_change_count++, old_h = h, not_change_count > 12 && (clearInterval(timer1),clearInterval(timer2), change_count > 0 && (message_Message_info("视频列表加载结束"), download_all()));}, 500);}},131 行未改动全部展开$("#video_download").hide(), $("#video_download_2").hide();break;}}config_config.host_key !== old_config.host_key && (check.refresh(), $("#video_url").attr("href", "#"),$("#video_url_2").attr("href", "#")), config_config.rpc_domain !== old_config.rpc_domain && (config_config.rpc_domain.match("https://") || config_config.rpc_domain.match(/(localhost|127\.0\.0\.1)/) || MessageBox_alert("检测到当前RPC不是localhost本地接口,即将跳转到AriaNg网页控制台页面;请查看控制台RPC接口参数是否正确,第一次加载可能较慢请耐心等待;配置好后即可使用脚本进行远程下载,使用期间不用关闭AriaNg页面!", function() {Download.open_ariang({domain: config_config.rpc_domain,port: config_config.rpc_port,43 行未改动port: config_config.rpc_port,path: config_config.rpc_path,token: config_config.rpc_token}, ariang_window = window.bp_aria2_window;if (ariang_window && !ariang_window.closed) return ariang_window.location.href = config_config.ariang_host + Download.get_ariang_set_hash(rpc),void message_Message_info("已同步配置");Download.open_ariang(rpc);}};42 行未改动}function auth_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, auth_toPropertyKey(o.key), o);}}function auth_toPropertyKey(t) {12 行未改动var api_url, api_url_temp, Auth = function() {function Auth() {!function auth_classCallCheck(a, n) {if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, Auth), this.auth_clicked = !1, this.auth_window = null, this.TV_KEY = "4409e2ce8ffd12b8",this.TV_SEC = "59b43e04ad6965f34319062b478f83dd";}return function auth_createClass(e, r, t) {return r && auth_defineProperties(e.prototype, r), t && auth_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(Auth, [ {75 行未改动local_id: "0",ts: Date.now().toString()}, _this3.TV_SEC)}).then(function(res) {!res.code && res.data ? (console.log("login success"), is_login = 1, _this3.doAuth(res.data),box.affirm()) : 86038 === res.code && box.affirm();});}, 3e3);}7 行未改动if (res && !res.code) {var _res$data2 = res.data, url = _res$data2.url, auth_code = _res$data2.auth_code;_this4.auth_window = window.open(url);var is_login = 0, timer = setInterval(function() {if (!_this4.auth_window || _this4.auth_window.closed) return clearInterval(timer),_this4.auth_clicked = !1, void (is_login || message_Message_info("登陆失败!"));_ajax({url: "https://passport.bilibili.com/x/passport-tv-login/qrcode/poll",type: "POST",4 行未改动local_id: "0",ts: Date.now().toString()}, _this4.TV_SEC)}).then(function(res) {!res.code && res.data ? (console.log("login success"), _this4.doAuth(res.data),is_login = 1, _this4.auth_window.close()) : 86038 === res.code && _this4.auth_window.close();}).catch(function() {return _this4.auth_window.close();});11 行未改动url: "".concat(config_config.base_api).concat(config_config.base_api.endsWith("/") ? "" : "/", "auth/?act=logout&auth_id=").concat(auth_id, "&auth_sec=").concat(auth_sec),type: "GET",dataType: "json"}).then(function(res) {res.code ? message_Message_warning("注销失败") : (message_Message_success("注销成功"), store.set("auth_id", ""),store.set("auth_sec", ""), store.set("auth_time", "0"), store.set("access_key", ""),$("#auth").val("0"));}).finally(function() {return _this5.auth_clicked = !1;});2 行未改动}, {key: "doAuth",value: function doAuth(param) {var _this6 = this;this.auth_window && !this.auth_window.closed && (this.auth_window.close(), this.auth_window = null),ajax({url: "".concat(config_config.base_api).concat(config_config.base_api.endsWith("/") ? "" : "/", "auth/?act=login&").concat(Object.entries({auth_id: store.get("auth_id"),auth_sec: store.get("auth_sec")3 行未改动type: "POST",contentType: "application/json",data: JSON.stringify(auth_objectSpread({}, param))}).then(function(res) {res.code ? message_Message_warning("授权失败") : (message_Message_success("授权成功"), res.auth_id && res.auth_sec && (store.set("auth_id", res.auth_id),store.set("auth_sec", res.auth_sec)), store.set("access_key", param.access_token),store.set("auth_time", Date.now()), $("#auth").val("1"));}).finally(function() {return _this6.auth_clicked = !1;});50 行未改动user.lazyInit(!0);var vb = video.base(), _ref = [ vb.type(), vb.aid(), vb.p(), vb.cid(), vb.epid() ], type = _ref[0], aid = _ref[1], p = _ref[2], cid = _ref[3], epid = _ref[4], q = video.get_quality().q;api_url = "".concat(config_config.base_api, "?av=").concat(aid, "&p=").concat(p, "&cid=").concat(cid, "&ep=").concat(epid, "&q=").concat(q, "&type=").concat(type, "&format=").concat(config_config.format, "&otype=json&_host=").concat(config_config.host_key, "&_req=").concat(config_config.request_type, "&_q=").concat(config_config.video_quality);var _ref2 = [ store.get("auth_id"), store.get("auth_sec") ], auth_id = _ref2[0], auth_sec = _ref2[1];if (auth_id && auth_sec && (api_url += "&auth_id=".concat(auth_id, "&auth_sec=").concat(auth_sec)),api_url !== api_url_temp || "local" === config_config.request_type) $("#video_url").attr("href", "#"),$("#video_url_2").attr("href", "#"), api_url_temp = api_url, message_Message_info("开始请求"),api.get_url(function(res) {if (res && !res.code) {var _url, _url_;if (message_Message_success("请求成功"), res.times && message_Message_info("剩余请求次数:".concat(res.times)),res.url) _url = res.url.replace("http://", "https://"), _url_ = "#"; else {if (!res.video || !res.audio) return void message_Message_warning("数据错误");_url = res.video.replace("http://", "https://"), _url_ = res.audio.replace("http://", "https://");}$("#video_url").attr("href", _url), $("#video_url").attr("download", vb.filename() + Download.url_format(_url)),$("#video_download").show(), "#" !== _url_ && ($("#video_url_2").attr("href", _url_),$("#video_url_2").attr("download", vb.filename() + "_audio.mp4"), $("#video_download_2").show()),(user.needReplace() || vb.isLimited() || "1" === config_config.replace_force) && player.replace_player(_url, _url_),"1" === config_config.auto_download && $("#video_download").click();}}); else {message_Message_miaow();var url = $("#video_url").attr("href"), url_2 = $("#video_url_2").attr("href");url && "#" !== url && ($("#video_download").show(), "dash" === config_config.format && $("#video_download_2").show(),(user.needReplace() || vb.isLimited() || "1" === config_config.replace_force) && !$("#bp_dplayer")[0] && player.replace_player(url, url_2),"1" === config_config.auto_download && $("#video_download").click());}},video_download: function video_download() {74 行未改动if ("more" !== key) {var item = toolbar_obj.find(".toolbar-left-item-wrap").eq(0).clone();item.attr("id", key);var svg = svg_map[key].replaceAll("#757575", "currentColor").replace("class", 'class="'.concat(item.find("svg").attr("class"), '"')), span = item.find("span").text(btn_list[key]), item_div = item.find("div").eq(0);item_div.attr("title", btn_list[key]), item_div.removeClass("on"), item_div.children().remove(),item_div.append(svg).append(span), left.append(item);} else {var more_map = btn_list[key], el = "" + '<div class="more">更多<div class="more-ops-list">\n <ul>'.concat(Object.keys(more_map).map(function(key) {return '<li><span id="'.concat(key, '">').concat(more_map[key], "</span></li>");8 行未改动toolbar_obj_2.attr("id", "bp_toolbar");var left = toolbar_obj_2.find(".video-toolbar-content_left"), right = toolbar_obj_2.find(".video-toolbar-content_right");toolbar_obj_2.find(".video-toobar_title").remove(), left.children().remove();var watchlater = right.find(".watchlater").clone();right.children().remove(), right.append(watchlater), toolbar_obj_2.find(".video-desc-wrapper").remove(),Object.keys(btn_list).map(function(key) {if ("more" !== key) {var item = toolbar_obj.find(".video-toolbar-content_item").eq(0).clone();item.attr("id", key), item.attr("title", btn_list[key]);var svg = svg_map[key].replaceAll("#757575", "currentColor"), item_icon = item.find(".content-item_icon").eq(0);item_icon.removeClass("ic_like"), item_icon.html(svg), item.html(""), item.append(item_icon),item.append(btn_list[key]), left.append(item);} else {var list = watchlater.find(".more-list"), list_li = list.children().eq(0);list.children().remove();39 行未改动}).join("");return "" + '<div class="'.concat(main_class_name, '">\n ').concat(toolbar_elements, "\n ").concat(more_style, "\n </div>");}(toolbar_class, [ span_class, span_class_svg, span_class_text ]));} else $("#toolbar_module")[0] && $("#toolbar_module").after('<div id="bp_toolbar" class="tool-bar clearfix report-wrap-module report-scroll-module media-info" scrollshow="true"> <div id="setting_btn" class="like-info"> <i class="iconfont icon-add"></i><span>脚本设置</span> </div> <div id="bilibili_parse" class="like-info"> <i class="iconfont icon-customer-serv"></i><span>请求地址</span> </div> <div id="video_download" class="like-info" style="display:none"> <i class="iconfont icon-download"></i><span>下载视频</span> </div> <div id="video_download_2" class="like-info" style="display:none"> <i class="iconfont icon-download"></i><span>下载音频</span> </div> <div id="video_download_all" class="like-info"> <i class="iconfont icon-download"></i><span>批量下载</span> </div> <div class="more">更多<div class="more-ops-list"> <ul> <li><span id="download_danmaku">下载弹幕</span></li> <li><span id="download_subtitle">下载字幕</span></li> </ul> </div> </div> <style>.tool-bar .more{float:right;cursor:pointer;color:#757575;font-size:16px;transition:all .3s;position:relative;text-align:center}.tool-bar .more:hover .more-ops-list{display:block}.tool-bar:after{display:block;content:"";clear:both}.more-ops-list{display:none;position:absolute;width:80px;left:-65px;z-index:30;text-align:center;padding:10px 0;background:#fff;border:1px solid #e5e9ef;box-shadow:0 2px 4px 0 rgba(0,0,0,.14);border-radius:2px;font-size:14px;color:#222}.more-ops-list li{position:relative;height:34px;line-height:34px;cursor:pointer;transition:all .3s}.more-ops-list li:hover{color:#00a1d6;background:#e7e7e7}</style> </div> ');$("#limit-mask-wall")[0] && $("#limit-mask-wall").remove(), $("#video_download").hide(),$("#video_download_2").hide();}function main_typeof(o) {return main_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {42 行未改动}function main_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, main_toPropertyKey(o.key), o);}}function main_toPropertyKey(t) {15 行未改动if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, Main), console.log("\n".concat(" %c bilibili-parse-download.user.js v", "2.9.2", " ").concat("90a6675", " %c https://github.com/injahow/user.js ", "\n", "\n"), "color: #fadfa3; background: #030307; padding:5px 0;", "background: #fadfa3; padding:5px 0;");}return function main_createClass(e, r, t) {return r && main_defineProperties(e.prototype, r), t && main_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(Main, [ {key: "loadToolbar",value: function loadToolbar() {var timer, timeout, loading = !1;timer = setInterval(function() {document.getElementById("nav-searchform") && (loading || (loading = !0, initToolbar()),clearInterval(timer));}, 500);try {timeout = (timeout = config_config.show_ui_timeout ? parseInt(config_config.show_ui_timeout) : 8) > 0 ? timeout : 8;} catch (err) {console.error("show_ui_timeout err:", err);}setTimeout(function() {if (clearInterval(timer), !loading) {if (console.warn("waiting timeout..."), "1" === config_config.show_ui_confirm) return "1" === config_config.show_ui_confirm_load_force ? (loading = !0,void initToolbar()) : void MessageBox_confirm("加载脚本工具栏超时,建议刷新页面重新加载,是否强制加载工具栏?", initToolbar, null);message_Message_warning("工具栏加载异常,已延迟加载"), setTimeout(function() {loading || (loading = !0, initToolbar()), message_Message_info("工具栏已重新加载");}, 5e3);6 行未改动var root_div = document.createElement("div");root_div.id = "bp_root", document.body.append(root_div), function initConfig(el) {var options = '<option value="0">关闭</option>';for (var k in hostMap) options += '<option value="'.concat(k, '">').concat(hostMap[k], "</option>");for (var _k in config = config.replace("{{host_key_options}}", options), options = '<option value="0">与播放器相同</option>',videoQualityMap) options += '<option value="'.concat(_k, '">').concat(videoQualityMap[_k], "</option>");config = config.replace("{{video_quality_options}}", options), el && $(el)[0] ? $(el).append(config) : $("body").append(config);var tabLinks = document.querySelectorAll("#bp_config .tab-link"), panels = document.querySelectorAll("#bp_config .tab-panel"), showTab = function showTab(id) {panels.forEach(function(p) {35 行未改动bp_aria2_window && !bp_aria2_window.closed && bp_aria2_window.close();};}("#".concat(root_div.id)), function initMessage(el) {el && $(el)[0] ? $(el).append(message) : $("body").append(message);}("#".concat(root_div.id)), this.loadToolbar(), user.lazyInit(), auth.checkLoginStatus(),check.refresh(), $("#".concat(root_div.id)).append('<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/dplayer/1.25.0/DPlayer.min.css">'),$("#".concat(root_div.id)).append('<a id="video_url" style="display:none;" target="_blank" referrerpolicy="origin" href="#"></a>'),$("#".concat(root_div.id)).append('<a id="video_url_2" style="display:none;" target="_blank" referrerpolicy="origin" href="#"></a>');}}, {key: "run",30 行未改动37 行未改动38394041424344454612 行未改动59606162636465666711 行未改动7980818283848586878889909147 行未改动13914014114214314414514614714814915015115217 行未改动17017117217317417517617717861 行未改动24024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227334 行未改动308309310311312313314315316179 行未改动全部展开49649749849950050150250350450550650750850911 行未改动52152252352452552652752852953097 行未改动6286296306316326336346356363 行未改动64064164264364464564664764857 行未改动70670770870971071171271371444 行未改动75976076176276376476576676735 行未改动8038048058068078088098108118127 行未改动82082182282382482582682782855 行未改动8848858868878888898908918928938948958968978988999009019028 行未改动91191291391491591691791891936 行未改动9569579589599609619629639649 行未改动97497597697797897998098198228 行未改动1011101210131014101510161017101810191020102177 行未改动109911001101110211031104110511061107110811094 行未改动11141115111611171118111911201121112210 行未改动11331134113511361137113811391140114115 行未改动115711581159116011611162116311641165120 行未改动全部展开12861287128812891290129112921293129499 行未改动13941395139613971398139914001401140214037 行未改动14111412141314141415141614171418141917 行未改动14371438143914401441144214431444144514461447144814491450145151 行未改动150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153013 行未改动15441545154615471548154915501551155226 行未改动15791580158115821583158415851586158724 行未改动16121613161416151616161716181619162016213 行未改动1625162616271628162916301631163216331634102 行未改动全部展开17371738173917401741174217431744174570 行未改动18161817181818191820182118221823182421 行未改动18461847184818491850185118521853185418557 行未改动18631864186518661867186818691870187117 行未改动188918901891189218931894189518961897189818991900190119021903190453 行未改动19581959196019611962196319641965196615 行未改动19821983198419851986198719881989199019911992199319941995199619978 行未改动2006200720082009201020112012201320147 行未改动20222023202420252026202720282029203078 行未改动2109211021112112211321142115211621172118211921202121212218 行未改动214121422143214421452146214721482149215024 行未改动2175217621772178217921802181218221832184218575 行未改动22612262226322642265226622672268226921 行未改动22912292229322942295229622972298229912 行未改动23122313231423152316231723182319232023212322232323242325232623272328232923302331233251 行未改动23842385238623872388238923902391239270 行未改动24632464246524662467246824692470247121 行未改动24932494249524962497249824992500250125027 行未改动25102511251225132514251525162517251817 行未改动253625372538253925402541254225432544254525462547254825492550145 行未改动全部展开2696269726982699270027012702270327042705270627072708270927102711271227133 行未改动27172718271927202721272227232724272520 行未改动27462747274827492750275127522753275427552756275727582759276027613 行未改动2765276627672768276927702771277227735 行未改动27792780278127822783278427852786278788 行未改动28762877287828792880288128822883288470 行未改动29552956295729582959296029612962296321 行未改动29852986298729882989299029912992299329947 行未改动30023003300430053006300730083009301017 行未改动30283029303030313032303330343035303630373038303930403041304280 行未改动3123312431253126312731283129313031313132313331343135313631373138313916 行未改动31563157315831593160316131623163316439 行未改动320432053206320732083209321032113212321313 行未改动322732283229323032313232323332343235323690 行未改动3327332833293330333133323333333433353336333733383339334033413342334333446 行未改动33513352335333543355335633573358335943 行未改动34033404340534063407340834093410341168 行未改动348034813482348334843485348634873488144 行未改动全部展开36333634363536363637363836393640364154 行未改动3696369736983699370037013702370337043 行未改动370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373222 行未改动375537563757375837593760376137623763376437653766376737684 行未改动37733774377537763777377837793780378137823783378437853786131 行未改动全部展开39183919392039213922392339243925392643 行未改动39703971397239733974397539763977397842 行未改动40214022402340244025402640274028402912 行未改动404240434044404540464047404840494050405140524053405475 行未改动4130413141324133413441354136413741387 行未改动4146414741484149415041514152415341544 行未改动41594160416141624163416441654166416711 行未改动41794180418141824183418441854186418741882 行未改动4191419241934194419541964197419841993 行未改动420342044205420642074208420942104211421250 行未改动42634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429274 行未改动4367436843694370437143724373437443758 行未改动43844385438643874388438943904391439243934394439543964397439839 行未改动44384439444044414442444344444445444642 行未改动44894490449144924493449444954496449715 行未改动45134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945406 行未改动45474548454945504551455245534554455535 行未改动4591459245934594459545964597459845994600460130 行未改动37 行未改动}function _defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, _toPropertyKey(o.key), o);}}function _toPropertyKey(t) {12 行未改动var user = new (function() {function User() {!function _classCallCheck(a, n) {if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, User), this.is_login = !1, this.vip_status = 0, this.mid = "", this.uname = "",this.has_init = !1, this.lazyInit();}return function _createClass(e, r, t) {return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {11 行未改动}}, {key: "lazyInit",value: function lazyInit(last_init) {this.has_init || (window.__BILI_USER_INFO__ ? (this.is_login = window.__BILI_USER_INFO__.isLogin,this.vip_status = window.__BILI_USER_INFO__.vipStatus, this.mid = window.__BILI_USER_INFO__.mid || "",this.uname = window.__BILI_USER_INFO__.uname || "") : window.__BiliUser__ && (this.is_login = window.__BiliUser__.isLogin,window.__BiliUser__.cache ? (this.vip_status = window.__BiliUser__.cache.data.vipStatus,this.mid = window.__BiliUser__.cache.data.mid || "", this.uname = window.__BiliUser__.cache.data.uname || "") : (this.vip_status = 0,this.mid = "", this.uname = "")), this.has_init = last_init);}} ]), User;}());47 行未改动}function cache_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, cache_toPropertyKey(o.key), o);}}function cache_createClass(e, r, t) {return r && cache_defineProperties(e.prototype, r), t && cache_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}17 行未改动return cache_createClass(CacheFactory, null, [ {key: "get",value: function get() {var name = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "default", cache = new Cache;return CacheFactory.map[name] instanceof Cache ? cache = CacheFactory.map[name] : CacheFactory.map[name] = cache,cache;}}, {key: "setValue",61 行未改动$("body").css("overflow", "hidden");}}, message = '<div class="message-bg"></div> <div id="message_box"> <div class="message-box-mark"></div> <div class="message-box-bg"> <span style="font-size:20px"><b>提示:</b></span> <div id="message_box_context" style="margin:2% 0">...</div><br/><br/> <div class="message-box-btn"> <button name="affirm">确定</button> <button name="cancel">取消</button> </div> </div> </div> <style>.message-bg{position:fixed;float:right;right:0;top:2%;z-index:30000}.message{margin-bottom:15px;padding:2% 2%;width:300px;display:flex;margin-top:-70px;opacity:0}.message-success{background-color:#dfd;border-left:6px solid #4caf50}.message-error{background-color:#fdd;border-left:6px solid #f44336}.message-info{background-color:#e7f3fe;border-left:6px solid #0c86de}.message-warning{background-color:#ffc;border-left:6px solid #ffeb3b}.message-context{font-size:21px;word-wrap:break-word;word-break:break-all}.message-context p{margin:0}#message_box{opacity:0;display:none;position:fixed;inset:0px;top:0;left:0;width:100%;height:100%;z-index:20000}.message-box-bg{position:absolute;background:#fff;border-radius:10px;padding:20px;top:50%;left:50%;transform:translate(-50%,-50%);width:500px;z-index:20001}.message-box-mark{width:100%;height:100%;position:fixed;top:0;left:0;background:rgba(0,0,0,.5);z-index:20000}.message-box-btn{text-align:right}.message-box-btn button{margin:0 5px;width:120px;height:40px;border-width:0;border-radius:3px;background:#1e90ff;cursor:pointer;outline:0;color:#fff;font-size:17px}.message-box-btn button:hover{background:#59f}</style> ';function messageBox(ctx, type) {"confirm" === type ? $('.message-box-btn button[name="cancel"]').show() : "alert" === type && $('.message-box-btn button[name="cancel"]').hide(),ctx.html ? $("#message_box_context").html('<div style="font-size:18px">'.concat(ctx.html, "</div>")) : $("#message_box_context").html('<div style="font-size:18px">╰( ̄▽ ̄)╮</div>'),scroll_scroll.hide(), $("#message_box").show(), $("#message_box").animate({opacity: "1"}, 300);var option = {affirm: function affirm() {$("#message_box").hide(), $("#message_box").css("opacity", 0), scroll_scroll.show(),ctx.callback && ctx.callback.affirm && ctx.callback.affirm();},cancel: function cancel() {$("#message_box").hide(), $("#message_box").css("opacity", 0), scroll_scroll.show(),ctx.callback && ctx.callback.cancel && ctx.callback.cancel();}};return $('.message-box-btn button[name="affirm"]')[0].onclick = option.affirm, $('.message-box-btn button[name="cancel"]')[0].onclick = option.cancel,option;}var id = 0;function message_message(html, type) {console.info("[Message] ".concat(type, " : ").concat(html)), function messageEnQueue(message, id) {$(".message-bg").append(message), $("#message_".concat(id)).animate({"margin-top": "+=70px",opacity: "1"}, 300);}('<div id="message_'.concat(id += 1, '" class="message message-').concat(type, '"><div class="message-context"><p><strong>').concat(type, ":</strong></p><p>").concat(html, "</p></div></div>"), id),function messageDeQueue(id) {var time = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 3;setTimeout(function() {var e = "div#message_".concat(id);34 行未改动};function ajax(obj) {return new Promise(function(resolve, reject) {obj.success = function(res) {res && res.code && message_Message_warning("".concat(res.message || "CODE:".concat(res.code))),resolve(res);}, obj.error = function(err) {message_Message_error("网络异常"), reject(err);}, $.ajax(obj);179 行未改动全部展开}function video_base_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, video_base_toPropertyKey(o.key), o);}}function video_base_createClass(e, r, t) {return r && video_base_defineProperties(e.prototype, r), t && video_base_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}11 行未改动return "symbol" == video_base_typeof(i) ? i : i + "";}var clazzMap = {}, VideoBase = function() {function VideoBase(video_type, main_title, state) {video_base_classCallCheck(this, VideoBase), this.constructor.name in clazzMap || (clazzMap[this.constructor.name] = this.constructor),this.video_type = video_type || "video", this.main_title = main_title || "", this.state = state,this.page = state && parseInt(state.p) || 1;}return video_base_createClass(VideoBase, [ {key: "getVideo",97 行未改动_inherits(Video, _VideoBase);var _super = _createSuper(Video);function Video(main_title, state) {var _state$sectionsInfo, _this2;video_base_classCallCheck(this, Video), (_this2 = _super.call(this, "video", main_title, state)).video_list = [],_this2.epList = [];var sections = state.sections || (null === (_state$sectionsInfo = state.sectionsInfo) || void 0 === _state$sectionsInfo ? void 0 : _state$sectionsInfo.sections) || [];if (!sections.length) return _possibleConstructorReturn(_this2);var _step, _iterator = _createForOfIteratorHelper(sections);3 行未改动try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {for (var video = _step2.value, i = 0, length = video.pages && video.pages.length || 0; i < length; ) {var _video = Object.assign({}, video);_video.title = video.title + (length > 1 ? " P".concat(i + 1, " ").concat(video.pages[i].part) : ""),_video.cid = video.pages[i].cid || 0, _this2.video_list.push(_video), i++;}_this2.epList.push(video);}57 行未改动var _step3, video_list = [], _iterator3 = _createForOfIteratorHelper(state.resourceList || []);try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) for (var video = _step3.value, i = 0, length = video.pages && video.pages.length || 0; i < length; ) {var _video = Object.assign({}, video);_video.title = video.title + (length > 1 ? " P".concat(i + 1, " ").concat(video.pages[i].title) : ""),_video.cid = video.pages[i].cid || 0, video_list.push(_video), i++;}} catch (err) {_iterator3.e(err);44 行未改动_inherits(VideoFestival, _VideoBase3);var _super3 = _createSuper(VideoFestival);function VideoFestival(main_title, state) {var _this4;return video_base_classCallCheck(this, VideoFestival), (_this4 = _super3.call(this, "video", main_title, state)).video_info = state.videoInfo,_this4.video_list = state.sectionEpisodes || [], _this4;}return video_base_createClass(VideoFestival, [ {key: "total",35 行未改动_inherits(Bangumi, _VideoBase4);var _super4 = _createSuper(Bangumi);function Bangumi(main_title, state) {var _this5;return video_base_classCallCheck(this, Bangumi), (_this5 = _super4.call(this, "bangumi", main_title, state)).epInfo = state.epInfo,_this5.epList = state.epList, _this5.epId = state.epId, _this5.epMap = state.epMap,_this5.isEpMap = state.isEpMap, _this5;}return video_base_createClass(Bangumi, [ {key: "total",7 行未改动}}, {key: "getEpPadLen",value: function getEpPadLen() {for (var n = Object.keys(this.isEpMap).length, len = n < 10 ? 1 : 0; n >= 1; ) n /= 10,len++;return len;}}, {55 行未改动var bangumiCache = cache.get("Bangumi");if (location.href == bangumiCache.get("href") && bangumiCache.get("build")) return bangumiCache.get("build");bangumiCache.set("build", null);var main_title, sid, epid, epMap = {}, pathname = location.pathname.toLowerCase();pathname.startsWith("/bangumi/play/ss") ? (sid = pathname.match(/ss(\d+)/), sid = parseInt(sid[1])) : pathname.startsWith("/bangumi/play/ep") && (epid = pathname.match(/ep(\d+)/),epid = parseInt(epid[1]));try {console.log("location sid:", sid, "epid:", epid);var page_data = JSON.parse($(".toolbar").attr("mr-show"));main_title = page_data.msg.title, sid = sid || page_data.msg.season_id, epid = epid || page_data.msg.ep_id,console.log("mr-show get sid:", sid, "epid:", epid);} catch (_unused) {console.warn("mr-show get err");}if (sid != bangumiCache.get("sid") && (bangumiCache.set("sid", sid), bangumiCache.set("epid", ""),bangumiCache.set("hasData", !1)), sid && !epid && _ajax({type: "GET",url: "https://api.bilibili.com/pgc/player/web/v2/playurl?support_multi_audio=true&qn=80&fnver=0&fnval=4048&fourk=1&gaia_source=&from_client=BROWSER&is_main_page=true&need_fragment=true&season_id=".concat(sid, "&isGaiaAvoided=false&voice_balance=1&drm_tech_type=2"),dataType: "json",8 行未改动url: "https://api.bilibili.com/pgc/view/web/ep/list?season_id=".concat(sid = sid || "", "&ep_id=").concat(epid),dataType: "json",cache: !0}).then(function(res) {res && !res.code && (bangumiCache.set("hasData", !0), bangumiCache.set("episodes", res.result.episodes || []),bangumiCache.set("section", res.result.section || []));}).finally(function() {bangumiCache.set("lock", !1);}), bangumiCache.set("href", location.href), !epid && !bangumiCache.get("epid")) throw "epid not found !";36 行未改动} finally {_iterator5.f();}epid = epid || bangumiCache.get("epid");for (var _id = 0, i = 0; i < episodes.length; i++) epMap[episodes[i].id] = episodes[i],episodes[i].id == epid && (_id = i);var bangumi = new Bangumi(main_title, {p: _id + 1,epId: epid,9 行未改动_inherits(Cheese, _VideoBase5);var _super5 = _createSuper(Cheese);function Cheese(main_title, state) {var _this6;return video_base_classCallCheck(this, Cheese), (_this6 = _super5.call(this, "cheese", main_title, state)).episodes = state.episodes,_this6;}return video_base_createClass(Cheese, [ {key: "total",28 行未改动} ], [ {key: "build",value: function build() {var epid, cheeseCache = cache.get("Cheese"), sid = (location.href.match(/\/cheese\/play\/ss(\d+)/i) || [ "", "" ])[1];if (sid || (epid = (location.href.match(/\/cheese\/play\/ep(\d+)/i) || [ "", "" ])[1]),epid || (epid = parseInt($(".bpx-state-active").eq(0).attr("data-episodeid"))),sid && sid != cheeseCache.get("sid") && (cheeseCache.set("sid", sid), cheeseCache.set("episodes", null)),!cheeseCache.get("episodes")) {if (cheeseCache.get("lock")) throw "cheese request waiting !";if (cheeseCache.set("lock", !0), !sid && !epid) return void console.log("get_season error");_ajax({77 行未改动} else {var keys = Object.keys(videoQualityMap), _q2 = parseInt(("video" === _type ? $("li.bpx-player-ctrl-quality-menu-item.bpx-state-active") : $("li.squirtle-select-item.active")).attr("data-value")), _q_max2 = parseInt($(("video" === _type ? $("li.bpx-player-ctrl-quality-menu-item") : $("li.squirtle-select-item")).get(0)).attr("data-value"));_q = keys.indexOf("".concat(_q2)) > -1 ? _q2 : 0, _q_max = keys.indexOf("".concat(_q_max2)) > -1 ? _q_max2 : 0;}return _q || (_q = parseInt($("li.bpx-player-ctrl-quality-menu-item.bpx-state-active").attr("data-value") || _q)),_q_max || (_q_max = parseInt($("li.bpx-player-ctrl-quality-menu-item").attr("data-value") || _q_max)),!_q_max && (_q_max = 80) && console.error("video get quality max error"), !_q && (_q = _q_max < 80 ? _q_max : 80),user.isVIP() || (_q = _q > 80 ? 80 : _q), {q: _q,q_max: _q_max};4 行未改动var k = $(this).text();q_map[k] && quality_list.push(q_map[k]);}); else {var keys = Object.keys(videoQualityMap);(list = [ "video", "list" ].includes(_type) ? $("li.bpx-player-ctrl-quality-menu-item") : $("li.squirtle-select-item"))[0] || (list = $("li.bpx-player-ctrl-quality-menu-item")),list && list.length && list.each(function() {var q = "".concat(parseInt($(this).attr("data-value")));keys.indexOf(q) > -1 && quality_list.push(q);});10 行未改动}function store_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, store_toPropertyKey(o.key), o);}}function store_toPropertyKey(t) {15 行未改动if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, Store), this.prefix = "bp_";}return function store_createClass(e, r, t) {return r && store_defineProperties(e.prototype, r), t && store_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(Store, [ {120 行未改动全部展开return r(_t, o);} finally {e.next = n.n;}}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v,e.next = n.n;try {return r.call(this, e);} finally {99 行未改动};function d(r, n) {for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {var o, i = p[t], d = G.p, l = i[2];r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n,G.n = l, c = 0));}if (o || r > 1) return a;throw y = !0, n;7 行未改动if (c || (o = "next"), t = i[o]) {if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");if (!t.done) return t;u = t.value, c < 2 && (c = 0);} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"),c = 1);i = e;} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;} catch (t) {17 行未改动var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function() {return this;}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);function f(e) {return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u),e;}return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction),GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"),_regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function() {return this;}), _regeneratorDefine2(u, "toString", function() {return "[object Generator]";51 行未改动"auto" === request_type && user.needReplace() && (request_type = "remote");var base_api, url_replace_cdn = function url_replace_cdn(url) {if ("0" === config_config.host_key) return url;var url_tmp = url.split("/"), mapping = hostMap[config_config.host_key];return "string" == typeof mapping && mapping.length ? mapping.at(0).match(/[a-z]/) && (url_tmp[2] = mapping) : "function" == typeof mapping && (url_tmp[2] = mapping()),url = url_tmp.join("/");}, ajax_obj = {type: "GET",dataType: "json"};if ("auto" === request_type || "local" === request_type) {var fnver, fnval;"cheese" === type ? (base_api = "https://api.bilibili.com/pugv/player/web/playurl",fnver = "mp4" === format ? 1 : 0, fnval = 80) : (base_api = "video" === type ? "https://api.bilibili.com/x/player/playurl" : "https://api.bilibili.com/pgc/player/web/playurl",fnver = 0, fnval = {dash: 4048,flv: 4049,mp4: 0}[format] || 0), base_api += "?avid=".concat(aid, "&bvid=").concat(bvid, "&cid=").concat(cid, "&qn=").concat(q, "&fnver=").concat(fnver, "&fnval=").concat(fnval, "&fourk=1&ep_id=").concat(epid, "&type=").concat(format, "&otype=json"),base_api += "mp4" === format ? "&platform=html5&high_quality=1" : "", ajax_obj.xhrFields = {withCredentials: !0};} else {base_api = config_config.base_api, base_api += "?av=".concat(aid, "&bv=").concat(bvid, "&cid=").concat(cid, "&ep=").concat(epid, "&q=").concat(q, "&type=").concat(type, "&format=").concat(format, "&otype=json"),page && (base_api += "&s");var _ref2 = [ store.get("auth_id"), store.get("auth_sec") ], auth_id = _ref2[0], auth_sec = _ref2[1];auth_id && auth_sec && (base_api += "&auth_id=".concat(auth_id, "&auth_sec=").concat(auth_sec));}13 行未改动}) : Promise.resolve(key);};new Promise(function(resolve, reject) {var promiseList = [], valueList = [];data.url ? promiseList.push(checkTask("url", "backup_url")) : (promiseList.push(checkTask("video", "backup_video")),promiseList.push(checkTask("audio", "backup_audio")));var timer = setTimeout(function() {resolve(valueList);}, 1500), index = 0;26 行未改动case 6:_context.prev = 6, _context.t0 = _context.catch(0), result = _context.t0;case 9:console.log("use " + result), valueList[index++] = result, index == promiseList.length && (clearInterval(timer),resolve(valueList));case 12:case "end":24 行未改动});};ajax_obj.url = base_api, ajax(ajax_obj).then(function(res) {var data;if (res.code || (data = res.result || res.data), !data) return "auto" === request_type ? void get_url_base(page, quality, video_format, success, error, "remote") : (res.url && (res.url = url_replace_cdn(res.url)),res.video && (res.video = url_replace_cdn(res.video)), res.audio && (res.audio = url_replace_cdn(res.audio)),void resultConvertor(res, _success));if (data.dash) {for (var result = {code: 0,3 行未改动audio: ""}, videos = data.dash.video, i = 0; i < videos.length; i++) {var _video = videos[i];if (_video.id <= q) {result.video = url_replace_cdn(_video.base_url), result.audio = url_replace_cdn(data.dash.audio[0].base_url),result.backup_video = _video.backup_url && url_replace_cdn(_video.backup_url[0]),result.backup_audio = data.dash.audio[0].backup_url && url_replace_cdn(data.dash.audio[0].backup_url[0]);break;}}102 行未改动全部展开return r(_t, o);} finally {e.next = n.n;}}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v,e.next = n.n;try {return r.call(this, e);} finally {70 行未改动f(t);}}var r;this.next || (runtime_lib_regeneratorDefine2(runtime_lib_regeneratorAsyncIterator.prototype),runtime_lib_regeneratorDefine2(runtime_lib_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {return this;})), runtime_lib_regeneratorDefine2(this, "_invoke", function(t, o, i) {function f() {21 行未改动};function d(r, n) {for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {var o, i = p[t], d = G.p, l = i[2];r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n,G.n = l, c = 0));}if (o || r > 1) return a;throw y = !0, n;7 行未改动if (c || (o = "next"), t = i[o]) {if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");if (!t.done) return t;u = t.value, c < 2 && (c = 0);} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"),c = 1);i = e;} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;} catch (t) {17 行未改动var c = [][n] ? t(t([][n]())) : (runtime_lib_regeneratorDefine2(t = {}, n, function() {return this;}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);function f(e) {return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,runtime_lib_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u),e;}return GeneratorFunction.prototype = GeneratorFunctionPrototype, runtime_lib_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype),runtime_lib_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction),GeneratorFunction.displayName = "GeneratorFunction", runtime_lib_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"),runtime_lib_regeneratorDefine2(u), runtime_lib_regeneratorDefine2(u, o, "Generator"),runtime_lib_regeneratorDefine2(u, n, function() {return this;}), runtime_lib_regeneratorDefine2(u, "toString", function() {return "[object Generator]";53 行未改动}function runtime_lib_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, runtime_lib_toPropertyKey(o.key), o);}}function runtime_lib_toPropertyKey(t) {15 行未改动if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, RuntimeLib), this.config = config, this.moduleAsync, this.anyResolved = !1;}return function runtime_lib_createClass(e, r, t) {return r && runtime_lib_defineProperties(e.prototype, r), t && runtime_lib_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(RuntimeLib, [ {key: "getModulePromise",value: function getModulePromise() {var _this = this, _this$config = this.config, urls = _this$config.urls, errs = (_this$config.getModule,[]);return urls && urls.length ? new Promise(function(resolve, reject) {var i = 0;urls.forEach(function(url) {8 行未改动}return _context.abrupt("return");case 3:return console.log("[Runtime Library] Start download from ".concat(url)), _context.next = 6,_ajax({url: url,type: "GET",dataType: "text",7 行未改动}return _context.abrupt("return");case 9:console.log("[Runtime Library] Downloaded from ".concat(url, " , length = ").concat(code.length)),_this.anyResolved = !0, resolve(code), _context.next = 20;break;case 14:78 行未改动case 6:_context2.t1 = _context2.sent, _context2.t2 = [ _context2.t1 ], _context2.t3 = {type: "text/javascript"}, blob = new _context2.t0(_context2.t2, _context2.t3), blob_url = URL.createObjectURL(blob),(script_tag = document.createElement("script")).src = blob_url, script_tag.onload = function() {console.log("[Runtime Library] Loaded ".concat(name, " from local")), getModule(window),URL.revokeObjectURL(blob_url);}, script_tag.onerror = function() {console.error("[Runtime Library] Failed to load ".concat(name, " from local")),URL.revokeObjectURL(blob_url);}, runtime_div.appendChild(script_tag);case 16:18 行未改动}function recover_player() {if (window.bp_dplayer) {var bili_video = $(bili_video_tag())[0];bili_video && bili_video.removeEventListener("play", bili_video_stop, !1), window.bp_dplayer.destroy(),window.bp_dplayer = null, $("#bp_dplayer").remove(), window.bp_dplayer_2 && (window.bp_dplayer_2.destroy(),window.bp_dplayer_2 = null, $("#bp_dplayer_2").remove()), $(get_bili_player_id()).show();}}function danmaku_config() {24 行未改动recover_player();var bili_video = $(bili_video_tag())[0];bili_video_stop(), bili_video && bili_video.addEventListener("play", bili_video_stop, !1);var bili_player_id = get_bili_player_id();$("#bilibiliPlayer")[0] ? ($(bili_player_id).before('<div id="bp_dplayer" class="bilibili-player relative bilibili-player-no-cursor">'),$(bili_player_id).hide()) : $("#bilibili-player")[0] ? ($(bili_player_id).before('<div id="bp_dplayer" class="bilibili-player relative bilibili-player-no-cursor" style="width:100%;height:100%;z-index:1000;"></div>'),$(bili_player_id).hide()) : $("#edu-player")[0] ? ($(bili_player_id).before('<div id="bp_dplayer" style="width:100%;height:100%;z-index:1000;"></div>'),$(bili_player_id).hide()) : MessageBox_alert('<div id="bp_dplayer" style="width:100%;height:100%;"></div>', function() {recover_player();}), api.get_subtitle_url(0, function dplayer_init() {var subtitle_url = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "";75 行未改动!bp_dplayer.paused && bp_dplayer_2.play();}), bp_dplayer.on("playing", function() {!bp_dplayer.paused && bp_dplayer_2.play();}), bp_dplayer.on("timeupdate", function() {Math.abs(bp_dplayer.video.currentTime - bp_dplayer_2.video.currentTime) > 1 && (bp_dplayer_2.pause(),bp_dplayer_2.seek(bp_dplayer.video.currentTime)), !bp_dplayer.paused && bp_dplayer_2.play();}), bp_dplayer.on("seeking", function() {bp_dplayer_2.pause(), bp_dplayer_2.seek(bp_dplayer.video.currentTime);}), bp_dplayer.on("waiting", function() {21 行未改动}function check_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, check_toPropertyKey(o.key), o);}}function check_toPropertyKey(t) {12 行未改动var check = new (function() {function Check() {!function check_classCallCheck(a, n) {if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, Check), this.href = "", this.aid = "", this.cid = "", this.q = "", this.epid = "",this.locked = !1;}return function check_createClass(e, r, t) {return r && check_defineProperties(e.prototype, r), t && check_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(Check, [ {key: "refresh",value: function refresh() {if (!this.locked) {this.locked = !0, console.log("refresh..."), $("#video_download").hide(), $("#video_download_2").hide(),player.recover_player();try {this.href = location.href;var vb = video.base();51 行未改动return r(_t, o);} finally {e.next = n.n;}}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v,e.next = n.n;try {return r.call(this, e);} finally {70 行未改动f(t);}}var r;this.next || (common_regeneratorDefine2(common_regeneratorAsyncIterator.prototype),common_regeneratorDefine2(common_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {return this;})), common_regeneratorDefine2(this, "_invoke", function(t, o, i) {function f() {21 行未改动};function d(r, n) {for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {var o, i = p[t], d = G.p, l = i[2];r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n,G.n = l, c = 0));}if (o || r > 1) return a;throw y = !0, n;7 行未改动if (c || (o = "next"), t = i[o]) {if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");if (!t.done) return t;u = t.value, c < 2 && (c = 0);} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"),c = 1);i = e;} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;} catch (t) {17 行未改动var c = [][n] ? t(t([][n]())) : (common_regeneratorDefine2(t = {}, n, function() {return this;}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);function f(e) {return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,common_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u),e;}return GeneratorFunction.prototype = GeneratorFunctionPrototype, common_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype),common_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction),GeneratorFunction.displayName = "GeneratorFunction", common_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"),common_regeneratorDefine2(u), common_regeneratorDefine2(u, o, "Generator"), common_regeneratorDefine2(u, n, function() {return this;}), common_regeneratorDefine2(u, "toString", function() {return "[object Generator]";145 行未改动全部展开if ((response = _context.sent).ok) {_context.next = 8;break;}throw errorMsg = "toBlobURL: Failed to fetch ".concat(url, ": ").concat(response.status, " ").concat(response.statusText),console.error(errorMsg), new Error(errorMsg);case 8:return _context.next = 10, response.arrayBuffer();case 10:return buffer = _context.sent, blob = new Blob([ buffer ], {type: mimeType}), blobUrl = URL.createObjectURL(blob), console.log("toBlobURL: Created Blob URL for ".concat(url)),_context.abrupt("return", blobUrl);case 15:case "end":3 行未改动}))).apply(this, arguments);}function downloadBlobURL(blobUrl, downloadname) {var a = document.createElement("a");a.href = blobUrl, a.download = downloadname, a.style.display = "none", document.body.appendChild(a),a.click(), document.body.removeChild(a), setTimeout(function() {return URL.revokeObjectURL(blobUrl);}, 100);}20 行未改动}throw new Error("URL下载失败: " + url);case 6:contentLength = res.headers.get("content-length"), total = contentLength ? parseInt(contentLength, 10) : 0,reader = res.body.getReader(), loaded = 0, chunks = [];case 11:return _context3.next = 14, reader.read();case 14:if (_yield$reader$read = _context3.sent, done = _yield$reader$read.done, (value = _yield$reader$read.value) && (chunks.push(value),loaded += value.length, onProgress && onProgress(loaded, total)), !done) {_context3.next = 20;break;}3 行未改动_context3.next = 11;break;case 22:for (dataArray = new Uint8Array(loaded), pos = 0, _i = 0, _chunks = chunks; _i < _chunks.length; _i++) chunk = _chunks[_i],dataArray.set(chunk, pos), pos += chunk.length;return _context3.abrupt("return", dataArray);case 26:5 行未改动}function prettyBytes(bytes) {var decimalPlaces = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2;if (0 === bytes) return "0 B";for (var units = [ "B", "KB", "MB", "GB", "TB" ], size = bytes, unitIndex = 0; size >= 1024 && unitIndex < units.length - 1; ) size /= 1024,unitIndex++;var formatted = size.toFixed(decimalPlaces);return "".concat(formatted, " ").concat(units[unitIndex]);}88 行未改动return r(_t, o);} finally {e.next = n.n;}}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v,e.next = n.n;try {return r.call(this, e);} finally {70 行未改动f(t);}}var r;this.next || (ffmpeg_regeneratorDefine2(ffmpeg_regeneratorAsyncIterator.prototype),ffmpeg_regeneratorDefine2(ffmpeg_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {return this;})), ffmpeg_regeneratorDefine2(this, "_invoke", function(t, o, i) {function f() {21 行未改动};function d(r, n) {for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {var o, i = p[t], d = G.p, l = i[2];r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0,G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n,G.n = l, c = 0));}if (o || r > 1) return a;throw y = !0, n;7 行未改动if (c || (o = "next"), t = i[o]) {if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");if (!t.done) return t;u = t.value, c < 2 && (c = 0);} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"),c = 1);i = e;} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;} catch (t) {17 行未改动var c = [][n] ? t(t([][n]())) : (ffmpeg_regeneratorDefine2(t = {}, n, function() {return this;}), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);function f(e) {return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,ffmpeg_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u),e;}return GeneratorFunction.prototype = GeneratorFunctionPrototype, ffmpeg_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype),ffmpeg_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction),GeneratorFunction.displayName = "GeneratorFunction", ffmpeg_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"),ffmpeg_regeneratorDefine2(u), ffmpeg_regeneratorDefine2(u, o, "Generator"), ffmpeg_regeneratorDefine2(u, n, function() {return this;}), ffmpeg_regeneratorDefine2(u, "toString", function() {return "[object Generator]";80 行未改动var baseFFmpegUrl, baseCoreUrl, baseCoreMTUrl;return ffmpeg_regeneratorRuntime().wrap(function _callee$(_context) {for (;;) switch (_context.prev = _context.next) {case 0:if (baseFFmpegUrl = "https://unpkg.com/@ffmpeg/ffmpeg@0.12.15/dist/umd", baseCoreUrl = "https://unpkg.com/@ffmpeg/core@0.12.10/dist/umd",baseCoreMTUrl = "https://unpkg.com/@ffmpeg/core-mt@0.12.10/dist/umd", ffmpeg.on("log", function(_ref3) {var message = _ref3.message;console.log("[ffmpeg]", message);}), !window.crossOriginIsolated) {_context.next = 25;break;}return console.log("[ffmpeg] 多线程模式"), _context.t0 = ffmpeg, _context.next = 10,toBlobURL("".concat(baseCoreMTUrl, "/ffmpeg-core.js"), "text/javascript");case 10:return _context.t1 = _context.sent, _context.next = 13, toBlobURL("".concat(baseCoreMTUrl, "/ffmpeg-core.wasm"), "application/wasm");16 行未改动_context.next = 39;break;case 25:return console.log("[ffmpeg] 单线程模式"), _context.t6 = ffmpeg, _context.next = 29,toBlobURL("".concat(baseCoreUrl, "/ffmpeg-core.js"), "text/javascript");case 29:return _context.t7 = _context.sent, _context.next = 32, toBlobURL("".concat(baseCoreUrl, "/ffmpeg-core.wasm"), "application/wasm");39 行未改动signal: controller.signal}) ]);case 20:return _yield$Promise$all = _context2.sent, _yield$Promise$all2 = ffmpeg_slicedToArray(_yield$Promise$all, 2),videoData = _yield$Promise$all2[0], audioData = _yield$Promise$all2[1], _context2.next = 26,ffmpeg.writeFile("video.m4s", videoData);case 26:return _context2.next = 28, ffmpeg.writeFile("audio.m4s", audioData);13 行未改动type: "video/mp4"})));case 38:return _context2.prev = 38, _context2.t0 = _context2.catch(11), controller && controller.signal && !controller.signal.aborted && (controller.abort(),message_Message_error("任务被迫中止")), console.error("Error merging streams:", _context2.t0),_context2.abrupt("return", Promise.reject(_context2.t0));case 43:case "end":90 行未改动var i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, videos = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [];if (video_tasks.length) {if (i >= video_tasks.length) {var type = rpc_type();return videos.length > 0 && (download_videos_rpc(videos, type), videos.length = 0),void MessageBox_alert("批量下载执行结束!");}var task = video_tasks[i], msg = "第".concat(i + 1, "(").concat(i + 1, "/").concat(video_tasks.length, ")个视频");MessageBox_alert("".concat(msg, ":获取中..."));api.get_urls(task.p, task.q, task.format, function success(res) {if (setTimeout(function() {download_videos(video_tasks, i + 1, videos);}, 4e3), !res.code) {message_Message_success("请求成功" + (res.times ? "<br/>今日剩余请求次数".concat(res.times) : "")),MessageBox_alert("".concat(msg, ":获取成功!"));var _ref3 = [ res.url, rpc_type(), res.video, res.audio ], url = _ref3[0], type = _ref3[1], video_url = _ref3[2], audio_url = _ref3[3];"dash" === task.format ? (task.dl_video && videos.push({url: video_url,6 行未改动})) : videos.push({url: url,filename: task.filename + format(url),rpc_dir: task.rpc_dir}), "post" === type ? videos.length > 3 && (download_videos_rpc(videos, type), videos.length = 0) : "ariang" === type && (download_videos_rpc(videos, type),videos.length = 0);}}, function error() {download_videos(video_tasks, i + 1, videos);43 行未改动}(), message_Message_success("已连接到 Motrix,任务已发送"));});}, 500);}if ("1" === config_config.show_motrix_confirm_open_auto) return window.open("motrix://"),void startPolling();MessageBox_confirm("未检测到运行的 Motrix,是否启动?", function() {window.open("motrix://"), startPolling();}, function() {68 行未改动bp_aria2_window && !bp_aria2_window.closed || (open_ariang(), time = 3e3), setTimeout(function() {var bp_aria2_window = window.bp_aria2_window, cmd = [ "url=".concat(encodeURIComponent(window.btoa(video.url))), "out=".concat(encodeURIComponent(video.filename)), "header=User-Agent:".concat(window.navigator.userAgent), "header=Referer:".concat(window.location.origin) ];(video.rpc_dir || config_config.ariang_dir) && cmd.push("dir=".concat(encodeURIComponent(video.rpc_dir || config_config.ariang_dir)));var task_hash = "#!/new/task?" + cmd.join("&");bp_aria2_window && !bp_aria2_window.closed ? (bp_aria2_window.location.href = config_config.ariang_host + task_hash,message_Message_success("发送RPC请求")) : message_Message_warning("AriaNg页面未打开");}, time);}(videos.pop()), setTimeout(function() {download_rpc_ariang.apply(void 0, videos);144 行未改动全部展开}var _document$head$innerH, Download = {url_format: format,download: function download(url, filename, type) {filename = filename.replace(/[\/\\*|]+/g, "-").replace(/:/g, ":").replace(/\?/g, "?").replace(/"/g, "'").replace(/</g, "《").replace(/>/g, "》"),"blob" === type ? download_blob(url, filename) : "rpc" === type ? function download_rpc(url, filename, rpc_dir) {var type = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "post";if ("post" === type) {if ("0" === config_config.show_motrix_confirm) return void download_rpc_post({54 行未改动mergedBlob && 0 !== mergedBlob.size ? (show_merge_progress({isFinished: !0}), downloadBlob(mergedBlob, filename)) : message_Message_error("合并视频失败");}).catch(function(error) {console.error(error), "AbortError" !== error.name ? (controller.signal.aborted || controller.abort(),message_Message_error("合并下载失败")) : message_Message_warning("已取消下载");}).finally(function() {download_blob_merge_clicked = !1;});3 行未改动$("body").on("click", 'input[name="option_video"]', function(event) {function get_option_index(element) {return element && parseInt(element.id.split("_")[1]) || 0;}if ($(this).is(":checked") ? $(this).parent().css("color", "rgba(0,0,0,1)") : $(this).parent().css("color", "rgba(0,0,0,0.5)"),event.ctrlKey || event.altKey) {var current_select_option_index = get_option_index(event.target), option_videos = download_toConsumableArray(document.getElementsByName("option_video"));if (event.target.checked) for (var i = get_option_index(option_videos.filter(function(e) {return e.checked && get_option_index(e) < current_select_option_index;}).slice(-1)[0]); i < current_select_option_index; i++) option_videos[i].checked = !0,option_videos[i].parentNode.style.color = "rgba(0,0,0,1)"; else for (var _i = get_option_index(option_videos.filter(function(e) {return !e.checked && get_option_index(e) < current_select_option_index;}).slice(-1)[0]); _i < current_select_option_index; _i++) option_videos[_i].checked = !1,option_videos[_i].parentNode.style.color = "rgba(0,0,0,0.5)";}});for (var video_html = "", i = 0; i < total; i++) video_html += "" + '<label for="option_'.concat(i, '"><div style="color:rgba(0,0,0,0.5);">\n <input type="checkbox" id="option_').concat(i, '" name="option_video" value="').concat(i, '">\n P').concat(i + 1, " ").concat(vb.title(i + 1), "\n </div></label><hr>");var all_checked = !1;$("body").on("click", "button#checkbox_btn", function() {all_checked ? (all_checked = !1, $('input[name="option_video"]').prop("checked", all_checked),$('input[name="option_video"]').parent().css("color", "rgba(0,0,0,0.5)")) : (all_checked = !0,$('input[name="option_video"]').prop("checked", all_checked), $('input[name="option_video"]').parent().css("color", "rgb(0,0,0)"));});var _step, option_support_html = "", _iterator = download_createForOfIteratorHelper(video.get_quality_support());try {22 行未改动});}(dl_video || dl_audio) && ("post" === rpc_type() && "0" !== config_config.show_motrix_confirm ? checkMotrixRunningBeforeExecute(function() {download_videos([].concat(video_tasks));}) : download_videos([].concat(video_tasks))), dl_subtitle && (1 === video_tasks.length ? download_subtitle_vtt(video_tasks[0].p, video_tasks[0].filename) : download_subtitle_vtt_zip([].concat(video_tasks), new JSZip)),dl_danmaku && (1 === video_tasks.length ? download_danmaku_ass(video_tasks[0].cid, video_tasks[0].filename) : download_danmaku_ass_zip([].concat(video_tasks), new JSZip));}), $("#dl_format").val(config_config.format), $("#dl_quality").val(q);var dl_format_change_evt = function dl_format_change_evt(format) {"dash" === format ? ($("#dl_audio").prop("checked", !0).parent().css("color", "rgba(0,0,0,1)"),$("#dl_audio").prop("disabled", !1)) : ($("#dl_audio").prop("checked", !1).parent().css("color", "rgba(0,0,0,0.5)"),$("#dl_audio").prop("disabled", !0));};if (dl_format_change_evt(config_config.format), $("body").on("change", "#dl_format", function() {var format = $(this).val();4 行未改动var _$$, h = null === (_$$ = $("#playlist-video-action-list")[0]) || void 0 === _$$ ? void 0 : _$$.scrollHeight;if (!h) return;var timer1 = null, timer2 = null, old_h = h, change_count = 0, not_change_count = 0, load_down = !0;timer1 = setInterval(function() {load_down ? $("#playlist-video-action-list").scrollTop($("#playlist-video-action-list")[0].scrollHeight) : $("#playlist-video-action-list").scrollTop(0),load_down = !load_down, not_change_count > 12 && clearInterval(timer1);}, 1500), timer2 = setInterval(function() {(h = $("#playlist-video-action-list")[0].scrollHeight) > old_h ? (!change_count && MessageBox_confirm("正在加载视频列表,请稍后...", null, function() {clearInterval(timer1), clearInterval(timer2);}), change_count++, not_change_count = 0) : not_change_count++, old_h = h, not_change_count > 12 && (clearInterval(timer1),clearInterval(timer2), change_count > 0 && (message_Message_info("视频列表加载结束"), download_all()));}, 500);}},131 行未改动全部展开$("#video_download").hide(), $("#video_download_2").hide();break;}}config_config.host_key !== old_config.host_key && (check.refresh(), $("#video_url").attr("href", "#"),$("#video_url_2").attr("href", "#")), config_config.rpc_domain !== old_config.rpc_domain && (config_config.rpc_domain.match("https://") || config_config.rpc_domain.match(/(localhost|127\.0\.0\.1)/) || MessageBox_alert("检测到当前RPC不是localhost本地接口,即将跳转到AriaNg网页控制台页面;请查看控制台RPC接口参数是否正确,第一次加载可能较慢请耐心等待;配置好后即可使用脚本进行远程下载,使用期间不用关闭AriaNg页面!", function() {Download.open_ariang({domain: config_config.rpc_domain,port: config_config.rpc_port,43 行未改动port: config_config.rpc_port,path: config_config.rpc_path,token: config_config.rpc_token}, ariang_window = window.bp_aria2_window;if (ariang_window && !ariang_window.closed) return ariang_window.location.href = config_config.ariang_host + Download.get_ariang_set_hash(rpc),void message_Message_info("已同步配置");Download.open_ariang(rpc);}};42 行未改动}function auth_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, auth_toPropertyKey(o.key), o);}}function auth_toPropertyKey(t) {12 行未改动var api_url, api_url_temp, Auth = function() {function Auth() {!function auth_classCallCheck(a, n) {if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, Auth), this.auth_clicked = !1, this.auth_window = null, this.TV_KEY = "4409e2ce8ffd12b8",this.TV_SEC = "59b43e04ad6965f34319062b478f83dd";}return function auth_createClass(e, r, t) {return r && auth_defineProperties(e.prototype, r), t && auth_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(Auth, [ {75 行未改动local_id: "0",ts: Date.now().toString()}, _this3.TV_SEC)}).then(function(res) {!res.code && res.data ? (console.log("login success"), is_login = 1, _this3.doAuth(res.data),box.affirm()) : 86038 === res.code && box.affirm();});}, 3e3);}7 行未改动if (res && !res.code) {var _res$data2 = res.data, url = _res$data2.url, auth_code = _res$data2.auth_code;_this4.auth_window = window.open(url);var is_login = 0, timer = setInterval(function() {if (!_this4.auth_window || _this4.auth_window.closed) return clearInterval(timer),_this4.auth_clicked = !1, void (is_login || message_Message_info("登陆失败!"));_ajax({url: "https://passport.bilibili.com/x/passport-tv-login/qrcode/poll",type: "POST",4 行未改动local_id: "0",ts: Date.now().toString()}, _this4.TV_SEC)}).then(function(res) {!res.code && res.data ? (console.log("login success"), _this4.doAuth(res.data),is_login = 1, _this4.auth_window.close()) : 86038 === res.code && _this4.auth_window.close();}).catch(function() {return _this4.auth_window.close();});11 行未改动url: "".concat(config_config.base_api).concat(config_config.base_api.endsWith("/") ? "" : "/", "auth/?act=logout&auth_id=").concat(auth_id, "&auth_sec=").concat(auth_sec),type: "GET",dataType: "json"}).then(function(res) {res.code ? message_Message_warning("注销失败") : (message_Message_success("注销成功"), store.set("auth_id", ""),store.set("auth_sec", ""), store.set("auth_time", "0"), store.set("access_key", ""),$("#auth").val("0"));}).finally(function() {return _this5.auth_clicked = !1;});2 行未改动}, {key: "doAuth",value: function doAuth(param) {var _this6 = this;this.auth_window && !this.auth_window.closed && (this.auth_window.close(), this.auth_window = null),ajax({url: "".concat(config_config.base_api).concat(config_config.base_api.endsWith("/") ? "" : "/", "auth/?act=login&").concat(Object.entries({auth_id: store.get("auth_id"),auth_sec: store.get("auth_sec")3 行未改动type: "POST",contentType: "application/json",data: JSON.stringify(auth_objectSpread({}, param))}).then(function(res) {res.code ? message_Message_warning("授权失败") : (message_Message_success("授权成功"), res.auth_id && res.auth_sec && (store.set("auth_id", res.auth_id),store.set("auth_sec", res.auth_sec)), store.set("access_key", param.access_token),store.set("auth_time", Date.now()), $("#auth").val("1"));}).finally(function() {return _this6.auth_clicked = !1;});50 行未改动user.lazyInit(!0);var vb = video.base(), _ref = [ vb.type(), vb.aid(), vb.p(), vb.cid(), vb.epid() ], type = _ref[0], aid = _ref[1], p = _ref[2], cid = _ref[3], epid = _ref[4], q = video.get_quality().q;api_url = "".concat(config_config.base_api, "?av=").concat(aid, "&p=").concat(p, "&cid=").concat(cid, "&ep=").concat(epid, "&q=").concat(q, "&type=").concat(type, "&format=").concat(config_config.format, "&otype=json&_host=").concat(config_config.host_key, "&_req=").concat(config_config.request_type, "&_q=").concat(config_config.video_quality);var _ref2 = [ store.get("auth_id"), store.get("auth_sec") ], auth_id = _ref2[0], auth_sec = _ref2[1];if (auth_id && auth_sec && (api_url += "&auth_id=".concat(auth_id, "&auth_sec=").concat(auth_sec)),api_url !== api_url_temp || "local" === config_config.request_type) $("#video_url").attr("href", "#"),$("#video_url_2").attr("href", "#"), api_url_temp = api_url, message_Message_info("开始请求"),api.get_url(function(res) {if (res && !res.code) {var _url, _url_;if (message_Message_success("请求成功"), res.times && message_Message_info("剩余请求次数:".concat(res.times)),res.url) _url = res.url.replace("http://", "https://"), _url_ = "#"; else {if (!res.video || !res.audio) return void message_Message_warning("数据错误");_url = res.video.replace("http://", "https://"), _url_ = res.audio.replace("http://", "https://");}$("#video_url").attr("href", _url), $("#video_url").attr("download", vb.filename() + Download.url_format(_url)),$("#video_download").show(), "#" !== _url_ && ($("#video_url_2").attr("href", _url_),$("#video_url_2").attr("download", vb.filename() + "_audio.mp4"), $("#video_download_2").show()),(user.needReplace() || vb.isLimited() || "1" === config_config.replace_force) && player.replace_player(_url, _url_),"1" === config_config.auto_download && $("#video_download").click();}}); else {message_Message_miaow();var url = $("#video_url").attr("href"), url_2 = $("#video_url_2").attr("href");url && "#" !== url && ($("#video_download").show(), "dash" === config_config.format && $("#video_download_2").show(),(user.needReplace() || vb.isLimited() || "1" === config_config.replace_force) && !$("#bp_dplayer")[0] && player.replace_player(url, url_2),"1" === config_config.auto_download && $("#video_download").click());}},video_download: function video_download() {74 行未改动if ("more" !== key) {var item = toolbar_obj.find(".toolbar-left-item-wrap").eq(0).clone();item.attr("id", key);var svg = svg_map[key].replaceAll("#757575", "currentColor").replace("class", 'class="'.concat(item.find("svg").attr("class"), '"')), span = item.find("span").text(btn_list[key]), item_div = item.find("div").eq(0);item_div.attr("title", btn_list[key]), item_div.removeClass("on"), item_div.children().remove(),item_div.append(svg).append(span), left.append(item);} else {var more_map = btn_list[key], el = "" + '<div class="more">更多<div class="more-ops-list">\n <ul>'.concat(Object.keys(more_map).map(function(key) {return '<li><span id="'.concat(key, '">').concat(more_map[key], "</span></li>");8 行未改动toolbar_obj_2.attr("id", "bp_toolbar");var left = toolbar_obj_2.find(".video-toolbar-content_left"), right = toolbar_obj_2.find(".video-toolbar-content_right");toolbar_obj_2.find(".video-toobar_title").remove(), left.children().remove();var watchlater = right.find(".watchlater").clone();right.children().remove(), right.append(watchlater), toolbar_obj_2.find(".video-desc-wrapper").remove(),Object.keys(btn_list).map(function(key) {if ("more" !== key) {var item = toolbar_obj.find(".video-toolbar-content_item").eq(0).clone();item.attr("id", key), item.attr("title", btn_list[key]);var svg = svg_map[key].replaceAll("#757575", "currentColor"), item_icon = item.find(".content-item_icon").eq(0);item_icon.removeClass("ic_like"), item_icon.html(svg), item.html(""), item.append(item_icon),item.append(btn_list[key]), left.append(item);} else {var list = watchlater.find(".more-list"), list_li = list.children().eq(0);list.children().remove();39 行未改动}).join("");return "" + '<div class="'.concat(main_class_name, '">\n ').concat(toolbar_elements, "\n ").concat(more_style, "\n </div>");}(toolbar_class, [ span_class, span_class_svg, span_class_text ]));} else $("#toolbar_module")[0] && $("#toolbar_module").after('<div id="bp_toolbar" class="tool-bar clearfix report-wrap-module report-scroll-module media-info" scrollshow="true"> <div id="setting_btn" class="like-info"> <i class="iconfont icon-add"></i><span>脚本设置</span> </div> <div id="bilibili_parse" class="like-info"> <i class="iconfont icon-customer-serv"></i><span>请求地址</span> </div> <div id="video_download" class="like-info" style="display:none"> <i class="iconfont icon-download"></i><span>下载视频</span> </div> <div id="video_download_2" class="like-info" style="display:none"> <i class="iconfont icon-download"></i><span>下载音频</span> </div> <div id="video_download_all" class="like-info"> <i class="iconfont icon-download"></i><span>批量下载</span> </div> <div class="more">更多<div class="more-ops-list"> <ul> <li><span id="download_danmaku">下载弹幕</span></li> <li><span id="download_subtitle">下载字幕</span></li> </ul> </div> </div> <style>.tool-bar .more{float:right;cursor:pointer;color:#757575;font-size:16px;transition:all .3s;position:relative;text-align:center}.tool-bar .more:hover .more-ops-list{display:block}.tool-bar:after{display:block;content:"";clear:both}.more-ops-list{display:none;position:absolute;width:80px;left:-65px;z-index:30;text-align:center;padding:10px 0;background:#fff;border:1px solid #e5e9ef;box-shadow:0 2px 4px 0 rgba(0,0,0,.14);border-radius:2px;font-size:14px;color:#222}.more-ops-list li{position:relative;height:34px;line-height:34px;cursor:pointer;transition:all .3s}.more-ops-list li:hover{color:#00a1d6;background:#e7e7e7}</style> </div> ');$("#limit-mask-wall")[0] && $("#limit-mask-wall").remove(), $("#video_download").hide(),$("#video_download_2").hide();}function main_typeof(o) {return main_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {42 行未改动}function main_defineProperties(e, r) {for (var t = 0; t < r.length; t++) {var o = r[t];o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0),Object.defineProperty(e, main_toPropertyKey(o.key), o);}}function main_toPropertyKey(t) {15 行未改动if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");}(this, Main), console.log("\n".concat(" %c bilibili-parse-download.user.js v", "2.9.2", " ").concat("90a6675", " %c https://github.com/injahow/user.js ", "\n", "\n"), "color: #fadfa3; background: #030307; padding:5px 0;", "background: #fadfa3; padding:5px 0;");}return function main_createClass(e, r, t) {return r && main_defineProperties(e.prototype, r), t && main_defineProperties(e, t),Object.defineProperty(e, "prototype", {writable: !1}), e;}(Main, [ {key: "loadToolbar",value: function loadToolbar() {var timer, timeout, loading = !1;timer = setInterval(function() {document.getElementById("nav-searchform") && (loading || (loading = !0, initToolbar()),clearInterval(timer));}, 500);try {timeout = (timeout = config_config.show_ui_timeout ? parseInt(config_config.show_ui_timeout) : 8) > 0 ? timeout : 8;} catch (err) {console.error("show_ui_timeout err:", err);}setTimeout(function() {if (clearInterval(timer), !loading) {if (console.warn("waiting timeout..."), "1" === config_config.show_ui_confirm) return "1" === config_config.show_ui_confirm_load_force ? (loading = !0,void initToolbar()) : void MessageBox_confirm("加载脚本工具栏超时,建议刷新页面重新加载,是否强制加载工具栏?", initToolbar, null);message_Message_warning("工具栏加载异常,已延迟加载"), setTimeout(function() {loading || (loading = !0, initToolbar()), message_Message_info("工具栏已重新加载");}, 5e3);6 行未改动var root_div = document.createElement("div");root_div.id = "bp_root", document.body.append(root_div), function initConfig(el) {var options = '<option value="0">关闭</option>';for (var k in hostMap) options += '<option value="'.concat(k, '">').concat(hostMap[k], "</option>");for (var _k in config = config.replace("{{host_key_options}}", options), options = '<option value="0">与播放器相同</option>',videoQualityMap) options += '<option value="'.concat(_k, '">').concat(videoQualityMap[_k], "</option>");config = config.replace("{{video_quality_options}}", options), el && $(el)[0] ? $(el).append(config) : $("body").append(config);var tabLinks = document.querySelectorAll("#bp_config .tab-link"), panels = document.querySelectorAll("#bp_config .tab-panel"), showTab = function showTab(id) {panels.forEach(function(p) {35 行未改动bp_aria2_window && !bp_aria2_window.closed && bp_aria2_window.close();};}("#".concat(root_div.id)), function initMessage(el) {el && $(el)[0] ? $(el).append(message) : $("body").append(message);}("#".concat(root_div.id)), this.loadToolbar(), user.lazyInit(), auth.checkLoginStatus(),check.refresh(), $("#".concat(root_div.id)).append('<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/dplayer/1.25.0/DPlayer.min.css">'),$("#".concat(root_div.id)).append('<a id="video_url" style="display:none;" target="_blank" referrerpolicy="origin" href="#"></a>'),$("#".concat(root_div.id)).append('<a id="video_url_2" style="display:none;" target="_blank" referrerpolicy="origin" href="#"></a>');}}, {key: "run",30 行未改动