// ==UserScript== // @name ddrk低端影视助手 // @namespace king // @version 1.4.8 // @description ddrk低端影视功能增强插件: 自动播放下一集,收藏功能,历史记录,去广告,小窗口播放,快进快退,下载视频 // @author hero-king // @supportURL https://github.com/Funbin/ddrk-tools/issues // @icon https://ddys.pro/favicon-32x32.png // @run-at document-start // @match https://ddrk.me/* // @include *://ddys.* // @include *://ddys2.* // @grant unsafeWindow // @grant GM_listValues // @grant GM_setValue // @grant GM_getValue // @require http://code.jquery.com/jquery-3.3.1.min.js // @require https://cdn.staticfile.org/vue/3.2.33/vue.global.min.js // @require https://cdn.staticfile.org/popper.js/2.11.5/umd/popper.min.js // ==/UserScript== /* globals $, DPlayer waitForKeyElements */ // @[ You can find all source codes in GitHub repo ] !function() { "use strict"; var __webpack_modules__ = { 251: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, "\n.col_list_arrow[data-v-4b74ca11]:hover {\n background: #3b818c;\n}\n.col_list_arrow[data-v-4b74ca11]:nth-child(1) {\n border-bottom-left-radius: 0;\n}\n.col_list_arrow[data-v-4b74ca11]:nth-child(2) {\n border-radius: 0;\n}\n.col_list_arrow[data-v-4b74ca11]:nth-child(3) {\n border-top-left-radius: 0;\n}\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 646: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, "\n.col_list-ul .col_item .col_item-left[data-v-0a142c44] {\n vertical-align: middle;\n}\n.col_list-ul .col_item .col_item-left i[data-v-0a142c44] {\n line-height: 0;\n vertical-align: text-top;\n}\n.col_list-ul .col_item .col_item-left .col_item-tags[data-v-0a142c44] {\n display: inline-block;\n min-width: 23px;\n text-align: right;\n padding-right: 4px;\n box-sizing: content-box;\n}\n.col_list-ul .col_item .col_item-right[data-v-0a142c44] {\n display: flex;\n align-items: center;\n}\n.col_list-ul .col_item .his_time[data-v-0a142c44] {\n font-size: 12px;\n color: #fff;\n margin-left: 5px;\n white-space: nowrap;\n line-height: 1;\n}\n.col_list-ul .col_item .his_time_end[data-v-0a142c44] {\n color: #20b2aa;\n}\n.col_list-ul .col_item .icon_top[data-v-0a142c44] {\n display: none;\n cursor: pointer;\n}\n.col_list-ul .col_item:hover .icon_top[data-v-0a142c44] {\n display: inline-block;\n}\n.col_list-ul .col_item:hover .col_item-index[data-v-0a142c44] {\n display: none;\n}\n.col_list-ul .col_item:hover .icon_top_tag[data-v-0a142c44] {\n display: none;\n}\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 419: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, "\n.pagination-btn[data-v-40ae7db4] {\n position: fixed;\n top: 50%;\n transform: translateY(-50%);\n background: rgba(0, 0, 0, 0.5);\n padding: 30px 0;\n opacity: 0.5;\n cursor: pointer;\n}\n.pagination-btn svg[data-v-40ae7db4] {\n width: 28px;\n}\n.pagination-btn.pagination-left[data-v-40ae7db4] {\n left: 0;\n border-top-right-radius: 10px;\n border-bottom-right-radius: 10px;\n padding-right: 5px;\n}\n.pagination-btn.pagination-right[data-v-40ae7db4] {\n right: 0;\n border-top-left-radius: 10px;\n border-bottom-left-radius: 10px;\n padding-left: 5px;\n}\n.Fade-enter[data-v-40ae7db4],\n.Fade-leave-to[data-v-40ae7db4] {\n opacity: 0;\n}\n.Fade-enter-to[data-v-40ae7db4],\n.Fade-leave[data-v-40ae7db4] {\n opacity: 0.5;\n}\n.Fade-enter-active[data-v-40ae7db4],\n.Fade-leave-active[data-v-40ae7db4] {\n transition: all 0.5s;\n}\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 207: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__), _node_modules_css_loader_dist_cjs_js_index_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(755), ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.i(_node_modules_css_loader_dist_cjs_js_index_css__WEBPACK_IMPORTED_MODULE_2__.Z), ___CSS_LOADER_EXPORT___.push([ module.id, "\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 647: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, '/*! @name videojs-seek-buttons @version 2.2.1 @license Apache-2.0 */\n.video-js .vjs-seek-button {\n font-family: "VideoJS";\n cursor: pointer;\n font-weight: 400;\n font-style: normal;\n}\n.video-js .vjs-seek-button.skip-back::before,\n.video-js.vjs-v6 .vjs-seek-button.skip-back .vjs-icon-placeholder::before,\n.video-js.vjs-v7 .vjs-seek-button.skip-back .vjs-icon-placeholder::before {\n transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n content: "\\f116";\n}\n.video-js .vjs-seek-button.skip-forward::before {\n transform: rotateY(180deg) rotate(-45deg);\n -ms-transform: rotateY(180deg) rotate(-45deg);\n -webkit-transform: rotateY(180deg) rotate(-45deg);\n content: "\\f116";\n}\n.video-js.vjs-v6 .vjs-seek-button.skip-back::before,\n.video-js.vjs-v6 .vjs-seek-button.skip-forward::before,\n.video-js.vjs-v7 .vjs-seek-button.skip-back::before,\n.video-js.vjs-v7 .vjs-seek-button.skip-forward::before {\n content: none;\n}\n.video-js.vjs-v6 .vjs-seek-button.skip-forward .vjs-icon-placeholder::before,\n.video-js.vjs-v7 .vjs-seek-button.skip-forward .vjs-icon-placeholder::before {\n transform: scale(-1, 1) rotate(-45deg);\n -ms-transform: scale(-1, 1) rotate(-45deg);\n -webkit-transform: scale(-1, 1) rotate(-45deg);\n content: "\\f116";\n}\n', "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 592: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, "/* .cfa_popup {\n height: 0 !important;\n}\n#iaujwnefhw,\n#kasjbgih {\n height: 0 !important;\n overflow: hidden !important;\n}\n\n.ddrk-tools__ad .cfa_popup {\n height: auto !important;\n}\n\n.ddrk-tools__ad #iaujwnefhw,\n.ddrk-tools__ad #kasjbgih {\n height: auto !important;\n overflow: visible !important;\n} */\n\n.cfa_popup,\n.entry > div:nth-child(1),\n#iaujwnefhw > div:nth-child(1) {\n display: none !important;\n}\n\n.ddrk-tools__ad .cfa_popup,\n.ddrk-tools__ad .entry > div:nth-child(1),\n.ddrk-tools__ad #iaujwnefhw > div:nth-child(1) {\n display: block !important;\n}\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 21: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, ".ddrk-tools__modal {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n text-align: right;\n}\n.btn_col-default {\n position: absolute;\n top: 0;\n right: -32px;\n width: 32px;\n padding: 6px;\n background-color: rgba(0, 0, 0, 0.6);\n box-shadow: 4px 0px 8px rgba(0, 0, 0, 0.4);\n line-height: 1;\n user-select: none;\n}\n.btn_col-playpage {\n position: fixed;\n left: 20px;\n bottom: 70px;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 42px;\n height: 42px;\n z-index: 9999;\n border-radius: 5%;\n background: rgba(0, 0, 0, 0.5);\n cursor: pointer;\n}\n.btn_download {\n position: absolute;\n right: 0;\n top: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n z-index: 1;\n}\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 704: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, ".ddrk-tools__video-window-small {\n position: fixed !important;\n right: 5px;\n bottom: 10px;\n width: 30vw !important;\n height: 16.875vw !important;\n padding: 0 !important;\n z-index: 9;\n}\n.ddrk-tools__video-placeholder {\n background: #000;\n}\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 374: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, ".ddrk-tools__video .vjs-time-control.vjs-current-time {\n display: block;\n}\n.ddrk-tools__video .vjs-time-control.vjs-time-divider {\n display: block;\n}\n.ddrk-tools__video .vjs-time-control.vjs-duration {\n display: block;\n padding-right: 1em !important;\n}\n.ddrk-tools__video .vjs-time-control.vjs-remaining-time {\n display: none;\n}\n.ddrk-tools__video .vjs-control-bar .vjs-time-control {\n padding-left: 1px;\n padding-right: 1px;\n min-width: auto;\n}\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 755: function(module, __webpack_exports__, __webpack_require__) { var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81), _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__), _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(645), ___CSS_LOADER_EXPORT___ = __webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__)()(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, ".col_list {\n position: fixed;\n top: 50px;\n right: 0;\n width: 0;\n height: auto;\n min-height: 54px;\n box-sizing: border-box;\n background: #2c2c2c;\n box-shadow: -20px 10px 60px rgba(0, 0, 0, 0.6);\n z-index: 999;\n transition: width 0.6s;\n}\n.col_list-active {\n width: 300px;\n}\n.col_list-active .col_list-ul {\n overflow: auto;\n}\n.col_list .col_list_arrow {\n position: absolute;\n left: -26px;\n top: 0;\n line-height: 0;\n background: #008080;\n color: #000;\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n}\n.col_list .col_list_arrow svg{\n width: 26px;\n padding: 4px;\n}\n.col_list > h6 {\n color: #aaa;\n margin: 10px 0 5px 0;\n text-align: center;\n white-space: nowrap;\n}\n\n.col_list-ul::-webkit-scrollbar {\n width: 5px;\n height: 5px;\n}\n\n.col_list-ul::-webkit-scrollbar-thumb {\n border-radius: 3px;\n -moz-border-radius: 3px;\n -webkit-border-radius: 3px;\n background-color: #999;\n}\n\n.col_list-ul::-webkit-scrollbar-track {\n background-color: transparent;\n}\n\n.col_list-ul {\n width: 300px;\n height: 300px;\n padding: 5px 0;\n overflow: hidden;\n color: #20b2aa;\n}\n\n.col_list-ul .col_item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 5px 0;\n padding: 0 5px;\n line-height: 25px;\n border: 1px solid transparent;\n border-left: none;\n border-right: none;\n}\n.col_list-ul .col_item a {\n color: #20b2aa;\n}\n.col_list-ul .col_item .icon_del {\n display: none;\n cursor: pointer;\n line-height: 0;\n}\n.col_list-ul .col_item:hover {\n /* box-shadow: 0 0 5px rgba(32, 178, 170, 0.2);\n border-color: rgba(225, 255, 255, 0.4); */\n background: #333;\n}\n.col_list-ul .col_item:hover .icon_del {\n display: inline-block;\n}\n", "" ]), __webpack_exports__.Z = ___CSS_LOADER_EXPORT___; }, 645: function(module) { module.exports = function(cssWithMappingToString) { var list = []; return list.toString = function toString() { return this.map((function(item) { var content = "", needLayer = void 0 !== item[5]; return item[4] && (content += "@supports (".concat(item[4], ") {")), item[2] && (content += "@media ".concat(item[2], " {")), needLayer && (content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {")), content += cssWithMappingToString(item), needLayer && (content += "}"), item[2] && (content += "}"), item[4] && (content += "}"), content; })).join(""); }, list.i = function i(modules, media, dedupe, supports, layer) { "string" == typeof modules && (modules = [ [ null, modules, void 0 ] ]); var alreadyImportedModules = {}; if (dedupe) for (var k = 0; k < this.length; k++) { var id = this[k][0]; null != id && (alreadyImportedModules[id] = !0); } for (var _k = 0; _k < modules.length; _k++) { var item = [].concat(modules[_k]); dedupe && alreadyImportedModules[item[0]] || (void 0 !== layer && (void 0 === item[5] || (item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}")), item[5] = layer), media && (item[2] ? (item[1] = "@media ".concat(item[2], " {").concat(item[1], "}"), item[2] = media) : item[2] = media), supports && (item[4] ? (item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}"), item[4] = supports) : item[4] = "".concat(supports)), list.push(item)); } }, list; }; }, 81: function(module) { module.exports = function(i) { return i[1]; }; }, 379: function(module) { var stylesInDOM = []; function getIndexByIdentifier(identifier) { for (var result = -1, i = 0; i < stylesInDOM.length; i++) if (stylesInDOM[i].identifier === identifier) { result = i; break; } return result; } function modulesToDom(list, options) { for (var idCountMap = {}, identifiers = [], i = 0; i < list.length; i++) { var item = list[i], id = options.base ? item[0] + options.base : item[0], count = idCountMap[id] || 0, identifier = "".concat(id, " ").concat(count); idCountMap[id] = count + 1; var indexByIdentifier = getIndexByIdentifier(identifier), obj = { css: item[1], media: item[2], sourceMap: item[3], supports: item[4], layer: item[5] }; if (-1 !== indexByIdentifier) stylesInDOM[indexByIdentifier].references++, stylesInDOM[indexByIdentifier].updater(obj); else { var updater = addElementStyle(obj, options); options.byIndex = i, stylesInDOM.splice(i, 0, { identifier: identifier, updater: updater, references: 1 }); } identifiers.push(identifier); } return identifiers; } function addElementStyle(obj, options) { var api = options.domAPI(options); api.update(obj); return function updater(newObj) { if (newObj) { if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) return; api.update(obj = newObj); } else api.remove(); }; } module.exports = function(list, options) { var lastIdentifiers = modulesToDom(list = list || [], options = options || {}); return function update(newList) { newList = newList || []; for (var i = 0; i < lastIdentifiers.length; i++) { var index = getIndexByIdentifier(lastIdentifiers[i]); stylesInDOM[index].references--; } for (var newLastIdentifiers = modulesToDom(newList, options), _i = 0; _i < lastIdentifiers.length; _i++) { var _index = getIndexByIdentifier(lastIdentifiers[_i]); 0 === stylesInDOM[_index].references && (stylesInDOM[_index].updater(), stylesInDOM.splice(_index, 1)); } lastIdentifiers = newLastIdentifiers; }; }; }, 569: function(module) { var memo = {}; module.exports = function insertBySelector(insert, style) { var target = function getTarget(target) { if (void 0 === memo[target]) { var styleTarget = document.querySelector(target); if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) try { styleTarget = styleTarget.contentDocument.head; } catch (e) { styleTarget = null; } memo[target] = styleTarget; } return memo[target]; }(insert); if (!target) throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); target.appendChild(style); }; }, 216: function(module) { module.exports = function insertStyleElement(options) { var element = document.createElement("style"); return options.setAttributes(element, options.attributes), options.insert(element, options.options), element; }; }, 565: function(module, __unused_webpack_exports, __webpack_require__) { module.exports = function setAttributesWithoutAttributes(styleElement) { var nonce = __webpack_require__.nc; nonce && styleElement.setAttribute("nonce", nonce); }; }, 795: function(module) { module.exports = function domAPI(options) { var styleElement = options.insertStyleElement(options); return { update: function update(obj) { !function apply(styleElement, options, obj) { var css = ""; obj.supports && (css += "@supports (".concat(obj.supports, ") {")), obj.media && (css += "@media ".concat(obj.media, " {")); var needLayer = void 0 !== obj.layer; needLayer && (css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {")), css += obj.css, needLayer && (css += "}"), obj.media && (css += "}"), obj.supports && (css += "}"); var sourceMap = obj.sourceMap; sourceMap && "undefined" != typeof btoa && (css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */")), options.styleTagTransform(css, styleElement, options.options); }(styleElement, options, obj); }, remove: function remove() { !function removeStyleElement(styleElement) { if (null === styleElement.parentNode) return !1; styleElement.parentNode.removeChild(styleElement); }(styleElement); } }; }; }, 589: function(module) { module.exports = function styleTagTransform(css, styleElement) { if (styleElement.styleSheet) styleElement.styleSheet.cssText = css; else { for (;styleElement.firstChild; ) styleElement.removeChild(styleElement.firstChild); styleElement.appendChild(document.createTextNode(css)); } }; }, 744: function(__unused_webpack_module, exports) { exports.Z = (sfc, props) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props) target[key] = val; return target; }; }, 256: function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); videojs.addLanguage("zh", { "Seek forward {{seconds}} seconds": "快进 {{seconds}} 秒", "Seek back {{seconds}} seconds": "快退 {{seconds}} 秒" }); const Button = videojs.getComponent("Button"), defaults = { forwardIndex: 1, backIndex: 1 }, registerPlugin = videojs.registerPlugin || videojs.plugin, seekButtons = function(options) { this.ready((() => { ((player, options) => { player.addClass("vjs-seek-buttons"), options.forward && options.forward > 0 && (player.controlBar.seekForward = player.controlBar.addChild("seekButton", { direction: "forward", seconds: options.forward }, options.forwardIndex)), options.back && options.back > 0 && (player.controlBar.seekBack = player.controlBar.addChild("seekButton", { direction: "back", seconds: options.back }, options.backIndex)); })(this, videojs.mergeOptions(defaults, options)); })); }; seekButtons.VERSION = "1.0"; videojs.registerComponent("SeekButton", class extends Button { constructor(player, options) { super(player, options), "forward" === this.options_.direction ? this.controlText(this.localize("Seek forward {{seconds}} seconds").replace("{{seconds}}", this.options_.seconds)) : "back" === this.options_.direction && this.controlText(this.localize("Seek back {{seconds}} seconds").replace("{{seconds}}", this.options_.seconds)); } buildCSSClass() { return `vjs-seek-button skip-${this.options_.direction} skip-${this.options_.seconds} ${super.buildCSSClass()}`; } handleClick() { const now = this.player_.currentTime(); if ("forward" === this.options_.direction) { let duration = this.player_.duration(); this.player_.liveTracker && this.player_.liveTracker.isLive() && (duration = this.player_.liveTracker.seekableEnd()), this.player_.currentTime(Math.min(now + this.options_.seconds, duration)); } else "back" === this.options_.direction && this.player_.currentTime(Math.max(0, now - this.options_.seconds)); } }), registerPlugin("seekButtons", seekButtons), __webpack_exports__.default = seekButtons; } }, __webpack_module_cache__ = {}; function __webpack_require__(moduleId) { var cachedModule = __webpack_module_cache__[moduleId]; if (void 0 !== cachedModule) return cachedModule.exports; var module = __webpack_module_cache__[moduleId] = { id: moduleId, exports: {} }; return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports; } __webpack_require__.n = function(module) { var getter = module && module.__esModule ? function() { return module.default; } : function() { return module; }; return __webpack_require__.d(getter, { a: getter }), getter; }, __webpack_require__.d = function(exports, definition) { for (var key in definition) __webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key) && Object.defineProperty(exports, key, { enumerable: !0, get: definition[key] }); }, __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }, __webpack_require__.r = function(exports) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(exports, "__esModule", { value: !0 }); }, __webpack_require__.nc = void 0, function() { var injectStylesIntoStyleTag = __webpack_require__(379), injectStylesIntoStyleTag_default = __webpack_require__.n(injectStylesIntoStyleTag), styleDomAPI = __webpack_require__(795), styleDomAPI_default = __webpack_require__.n(styleDomAPI), insertBySelector = __webpack_require__(569), insertBySelector_default = __webpack_require__.n(insertBySelector), setAttributesWithoutAttributes = __webpack_require__(565), setAttributesWithoutAttributes_default = __webpack_require__.n(setAttributesWithoutAttributes), insertStyleElement = __webpack_require__(216), insertStyleElement_default = __webpack_require__.n(insertStyleElement), styleTagTransform = __webpack_require__(589), styleTagTransform_default = __webpack_require__.n(styleTagTransform), ad_fix = __webpack_require__(592), options = {}; options.styleTagTransform = styleTagTransform_default(), options.setAttributes = setAttributesWithoutAttributes_default(), options.insert = insertBySelector_default().bind(null, "head"), options.domAPI = styleDomAPI_default(), options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(ad_fix.Z, options), ad_fix.Z && ad_fix.Z.locals && ad_fix.Z.locals; var style = __webpack_require__(21), style_options = {}; style_options.styleTagTransform = styleTagTransform_default(), style_options.setAttributes = setAttributesWithoutAttributes_default(), style_options.insert = insertBySelector_default().bind(null, "head"), style_options.domAPI = styleDomAPI_default(), style_options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(style.Z, style_options), style.Z && style.Z.locals && style.Z.locals; var video_fix = __webpack_require__(374), video_fix_options = {}; video_fix_options.styleTagTransform = styleTagTransform_default(), video_fix_options.setAttributes = setAttributesWithoutAttributes_default(), video_fix_options.insert = insertBySelector_default().bind(null, "head"), video_fix_options.domAPI = styleDomAPI_default(), video_fix_options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(video_fix.Z, video_fix_options), video_fix.Z && video_fix.Z.locals && video_fix.Z.locals; var small_window = __webpack_require__(704), small_window_options = {}; small_window_options.styleTagTransform = styleTagTransform_default(), small_window_options.setAttributes = setAttributesWithoutAttributes_default(), small_window_options.insert = insertBySelector_default().bind(null, "head"), small_window_options.domAPI = styleDomAPI_default(), small_window_options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(small_window.Z, small_window_options), small_window.Z && small_window.Z.locals && small_window.Z.locals; const WD = window.unsafeWindow || document.defaultView || window; var external_Vue_namespaceObject = Vue; const _hoisted_1 = [ "innerHTML" ], _hoisted_2 = [ "innerHTML" ], _hoisted_3 = [ "innerHTML" ]; var Containervue_type_script_setup_true_lang_js = { name: "Container", setup(__props) { const currentHoverIcon = (0, external_Vue_namespaceObject.ref)(0); let timer = null; const showAll = (0, external_Vue_namespaceObject.ref)(!1), handleOver = () => { showAll.value = !0, timer && clearTimeout(timer); }, handleOut = () => { timer && clearTimeout(timer), timer = setTimeout((() => { showAll.value = !1; }), 1e3); }; return (_ctx, _cache) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("div", { class: (0, external_Vue_namespaceObject.normalizeClass)([ "col_list", { "col_list-active": showAll.value } ]), onMouseover: handleOver, onMouseout: handleOut }, [ (0, external_Vue_namespaceObject.createElementVNode)("i", { innerHTML: (0, external_Vue_namespaceObject.unref)(' '), class: "col_list_arrow", style: { top: "0" }, onMouseenter: _cache[0] || (_cache[0] = $event => currentHoverIcon.value = 1) }, null, 40, _hoisted_1), (0, external_Vue_namespaceObject.createElementVNode)("i", { innerHTML: (0, external_Vue_namespaceObject.unref)(' '), class: "col_list_arrow", style: { top: "32px" }, onMouseenter: _cache[1] || (_cache[1] = $event => currentHoverIcon.value = 2) }, null, 40, _hoisted_2), (0, external_Vue_namespaceObject.createElementVNode)("i", { innerHTML: (0, external_Vue_namespaceObject.unref)(' '), class: "col_list_arrow", style: { top: "64px" }, onMouseenter: _cache[2] || (_cache[2] = $event => currentHoverIcon.value = 3) }, null, 40, _hoisted_3), (0, external_Vue_namespaceObject.renderSlot)(_ctx.$slots, "default", { type: currentHoverIcon.value }) ], 34)); } }, Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css = __webpack_require__(251), Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css_options = {}; Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css_options.styleTagTransform = styleTagTransform_default(), Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css_options.setAttributes = setAttributesWithoutAttributes_default(), Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css_options.insert = insertBySelector_default().bind(null, "head"), Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css_options.domAPI = styleDomAPI_default(), Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css_options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css.Z, Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css_options), Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css.Z && Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css.Z.locals && Containervue_type_style_index_0_id_4b74ca11_scoped_true_lang_css.Z.locals; var exportHelper = __webpack_require__(744); var Container = (0, exportHelper.Z)(Containervue_type_script_setup_true_lang_js, [ [ "__scopeId", "data-v-4b74ca11" ] ]); const Store_setValue = function(key, value) { window.GM_setValue ? GM_setValue(key, value) : localStorage.setItem(key, value); }, Store_getValue = function(key) { return window.GM_getValue && GM_getValue(key) || localStorage.getItem(key); }, DEFAULT_SETTINGS = [ { id: 1, name: "自动播放下一集", val: !0 }, { id: 2, name: "点击海报打开新标签", val: !0 }, { id: 3, name: "播放时提示上次观看位置", val: !0 }, { id: 4, name: "开启小窗口播放(脱离可视区域时)", val: !0 }, { id: 5, name: "点击下载直接跳转不再弹框", val: !1 }, { id: 6, name: "上下页(集)显示", val: !0 }, { id: 7, name: "播放器显示当前时间", val: !0 }, { id: 8, name: "快进快退", val: !0 }, { id: 9, name: "隐藏广告", val: !1 } ], Settings = { curList: (0, external_Vue_namespaceObject.ref)([]), init() { this.curList.value = this._compareData(); }, _compareData() { const localDataStr = Store_getValue("ddrk-tools-settings"); if (localDataStr) { const localData = JSON.parse(localDataStr); return DEFAULT_SETTINGS.map((item => { const localItem = localData.find((ele => ele.id === item.id)); return localItem ? { ...item, val: localItem.val } : item; })); } return DEFAULT_SETTINGS; }, getList() { return this.curList.value = this._compareData(), this.curList.value; }, setList(list) { this.curList.value = list, Store_setValue("ddrk-tools-settings", JSON.stringify(list)); }, getValueById(id) { return (this.curList.value.find((item => item.id === id)) || { val: !1 }).val; } }; var iconStarFill = ' 已收藏 '; const LocalCollection = { playPageHref: "", colList: (0, external_Vue_namespaceObject.ref)([]), init() { const storeColList = JSON.parse(Store_getValue("ddrk-tools-collection") || "[]"); this.colList.value = storeColList.map((item => ({ ...item, href: item.href.replace(/^https:\/\/(ddrk.me|ddys.tv|ddys2.me)/, "") }))); const modal = $(""); $(".post-box").length ? $(".post-box").each((function() { modal.attr("href", $(this).data("href")), $(this).append(modal.clone(!0)); })) : this.playPageHref = "/" + window.location.pathname.split("/")[1] + "/", this.reloadCollectButton(), this.bindEvent(); }, bindEvent() { const self = this; $(".post-box").on("click", ".ddrk-tools__modal", (function(e) { return console.log("opentab: ", Settings.getValueById(2)), Settings.getValueById(2) ? window.open($(this).parent().data("href")) : window.location.href = $(this).parent().data("href"), e.stopPropagation(), !1; })), $(".post-box").on("click", ".btn_col-default", (function(e) { e.stopPropagation(); })), $(".post-box").on("click", ".btn_col-add", (function(e) { const href = $(this).parent().data("href").replace(window.location.origin, ""), name = $(this).parent().find(".post-box-title a").text(); self.colList.value.find((item => item.href === href)) || (self.colList.value.unshift({ name: name.indexOf("(") > -1 ? name.split("(")[0] : name, href: href, t: Date.now() }), Store_setValue("ddrk-tools-collection", JSON.stringify((0, external_Vue_namespaceObject.toRaw)(self.colList.value)))), self.toggleButton($(this), 1); })), $(".post-box").on("click", ".btn_col-remove", (function(e) { const href = $(this).parent().data("href").replace(window.location.origin, ""), index = self.colList.value.findIndex((item => item.href === href)); self.handleColDel(index), self.toggleButton($(this), 0); })), $("#ddrk-tools").on("click", ".btn_col-remove", (function(e) { const index = self.colList.value.findIndex((item => item.href === self.playPageHref)); self.handleColDel(index), self.toggleButton($(this), 0); })), $("#ddrk-tools").on("click", ".btn_col-add", (function(e) { const name = $(".post-title").text(); self.colList.value.find((item => item.href === self.playPageHref)) || (self.colList.value.unshift({ name: name.indexOf("(") > -1 ? name.split("(")[0] : name, href: self.playPageHref, t: Date.now() }), Store_setValue("ddrk-tools-collection", JSON.stringify((0, external_Vue_namespaceObject.toRaw)(self.colList.value)))), self.toggleButton($(this), 1); })); }, toggleButton(tempBtn, tag) { 0 === tag ? (tempBtn.addClass("btn_col-add"), tempBtn.removeClass("btn_col-remove"), tempBtn.html(' 收藏 ')) : (tempBtn.addClass("btn_col-remove"), tempBtn.removeClass("btn_col-add"), tempBtn.html(iconStarFill)); }, refreshColList() { this.colList.value = JSON.parse(Store_getValue("ddrk-tools-collection") || "[]"); }, reloadCollectButton() { const self = this; if ($(".post-box").length) $(".post-box").each((function() { let tempBtn = $(this).find(".btn_col-default"); tempBtn.length || (tempBtn = $(`${iconStarFill}`), $(this).append(tempBtn)); const collectionUrl = $(this).data("href").replace(window.location.origin, ""); self.colList.value.find((item => item.href === collectionUrl)) ? self.toggleButton(tempBtn, 1) : self.toggleButton(tempBtn, 0); })); else { let tempBtn = $(".btn_col-playpage"); tempBtn.length || (tempBtn = $(`${iconStarFill}`), $("#ddrk-tools").append(tempBtn)), self.colList.value.find((item => item.href === this.playPageHref)) ? self.toggleButton(tempBtn, 1) : self.toggleButton(tempBtn, 0); } }, handleColDel(index) { -1 !== index && (this.colList.value.splice(index, 1), Store_setValue("ddrk-tools-collection", JSON.stringify((0, external_Vue_namespaceObject.toRaw)(this.colList.value)))); } }; var iconDelete = ' 删除 '; const Collectionvue_type_script_setup_true_lang_js_hoisted_1 = { class: "col_list-ul" }, Collectionvue_type_script_setup_true_lang_js_hoisted_2 = [ "href" ], Collectionvue_type_script_setup_true_lang_js_hoisted_3 = [ "innerHTML", "onClick" ]; var Collection = { name: "Collection", props: { title: { type: String, required: !0 } }, setup(__props) { const colList = (0, external_Vue_namespaceObject.computed)((() => LocalCollection.colList.value)); document.addEventListener("visibilitychange", (async function() { "visible" == document.visibilityState && (LocalCollection.refreshColList(), LocalCollection.reloadCollectButton()); })); return (_ctx, _cache) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)(external_Vue_namespaceObject.Fragment, null, [ (0, external_Vue_namespaceObject.createElementVNode)("h6", null, (0, external_Vue_namespaceObject.toDisplayString)(__props.title), 1), (0, external_Vue_namespaceObject.createElementVNode)("ul", Collectionvue_type_script_setup_true_lang_js_hoisted_1, [ ((0, external_Vue_namespaceObject.openBlock)(!0), (0, external_Vue_namespaceObject.createElementBlock)(external_Vue_namespaceObject.Fragment, null, (0, external_Vue_namespaceObject.renderList)((0, external_Vue_namespaceObject.unref)(colList), ((item, index) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("li", { class: "col_item", key: index }, [ (0, external_Vue_namespaceObject.createElementVNode)("span", null, [ (0, external_Vue_namespaceObject.createTextVNode)((0, external_Vue_namespaceObject.toDisplayString)(index + 1) + ". ", 1), (0, external_Vue_namespaceObject.createElementVNode)("a", { href: item.href }, (0, external_Vue_namespaceObject.toDisplayString)(item.name), 9, Collectionvue_type_script_setup_true_lang_js_hoisted_2) ]), (0, external_Vue_namespaceObject.createElementVNode)("i", { class: "icon_del", innerHTML: (0, external_Vue_namespaceObject.unref)(iconDelete), onClick: (0, external_Vue_namespaceObject.withModifiers)(($event => (index => { LocalCollection.handleColDel(index), LocalCollection.reloadCollectButton(); })(index)), [ "stop" ]) }, null, 8, Collectionvue_type_script_setup_true_lang_js_hoisted_3) ])))), 128)) ]) ], 64)); } }; const Common = { sleep: time => new Promise((resolve => { setTimeout(resolve, time); })), ready: () => new Promise((resolve => { $(document).ready((function() { resolve(); })); })), isMobile: () => /Mobi|Android|iPhone/i.test(navigator.userAgent), request: ({url: url, type: type} = config) => new Promise(((resolve, reject) => { $.ajax({ url: url, type: type, success: function(result) { resolve(result); }, error: function(e) { reject(e); } }); })) }, LocalHistory = { setLocalHistory(list) { const newList = list.filter((item => !item.deleteInfo || !(Date.now() - item.deleteInfo.t > 15552e6))); Store_setValue("ddrk-tools-history", JSON.stringify(newList)); }, async getLocalHistory() { let jsonList = JSON.parse(Store_getValue("ddrk-tools-history") || "[]"); jsonList.length || Store_setValue("ddrk-tools-resume", ""); const newhis = this.getLocalStorageData().filter((item => 0 === item.key.indexOf("videojs-resume:"))), oldhis = JSON.parse(Store_getValue("ddrk-tools-resume") || "[]"), minus = newhis.filter((newItem => !oldhis.some((oldItem => oldItem.key === newItem.key && oldItem.val === newItem.val)))), minushis = this.formatLocalData(minus), filterList = this.filterLocalData(minushis); let res = this.compareLocalData(jsonList, filterList); for (const item of res) if (!item.name && (item.errorTimes || 0) < 50) { const {name: name = "", category: category} = await this.getDramaName(item.url); item.name = name.indexOf("(") > -1 ? name.split("(")[0] : name, item.category = category, name || (item.errorTimes = item.errorTimes ? item.errorTimes++ : 1); } return res = res.filter((item => item.name)), Store_setValue("ddrk-tools-history", JSON.stringify(res)), Store_setValue("ddrk-tools-resume", JSON.stringify(newhis)), res; }, getLocalStorageData: function() { for (var len = localStorage.length, arr = new Array, i = 0; i < len; i++) { var getKey = localStorage.key(i), getVal = localStorage.getItem(getKey); arr[i] = { key: getKey, val: getVal }; } return arr; }, formatLocalData: local => local.map((item => { const info = item.key.split("/"); return { ...item, url: item.key.split(":")[1], enName: info[1], season: info.length > 3 && !isNaN(info[2]) ? info[2] : "", ep: info.at(-1).replace("?ep=", ""), t: Date.now() }; })), filterLocalData: params => params.reduce(((res, cur) => { const innerItem = res.find((item => item.enName === cur.enName && item.season === cur.season)); return innerItem ? (+cur.ep > +innerItem.ep && res.splice(res.findIndex((item => item.enName === cur.enName && item.season === cur.season)), 1, cur), res) : res.concat(cur); }), []), compareLocalData(myList, updateList) { const unTopIndex = myList.findIndex((ele => !ele.isTop)), difference = []; return updateList.forEach((updateItem => { const index = myList.findIndex((item => item.enName === updateItem.enName && item.season === updateItem.season)); if (-1 !== index) { const tempItem = { ...myList[index], ...updateItem }; myList[index].isTop ? myList.splice(index, 1, tempItem) : (myList.splice(index, 1), myList.splice(unTopIndex, 0, tempItem)); } else difference.push(updateItem); })), myList.splice(unTopIndex, 0, difference), [].concat.apply([], myList); }, async getDramaName(url) { try { const result = await Common.request({ url: `${window.location.origin}${url}`, type: "get" }), $result = $(result), name = $result.find(".post-title").text(), types = []; return $result.find(".meta_categories .cat-links a").text((function(index, oldcontent) { types.push(oldcontent); })), { name: name, category: types.join(",") }; } catch (error) { return {}; } } }; const Historyvue_type_script_setup_true_lang_js_hoisted_1 = { class: "col_list-ul" }, Historyvue_type_script_setup_true_lang_js_hoisted_2 = { class: "col_item-left" }, Historyvue_type_script_setup_true_lang_js_hoisted_3 = { class: "col_item-tags" }, _hoisted_4 = [ "innerHTML", "onClick" ], _hoisted_5 = [ "innerHTML", "onClick" ], _hoisted_6 = [ "innerHTML" ], _hoisted_7 = { key: 3, class: "col_item-index" }, _hoisted_8 = [ "href" ], _hoisted_9 = { class: "col_item-right" }, _hoisted_10 = [ "innerHTML", "onClick" ]; var Historyvue_type_script_setup_true_lang_js = { name: "History", props: { title: { type: String, required: !0 } }, setup(__props) { let hisList = (0, external_Vue_namespaceObject.ref)([]); (0, external_Vue_namespaceObject.onBeforeMount)((() => { getHis(); })), (0, external_Vue_namespaceObject.watch)(hisList, ((newVal, oldVal) => { LocalHistory.setLocalHistory((0, external_Vue_namespaceObject.toRaw)(newVal)); }), { deep: !0 }), document.addEventListener("visibilitychange", (async function() { "visible" == document.visibilityState && getHis(); })); const getHis = async () => { hisList.value = await LocalHistory.getLocalHistory(); }, filterHisList = (0, external_Vue_namespaceObject.computed)((() => hisList.value.filter((item => !item.deleteInfo || (item.ep !== item.deleteInfo.ep || item.ep === item.deleteInfo.ep && item.val !== item.deleteInfo.val))))), topLength = (0, external_Vue_namespaceObject.computed)((() => filterHisList.value.filter((ele => ele.isTop)).length)), formatSeason = item => item.season ? `S${item.season}` : "", formatEP = item => item.category?.includes("电影") ? "" : item.ep ? `E${item.ep}` : "", formatTimeStr = item => 215999 == +item.val ? "已看完" : 0 == +item.val ? "未观看" : formatTime(item.val), cancelTop = item => { if (!item.isTop) return; const hisItem = hisList.value.find((ele => ele.key === item.key)); let newItem = hisList.value.splice(hisList.value.findIndex((ele => ele.key === hisItem.key)), 1)[0]; newItem = { ...newItem, ...item, isTop: !1 }; const unTopIndex = hisList.value.findIndex((ele => !ele.isTop)); hisList.value.splice(unTopIndex, 0, newItem); }, formatTime = time => { const hour = parseInt(time / 3600) > 0 ? parseInt(time / 3600) : 0, min = parseInt((time - 3600 * hour) / 60) > 0 ? parseInt((time - 3600 * hour) / 60) : 0, sec = parseInt(time - 3600 * hour - 60 * min); return `${hour > 9 ? hour : "0" + hour}:${min > 9 ? min : "0" + min}:${sec > 9 ? sec : "0" + sec}`; }; return (_ctx, _cache) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)(external_Vue_namespaceObject.Fragment, null, [ (0, external_Vue_namespaceObject.createElementVNode)("h6", null, (0, external_Vue_namespaceObject.toDisplayString)(__props.title), 1), (0, external_Vue_namespaceObject.createElementVNode)("ul", Historyvue_type_script_setup_true_lang_js_hoisted_1, [ ((0, external_Vue_namespaceObject.openBlock)(!0), (0, external_Vue_namespaceObject.createElementBlock)(external_Vue_namespaceObject.Fragment, null, (0, external_Vue_namespaceObject.renderList)((0, external_Vue_namespaceObject.unref)(filterHisList), ((item, index) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("li", { class: "col_item", key: item.url }, [ (0, external_Vue_namespaceObject.createElementVNode)("span", Historyvue_type_script_setup_true_lang_js_hoisted_2, [ (0, external_Vue_namespaceObject.createElementVNode)("span", Historyvue_type_script_setup_true_lang_js_hoisted_3, [ item.isTop ? ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("i", { key: 0, class: "icon_top", innerHTML: (0, external_Vue_namespaceObject.unref)(' 取消置顶 '), onClick: $event => cancelTop(item) }, null, 8, _hoisted_4)) : ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("i", { key: 1, class: "icon_top", innerHTML: (0, external_Vue_namespaceObject.unref)(' 置顶 '), onClick: $event => (item => { const hisItem = hisList.value.find((ele => ele.key === item.key)); hisItem.isTop = !0, hisList.value.unshift(hisList.value.splice(hisList.value.findIndex((ele => ele.key === hisItem.key)), 1)[0]); })(item) }, null, 8, _hoisted_5)), item.isTop ? ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("i", { key: 2, class: "icon_top_tag", innerHTML: (0, external_Vue_namespaceObject.unref)(' ') }, null, 8, _hoisted_6)) : ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("span", _hoisted_7, (0, external_Vue_namespaceObject.toDisplayString)(index + 1 - (0, external_Vue_namespaceObject.unref)(topLength)), 1)) ]), (0, external_Vue_namespaceObject.createElementVNode)("a", { href: item.url }, (0, external_Vue_namespaceObject.toDisplayString)(item.name) + " " + (0, external_Vue_namespaceObject.toDisplayString)(formatSeason(item)) + (0, external_Vue_namespaceObject.toDisplayString)(formatEP(item)), 9, _hoisted_8) ]), (0, external_Vue_namespaceObject.createElementVNode)("div", _hoisted_9, [ (0, external_Vue_namespaceObject.createElementVNode)("i", { class: "icon_del", innerHTML: (0, external_Vue_namespaceObject.unref)(iconDelete), onClick: (0, external_Vue_namespaceObject.withModifiers)(($event => (item => { item.deleteInfo = { ep: item.ep, val: item.val, t: Date.now() }, cancelTop(item); })(item)), [ "stop" ]) }, null, 8, _hoisted_10), (0, external_Vue_namespaceObject.createElementVNode)("span", { class: (0, external_Vue_namespaceObject.normalizeClass)([ "his_time", { his_time_end: +item.val === (0, external_Vue_namespaceObject.unref)(215999) } ]) }, (0, external_Vue_namespaceObject.toDisplayString)(formatTimeStr(item)), 3) ]) ])))), 128)) ]) ], 64)); } }, Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css = __webpack_require__(646), Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css_options = {}; Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css_options.styleTagTransform = styleTagTransform_default(), Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css_options.setAttributes = setAttributesWithoutAttributes_default(), Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css_options.insert = insertBySelector_default().bind(null, "head"), Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css_options.domAPI = styleDomAPI_default(), Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css_options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css.Z, Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css_options), Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css.Z && Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css.Z.locals && Historyvue_type_style_index_0_id_0a142c44_scoped_true_lang_css.Z.locals; var History = (0, exportHelper.Z)(Historyvue_type_script_setup_true_lang_js, [ [ "__scopeId", "data-v-0a142c44" ] ]); const Settingsvue_type_script_setup_true_lang_js_hoisted_1 = { class: "col_list-ul" }, Settingsvue_type_script_setup_true_lang_js_hoisted_2 = { class: "pretty p-switch p-fill" }, Settingsvue_type_script_setup_true_lang_js_hoisted_3 = [ "onUpdate:modelValue" ], Settingsvue_type_script_setup_true_lang_js_hoisted_4 = (0, external_Vue_namespaceObject.createElementVNode)("div", { class: "state p-primary" }, [ (0, external_Vue_namespaceObject.createElementVNode)("label") ], -1); var vue_Settings = { name: "Settings", props: { title: { type: String, required: !0 } }, setup(__props) { const settingsList = (0, external_Vue_namespaceObject.ref)(Settings.getList()); document.addEventListener("visibilitychange", (async function() { "visible" == document.visibilityState && (settingsList.value = Settings.getList()); })); const handleChange = () => { Settings.setList(settingsList.value); }; return (_ctx, _cache) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)(external_Vue_namespaceObject.Fragment, null, [ (0, external_Vue_namespaceObject.createElementVNode)("h6", null, (0, external_Vue_namespaceObject.toDisplayString)(__props.title), 1), (0, external_Vue_namespaceObject.createElementVNode)("ul", Settingsvue_type_script_setup_true_lang_js_hoisted_1, [ ((0, external_Vue_namespaceObject.openBlock)(!0), (0, external_Vue_namespaceObject.createElementBlock)(external_Vue_namespaceObject.Fragment, null, (0, external_Vue_namespaceObject.renderList)(settingsList.value, ((item, index) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("li", { class: "col_item", key: index }, [ (0, external_Vue_namespaceObject.createElementVNode)("span", null, (0, external_Vue_namespaceObject.toDisplayString)(item.name), 1), (0, external_Vue_namespaceObject.createElementVNode)("div", Settingsvue_type_script_setup_true_lang_js_hoisted_2, [ (0, external_Vue_namespaceObject.withDirectives)((0, external_Vue_namespaceObject.createElementVNode)("input", { type: "checkbox", "onUpdate:modelValue": $event => item.val = $event, onChange: handleChange }, null, 40, Settingsvue_type_script_setup_true_lang_js_hoisted_3), [ [ external_Vue_namespaceObject.vModelCheckbox, item.val ] ]), Settingsvue_type_script_setup_true_lang_js_hoisted_4 ]) ])))), 128)) ]) ], 64)); } }; const AutoPlayNext = { player: null, playerModel: {}, init() { this.initPlayer(), this.bindEvent(); }, initPlayer() { this.player = WD.videojs?.getAllPlayers()[0], console.time("视频源数据加载完成"), this.player?.one("loadedmetadata", (e => { console.log("获取资源长度完成"); const playerCatch = this.player.getCache(); playerCatch.duration >= 10 && playerCatch.duration <= 20 && this.player.currentTime(playerCatch.duration); })), this.player?.one("canplaythrough", (async e => { console.timeEnd("视频源数据加载完成"), await Common.sleep(50), this.restoreVideoModel(); })), this.player?.on("ended", (async () => { if (console.log("ended"), console.log("autonext:", Settings.getValueById(1)), console.log("lastEp:", this.isLastEP()), Settings.getValueById(1)) { if (await Common.sleep(10), this.isLastEP()) return this.setResume(215999); this.handleToNext(); } })); }, bindEvent() { $(WD.document).on("click", ".wp-playlist-tracks .wp-playlist-item", (async e => { e.originalEvent && (this.getCurrentVideoModel(), await Common.sleep(50), this.initPlayer()); })), $(WD.document).on("click", ".vjs-control.icon-angle-right", (async e => { this.getCurrentVideoModel(), await Common.sleep(50), $(document.documentElement).css("overflow", "visible"), this.initPlayer(), this.handleToPlay(); })), $(document).on("keyup", (event => { var keyCode = event.keyCode || event.which || event.charCode, ctrlKey = event.ctrlKey || event.metaKey; ctrlKey && 39 === keyCode && (event.preventDefault(), this.handleToNext()), ctrlKey && 37 === keyCode && (event.preventDefault(), this.handleToPrev()); })); }, getCurrentVideoModel() { this.playerModel = { isFullscreen: this.player.isFullscreen(), isInPictureInPicture: !!document.pictureInPictureElement, isFullWindow: "hidden" === $(document.documentElement).css("overflow") }; }, async handleToNext() { this.getCurrentVideoModel(), (this.player.controlBar.getChild("NextButton") || {}).handleClick(), await Common.sleep(50), $(document.documentElement).css("overflow", "visible"), this.initPlayer(), this.handleToPlay(); }, async handleToPrev() { this.getCurrentVideoModel(), $(".wp-playlist-item.wp-playlist-playing").prev().trigger("click"), await Common.sleep(50), $(document.documentElement).css("overflow", "visible"), this.initPlayer(), this.handleToPlay(); }, handleToPlay() { this.player.resumeModal?.opened() ? this.player.resumeModal.getChild("ModalButtons").getChild("ResumeButton").el().click() : (this.player.bigPlayButton?.el().click(), this.setResume(0)); }, async restoreVideoModel() { this.playerModel.isFullscreen ? $(".vjs-fullscreen-control").trigger("click") : this.playerModel.isInPictureInPicture ? $(".vjs-picture-in-picture-control").trigger("click") : this.playerModel.isFullWindow && $(".vjs-theater-mode-control-open").trigger("click"); }, isLastEP: () => $(".wp-playlist-item:last-child").hasClass("wp-playlist-playing"), setResume(value = 0) { localStorage.setItem(window.location.href.replace(window.location.origin, "videojs-resume:"), value); } }, Paginationvue_type_script_setup_true_lang_js_hoisted_1 = { class: "ddrk-tools__pagination" }, Paginationvue_type_script_setup_true_lang_js_hoisted_2 = [ "title" ], Paginationvue_type_script_setup_true_lang_js_hoisted_3 = [ "innerHTML" ], Paginationvue_type_script_setup_true_lang_js_hoisted_4 = [ "title" ], Paginationvue_type_script_setup_true_lang_js_hoisted_5 = [ "innerHTML" ]; var Paginationvue_type_script_setup_true_lang_js = { name: "Pagination", setup(__props) { const PAGE_MAIN = { prev: "上一页", next: "下一页", prevClick: () => { $(".page-numbers.prev")[0]?.click(); }, nextClick: () => { $(".page-numbers.next")[0]?.click(); } }, PAGE_PLAYER = { prev: "上一集", next: "下一集", prevClick: () => { AutoPlayNext.handleToPrev(); }, nextClick: () => { AutoPlayNext.handleToNext(); } }, isShowLeft = (0, external_Vue_namespaceObject.ref)(!0), isShowRight = (0, external_Vue_namespaceObject.ref)(!0), current = (0, external_Vue_namespaceObject.ref)({}); (0, external_Vue_namespaceObject.onMounted)((() => { !!$("#vjsp").length ? current.value = PAGE_PLAYER : (current.value = PAGE_MAIN, isShowLeft.value = !!$(".page-numbers.prev").length, isShowRight.value = !!$(".page-numbers.next").length), $(document).mousemove((() => fadeToggle())), Settings.getValueById(6) && fadeToggle(); })); const isShow = (0, external_Vue_namespaceObject.ref)(!1); let timeId = -1; const fadeToggle = () => { Settings.getValueById(6) && (isShow.value = !0, clearTimeout(timeId), timeId = setTimeout((() => { isShow.value = !1; }), 3e3)); }; return (_ctx, _cache) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("div", Paginationvue_type_script_setup_true_lang_js_hoisted_1, [ (0, external_Vue_namespaceObject.createVNode)(external_Vue_namespaceObject.Transition, { name: "Fade" }, { default: (0, external_Vue_namespaceObject.withCtx)((() => [ isShow.value && isShowLeft.value ? ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("div", { key: 0, title: current.value.prev, class: "pagination-btn pagination-left", onClick: _cache[0] || (_cache[0] = (...args) => current.value.prevClick && current.value.prevClick(...args)) }, [ (0, external_Vue_namespaceObject.createElementVNode)("i", { innerHTML: (0, external_Vue_namespaceObject.unref)(' ') }, null, 8, Paginationvue_type_script_setup_true_lang_js_hoisted_3) ], 8, Paginationvue_type_script_setup_true_lang_js_hoisted_2)) : (0, external_Vue_namespaceObject.createCommentVNode)("v-if", !0) ])), _: 1 }), (0, external_Vue_namespaceObject.createVNode)(external_Vue_namespaceObject.Transition, { name: "Fade" }, { default: (0, external_Vue_namespaceObject.withCtx)((() => [ isShow.value && isShowRight.value ? ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("div", { key: 0, title: current.value.next, class: "pagination-btn pagination-right", onClick: _cache[1] || (_cache[1] = (...args) => current.value.nextClick && current.value.nextClick(...args)) }, [ (0, external_Vue_namespaceObject.createElementVNode)("i", { innerHTML: (0, external_Vue_namespaceObject.unref)(' ') }, null, 8, Paginationvue_type_script_setup_true_lang_js_hoisted_5) ], 8, Paginationvue_type_script_setup_true_lang_js_hoisted_4)) : (0, external_Vue_namespaceObject.createCommentVNode)("v-if", !0) ])), _: 1 }) ])); } }, Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css = __webpack_require__(419), Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css_options = {}; Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css_options.styleTagTransform = styleTagTransform_default(), Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css_options.setAttributes = setAttributesWithoutAttributes_default(), Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css_options.insert = insertBySelector_default().bind(null, "head"), Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css_options.domAPI = styleDomAPI_default(), Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css_options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css.Z, Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css_options), Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css.Z && Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css.Z.locals && Paginationvue_type_style_index_0_id_40ae7db4_scoped_true_lang_css.Z.locals; var Pagination = (0, exportHelper.Z)(Paginationvue_type_script_setup_true_lang_js, [ [ "__scopeId", "data-v-40ae7db4" ] ]); const appvue_type_script_setup_true_lang_js_hoisted_1 = { class: "ddrk-tools-container" }; var appvue_type_script_setup_true_lang_js = { name: "app", setup: __props => (_ctx, _cache) => ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createElementBlock)("div", appvue_type_script_setup_true_lang_js_hoisted_1, [ (0, external_Vue_namespaceObject.createVNode)(Container, null, { default: (0, external_Vue_namespaceObject.withCtx)((({type: type}) => [ 1 === type ? ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createBlock)(Collection, { key: 0, title: "收藏夹" })) : 2 === type ? ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createBlock)(History, { key: 1, title: "观看记录" })) : 3 === type ? ((0, external_Vue_namespaceObject.openBlock)(), (0, external_Vue_namespaceObject.createBlock)(vue_Settings, { key: 2, title: "设置" })) : (0, external_Vue_namespaceObject.createCommentVNode)("v-if", !0) ])), _: 1 }), (0, external_Vue_namespaceObject.createVNode)(Pagination) ])) }, appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css = __webpack_require__(207), appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css_options = {}; appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css_options.styleTagTransform = styleTagTransform_default(), appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css_options.setAttributes = setAttributesWithoutAttributes_default(), appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css_options.insert = insertBySelector_default().bind(null, "head"), appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css_options.domAPI = styleDomAPI_default(), appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css_options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css.Z, appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css_options), appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css.Z && appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css.Z.locals && appvue_type_style_index_0_id_08e03ab6_scoped_true_lang_css.Z.locals; var app = (0, exportHelper.Z)(appvue_type_script_setup_true_lang_js, [ [ "__scopeId", "data-v-08e03ab6" ] ]); const MessageBox = { init() { $("body").append('
'); }, $popover({target: target, html: html, timeout: timeout = 8e3} = config) { $("#msg-box .msg-box_wrapper").html(`
${html}
`); const popover = new Popper.createPopper(target, $("#msg-box")[0], { placement: "top", modifiers: [ { name: "offset", options: { offset: [ 0, 10 ] } }, { name: "flip", options: { fallbackPlacements: [ "top", "bottom" ] } } ] }); setTimeout((() => { popover.destroy(), $("#msg-box .msg-box_wrapper").html(""); }), timeout); }, $confirm({target: target, html: html, confirmText: confirmText = "确定", cancelText: cancelText = "取消", showConfirm: showConfirm = !0, showCancel: showCancel = !0, confirmCallBack: confirmCallBack, cancelCallBack: cancelCallBack} = config) { const btns = `
\n ${showConfirm ? `` : ""}\n ${showCancel ? `` : ""}\n \n
`; $("#msg-box .msg-box_wrapper").html(`
${html + btns}
`); const popover = new Popper.createPopper(target, $("#msg-box")[0], { placement: "top", modifiers: [ { name: "offset", options: { offset: [ 0, 10 ] } }, { name: "flip", options: { fallbackPlacements: [ "top", "bottom" ] } } ] }); $("#msg-box .msg-box_wrapper").on("click", ".msg-box_btn-confirm", (e => { confirmCallBack?.(popover); })), $("#msg-box .msg-box_wrapper").on("click", ".msg-box_btn-cancle", (e => { popover.destroy(), cancelCallBack?.(), $("#msg-box .msg-box_wrapper").html(""); })); } }, WatchRecord = { recordData: {}, init() { if (WD.videojs?.getAllPlayers()[0]) { if (this.initPlayer(), this.recordData = this.getRecord(), !Settings.getValueById(3)) return; const curPageInfo = this.parseUrl(), lastInfo = this.recordData[curPageInfo.enName]; if (lastInfo && (curPageInfo.season !== lastInfo?.season || curPageInfo.ep !== lastInfo?.ep)) { const season = lastInfo.season ? `S${lastInfo.season} - ` : "", ep = lastInfo.ep ? `E${lastInfo.ep}` : ""; MessageBox.$popover({ target: $("#vjsp_html5_api")[0], html: `上次观看到:${season}${ep}` }); } } }, initPlayer() { const player = WD.videojs?.getAllPlayers()[0]; player?.one("canplay", (() => this.setRecord())); }, getRecord: () => JSON.parse(Store_getValue("ddrk-tools-play-record") || "{}"), setRecord() { const escData = this.parseUrl(); (escData.ep > 1 || escData.season >= 1) && (this.recordData[escData.enName] = escData, Store_setValue("ddrk-tools-play-record", JSON.stringify(this.recordData))); }, parseUrl() { const info = window.location.pathname.split("/"); return { enName: info[1], season: info.length > 3 && !isNaN(info[2]) ? info[2] : $(".post-page-numbers").text() ? "1" : "", ep: new URL(location.href).searchParams.get("ep"), href: window.location.href.replace(window.location.origin, "") }; } }, PlayInSmallWindow = { player: null, isPlaying: !1, offsetTop: 0, eleHeight: 0, init() { WD.videojs?.getAllPlayers()[0] && (this.offsetTop = $(".wp-video-playlist").offset().top, this.eleHeight = $("#vjsp_html5_api").height(), this.initPlayer(), this.bindEvent(), $(".wp-video-playlist").prepend($('
'))); }, initPlayer() { this.player = WD.videojs?.getAllPlayers()[0], this.player?.on("playing", (() => { this.isPlaying = !0; })), this.player?.on("pause", (() => { this.isPlaying = !1; })), this.player?.on("ended", (() => { this.isPlaying = !1; })); }, bindEvent() { $(window).resize((() => { this.offsetTop = $(".wp-video-playlist").offset().top, this.eleHeight = $(".ddrk-tools__video-placeholder").height() || $("#vjsp_html5_api").height(); })), $(window).scroll((() => { if (!this.isPlaying && !$("#vjsp").hasClass("ddrk-tools__video-window-small")) return; if (this.offsetTop + .8 * this.eleHeight >= $(window).scrollTop() && this.offsetTop < $(window).scrollTop() + $(window).height()) $(".ddrk-tools__video-placeholder").css({ width: 0, height: 0 }), $("#vjsp").removeClass("ddrk-tools__video-window-small"); else if (!$("#vjsp").hasClass("ddrk-tools__video-window-small")) { if (!Settings.getValueById(4)) return; $(".ddrk-tools__video-placeholder").css({ width: "100%", height: $("#vjsp").outerHeight() }), $("#vjsp").addClass("ddrk-tools__video-window-small"); } })); } }; var iconDownload = ' '; const Download = { trackList: [], downloadClickable: !0, init() { WD.videojs?.getAllPlayers()[0] && ($(".wp-playlist-item").length && $(".wp-playlist-item").each((function() { $(this).append($(`${iconDownload}`)); })), this.bindEvent(), this.trackList = JSON.parse($("script.wp-playlist-script").text() || "{}").tracks || []); }, bindEvent() { const self = this; $(".wp-playlist-item .btn_download").on("click", (async function(e) { if (e.stopPropagation(), !self.downloadClickable) return; self.downloadClickable = !1, $(this).html(' '); const pageCaption = $(this).parent().find(".wp-playlist-caption").text(), targetItem = self.trackList.find((item => pageCaption.includes(item.caption))); let videoResult = {}, hasVtt = !0; const vttUrl = `${window.location.origin}/subddr${targetItem.subsrc}`; try { videoResult = 4 == +targetItem.srctype ? { url: `https://v.${window.location.hostname}${targetItem.src3}` } : await Common.request({ url: `${window.location.origin}/getvddr3/video?id=${targetItem.src1}&type=json`, type: "get" }), hasVtt = !!await Common.request({ url: vttUrl, type: "get" }); } catch (error) { console.log(error), hasVtt = !1; } finally { self.downloadClickable = !0, $(this).html(iconDownload); } const fileName = self.getFileName($(this)); if (Settings.getValueById(5)) { if (!videoResult.url) return void MessageBox.$popover({ target: $(this)[0], html: "无法获取视频链接 请重试", timeout: 1e3 }); const a = document.createElement("a"); return a.href = videoResult.url, a.target = "_blank", a.click(), a.remove(), self.copyToBord(fileName), void (hasVtt && self.downloadVtt(vttUrl, `${fileName}.vtt`)); } MessageBox.$confirm({ html: videoResult.url ? `>视频地址<\n
\n ${hasVtt ? '>点击此处下载字幕<' : ""}\n
\n 下载方法:
\n 1、建议使用IDM、FDM等软件安装其浏览器插件后,点击链接下载
\n 2、右键链接另存为
\n 3、右键复制链接 去其它工具下载
\n ->点击视频地址会自动复制文件名<-
\n ` : "无法获取视频链接 请重试", target: $(this)[0], showConfirm: !!videoResult.url, confirmText: "复制文件名", cancelText: "关闭", confirmCallBack: popper => { self.copyToBord(fileName), $(".msg-box_btn-confirm").text("复制成功"); } }), $("#msg-box #download-video").on("mousedown", (e => (3 == e.which && self.copyToBord(fileName), 1 == e.which && self.copyToBord(fileName), !1))), $("#msg-box #download-vtt").on("click", (e => { self.downloadVtt(vttUrl, `${fileName}.vtt`); })); })); }, downloadVtt(url, name) { fetch(url).then((res => res.arrayBuffer())).then((arrayBuffer => { let eAB = arrayBuffer, wordArray = CryptoJS.lib.WordArray.create(eAB.slice(16)), hexStr = Array.prototype.map.call(new Uint8Array(eAB.slice(0, 16)), (x => ("00" + x.toString(16)).slice(-2))).join(""), wordArray2 = CryptoJS.enc.Hex.parse(hexStr), jsdec = CryptoJS.AES.decrypt({ ciphertext: wordArray }, wordArray2, { iv: wordArray2, mode: CryptoJS.mode.CBC }), binary_string = window.atob(jsdec.toString(CryptoJS.enc.Base64)), len = binary_string.length, bytes = new Uint8Array(len); for (let i = 0; i < len; i++) bytes[i] = binary_string.charCodeAt(i); let blobStr = pako.ungzip(bytes.buffer, { to: "string" }); blobStr = blobStr.replaceAll("‎", ""); const a = document.createElement("a"), objectUrl = window.URL.createObjectURL(new Blob([ blobStr ])); a.download = name, a.href = objectUrl, a.click(), window.URL.revokeObjectURL(objectUrl), a.remove(); })); }, getFileName(element) { const current = $(element).parent(), name = $(".post-title").text(), resName = name.indexOf("(") > -1 ? name.split("(")[0] : name; let season = $(".post-page-numbers.current").text(); season = season ? "S" + season : ""; return resName + season + (0 === $(".wp-playlist-item").length ? "" : "E" + (current.index() + 1)); }, copyToBord(text) { let copy = e => { e.preventDefault(), e.clipboardData.setData("text/plain", text), document.removeEventListener("copy", copy); }; document.addEventListener("copy", copy), document.execCommand("Copy"); } }, CurrentTime = { init() { this.refreshClass(), (0, external_Vue_namespaceObject.watch)(Settings.curList, ((newVal, oldVal) => { this.refreshClass(); }), { deep: !0 }); }, refreshClass() { Settings.getValueById(7) ? $(".wp-playlist").addClass("ddrk-tools__video") : $(".wp-playlist").removeClass("ddrk-tools__video"); } }, AdFix = { init() { this.refreshClass(), (0, external_Vue_namespaceObject.watch)(Settings.curList, ((newVal, oldVal) => { this.refreshClass(); }), { deep: !0 }), Object.defineProperty(HTMLDivElement.prototype, "clientHeight", { get: () => 130 }); }, refreshClass() { Settings.getValueById(9) ? $("body").removeClass("ddrk-tools__ad") : $("body").addClass("ddrk-tools__ad"); } }; var videojs_seek_buttons = __webpack_require__(647), videojs_seek_buttons_options = {}; videojs_seek_buttons_options.styleTagTransform = styleTagTransform_default(), videojs_seek_buttons_options.setAttributes = setAttributesWithoutAttributes_default(), videojs_seek_buttons_options.insert = insertBySelector_default().bind(null, "head"), videojs_seek_buttons_options.domAPI = styleDomAPI_default(), videojs_seek_buttons_options.insertStyleElement = insertStyleElement_default(); injectStylesIntoStyleTag_default()(videojs_seek_buttons.Z, videojs_seek_buttons_options), videojs_seek_buttons.Z && videojs_seek_buttons.Z.locals && videojs_seek_buttons.Z.locals; const OPTIONS_DEFAULT = { forward: 10, back: 10 }, SeekButton = { player: null, enabled: !0, init() { __webpack_require__(256), this.enabled = Settings.getValueById(8), this.initPlayer(), (0, external_Vue_namespaceObject.watch)(Settings.curList, ((newVal, oldVal) => { this.enabled !== Settings.getValueById(8) && (this.enabled = Settings.getValueById(8), this.refreshButtons()); }), { deep: !0 }); }, initPlayer() { this.player = WD.videojs?.getAllPlayers()[0], this.enabled && this.player?.seekButtons(OPTIONS_DEFAULT); }, refreshButtons() { (this.player?.controlBar.children() || []).filter((item => "SeekButton" === item.name())).forEach((element => { this.player?.controlBar.removeChild(element); })), this.enabled && this.player?.seekButtons(OPTIONS_DEFAULT); } }; (async () => { console.log("\n %c ddrk-tools.js v1.4.8 \n", "color: #fadfa3; background: #030307; padding:5px 0;"), $("head").append(''), await Common.ready(); const html = `
  • NSFW
  • `; if ($("#menu-item-12055").after(html), $("body").append($('
    ')), window.$vueApp = (0, external_Vue_namespaceObject.createApp)(app), window.$vueApp.mount("#ddrk-tools"), MessageBox.init(), Settings.init(), LocalCollection.init(), CurrentTime.init(), AdFix.init(), await Common.sleep(500), AutoPlayNext.init(), WatchRecord.init(), PlayInSmallWindow.init(), Download.init(), SeekButton.init(), null != history.replaceState) { let _replaceState = history.replaceState; history.replaceState = function() { return setTimeout((() => { console.log("history changed"), WatchRecord.initPlayer(), PlayInSmallWindow.initPlayer(), SeekButton.initPlayer(), Download.bindEvent(); }), 0), _replaceState.apply(history, arguments); }; } })(); }(); }();