115+

为115网盘添加一些功能

  1. // ==UserScript==
  2. // @name 115+
  3. // @namespace https://github.com/lvzhenbo/115-plus
  4. // @version 1.2.7
  5. // @author lvzhenbo
  6. // @description 为115网盘添加一些功能
  7. // @license MIT
  8. // @icon https://115.com/favicon.ico
  9. // @supportURL https://github.com/lvzhenbo/115-plus/issues
  10. // @match https://115.com/*
  11. // @require https://cdn.jsdelivr.net/npm/vue@3.5.13/dist/vue.global.prod.js
  12. // @require data:application/javascript,%3Bwindow.Vue%3DVue%3B
  13. // @require https://cdn.jsdelivr.net/npm/naive-ui@2.41.0/dist/index.prod.js
  14. // @require https://cdn.jsdelivr.net/npm/xgplayer@3.0.21/dist/index.min.js
  15. // @require https://cdn.jsdelivr.net/npm/xgplayer-hls.js@3.0.21/dist/index.min.js
  16. // @require https://cdn.jsdelivr.net/npm/big-integer@1.6.52/BigInteger.min.js
  17. // @require https://cdn.jsdelivr.net/npm/crypto-js@4.2.0/crypto-js.min.js
  18. // @connect 115.com
  19. // @connect 115vod.com
  20. // @grant GM_addStyle
  21. // @grant GM_cookie
  22. // @grant GM_getValue
  23. // @grant GM_info
  24. // @grant GM_openInTab
  25. // @grant GM_setValue
  26. // @grant GM_xmlhttpRequest
  27. // ==/UserScript==
  28.  
  29. (e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const r=document.createElement("style");r.textContent=e,document.head.append(r)})(' @charset "UTF-8";[data-v-83bc69cf] .n-button__content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}.xgplayer.not-allow-autoplay .xgplayer-controls,.xgplayer.xgplayer-nostart .xgplayer-controls,.xgplayer.xgplayer-inactive .controls-autohide{pointer-events:none;visibility:hidden;cursor:default;opacity:0}.xgplayer.not-allow-autoplay .xgplayer-controls-initshow,.xgplayer.xgplayer-nostart .xgplayer-controls-initshow{pointer-events:auto;visibility:visible;opacity:1}.xgplayer .xgplayer-controls{display:block;position:absolute;visibility:visible;height:48px;left:0;right:0;bottom:0;opacity:1;z-index:10;background-image:linear-gradient(180deg,transparent,rgba(0,0,0,.37),rgba(0,0,0,.75),rgba(0,0,0,.75));transition:opacity .5s ease,visibility .5s ease}.xgplayer .xgplayer-controls.show{display:block;opacity:1;visibility:visible;pointer-events:auto}.xgplayer .xg-inner-controls{position:absolute;height:40px;bottom:0;justify-content:space-between;display:flex}.xgplayer .xg-left-grid,.xgplayer .xg-right-grid{position:relative;display:flex;flex-wrap:wrap;flex-shrink:1;height:100%;z-index:1}.xgplayer .xg-right-grid{flex-direction:row-reverse}.xgplayer .xg-right-grid>:first-child{margin-right:0}.xgplayer .xg-right-grid xg-icon{margin-left:0}.xgplayer .xg-left-grid>:first-child{margin-left:0}.xgplayer .xg-left-grid xg-icon{margin-right:0}.xgplayer .xg-center-grid{display:block;position:absolute;left:0;right:0;outline:none;top:-20px;padding:5px 0;text-align:center}.xgplayer .flex-controls .xg-inner-controls{justify-content:space-around;display:flex;bottom:8px}.xgplayer .flex-controls .xg-center-grid{display:flex;flex:1;position:relative;top:0;height:100%;justify-content:space-between;align-items:center;left:0;right:0;padding:0 16px}.xgplayer.xgplayer-mobile .xg-center-grid{z-index:2}.xgplayer.xgplayer-mobile .flex-controls .xg-center-grid{padding:0 8px}.xgplayer .bottom-controls .xg-center-grid{top:20px;padding:0}.xgplayer .bottom-controls .xg-left-grid,.xgplayer .bottom-controls .xg-right-grid{bottom:10px}.xgplayer .mini-controls{background-image:none}.xgplayer .mini-controls .xg-inner-controls{bottom:0;left:0;right:0}.xgplayer .mini-controls .xg-center-grid{bottom:-28px;top:auto;padding:0}.xgplayer .mini-controls .xg-left-grid,.xgplayer .mini-controls .xg-right-grid{display:none}.xgplayer .controls-follow{bottom:70px;transition:bottom .3s ease}.xgplayer.flex-controls .controls-follow{bottom:45px}.xgplayer.xgplayer-inactive .controls-follow,.xgplayer.no-controls .controls-follow,.xgplayer.mini-controls .controls-follow{bottom:10px}.xgplayer-fullscreen-parent{position:fixed;left:0;top:0;width:100%;height:100%;z-index:9999}.xgplayer-fullscreen-parent .xgplayer.xgplayer-is-cssfullscreen,.xgplayer-fullscreen-parent .xgplayer.xgplayer-is-fullscreen{z-index:10;position:absolute}.xgplayer-rotate-parent{position:fixed;top:0;left:100%;bottom:0;right:0;width:100vh;height:100vw;z-index:9999;transform-origin:top left;transform:rotate(90deg)}.xgplayer-rotate-parent .xgplayer.xgplayer-rotate-fullscreen{position:absolute;top:0;left:0;z-index:10;margin:0;padding:0;width:100%;height:100%;transform:rotate(0)}.xgplayer-rotate-parent .xgplayer-mobile video{z-index:-1}.xgplayer{position:relative;width:100%;height:100%;overflow:hidden;font-family:PingFang SC,Helvetica Neue,Helvetica,STHeiTi,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400;background:#000;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.xgplayer *{margin:0;padding:0;border:0;vertical-align:baseline;white-space:normal;word-wrap:normal;overflow-wrap:normal}.xgplayer ul,.xgplayer li{list-style:none}.xgplayer .xgplayer-none{display:none}.xgplayer.xgplayer-is-fullscreen{position:fixed;top:0;left:0;width:100%;height:100%;margin:0;padding:0;z-index:9999}.xgplayer.xgplayer-is-cssfullscreen{position:fixed;left:0;top:0;width:100%;height:100%;z-index:9999}.xgplayer.xgplayer-rotate-fullscreen{position:fixed;top:0;left:100%;bottom:0;right:0;width:100vh;height:100vw;transform-origin:top left;transform:rotate(90deg);z-index:9999}.xgplayer.xgplayer-rotate-fullscreen.xgplayer-mobile video{z-index:-1}.xgplayer xg-video-container.xg-video-container{position:absolute;top:0;bottom:48px;display:block;width:100%}.xgplayer video{position:absolute;top:0;left:0;width:100%;height:100%;outline:none}.xgplayer[data-xgfill=contain] video{-o-object-fit:contain;object-fit:contain}.xgplayer[data-xgfill=cover] video{-o-object-fit:cover;object-fit:cover}.xgplayer[data-xgfill=fill] video{-o-object-fit:fill;object-fit:fill}.xgplayer .xg-pos{left:10px;right:10px}.xgplayer .xg-margin{margin-left:16px;margin-right:16px}.xgplayer .xg-bottom{bottom:0}.xgplayer .btn-text{position:relative;top:50%;height:24px;font-size:13px;text-align:center}.xgplayer .btn-text span{display:inline-block;min-width:52px;height:24px;line-height:24px;background:#00000061;border-radius:12px}.xgplayer xg-icon{position:relative;box-sizing:border-box;height:40px;margin-left:16px;margin-right:16px;cursor:pointer;color:#fffc;fill:#fff}.xgplayer xg-icon.xg-icon-disable{cursor:not-allowed}.xgplayer xg-icon .xg-tips{top:-30px;left:50%;transform:translate(-50%)}.xgplayer xg-icon:active .xg-tips,.xgplayer xg-icon:hover .xg-tips{display:block}.xgplayer xg-icon:active .xg-tips.hide,.xgplayer xg-icon:hover .xg-tips.hide{display:none}.xgplayer xg-icon .xgplayer-icon{position:relative;top:50%;transform:translateY(-50%);cursor:pointer}.xgplayer xg-icon .xg-icon-disable{cursor:not-allowed}.xgplayer xg-icon .xg-img{width:100%}.xgplayer xg-icon svg,.xgplayer xg-icon img{height:100%;display:block}.xgplayer xg-bar{display:block}.xgplayer.xgplayer-inactive xg-bar,.xgplayer.xgplayer-mini xg-bar{display:none}.xgplayer.xgplayer-inactive .xg-top-bar{display:flex}.xgplayer.xgplayer-inactive .xg-top-bar.top-bar-autohide{display:none}.xgplayer .xg-top-bar{position:absolute;z-index:10;top:0;padding:0 16px;display:flex;height:50px}.xgplayer .xg-top-bar xg-icon{position:relative;top:10px;left:0;width:34px;margin-top:0}.xgplayer .xg-top-bar xg-icon:first-child{margin-left:0}.xgplayer .xg-left-bar,.xgplayer .xg-right-bar{position:absolute;z-index:9;top:50px;bottom:50px;width:50px}.xgplayer .xg-left-bar{left:0}.xgplayer .xg-right-bar{right:0}.xgplayer .xg-tips{display:none;position:absolute;padding:4px 6px;background:#0000008a;border-radius:4px;font-size:12px;color:#fff;text-align:center;white-space:nowrap;opacity:.85}.xgplayer .xg-margin{left:0;right:0}.xgplayer-mobile{-webkit-tap-highlight-color:rgba(0,0,0,0)}.xgplayer-mobile *{text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.xgplayer-mobile.xgplayer-rotate-fullscreen .xg-top-bar,.xgplayer-mobile.xgplayer-rotate-fullscreen .xg-pos{left:6%;right:6%}.xgplayer-mobile xg-icon:hover .xg-tips{display:none}.xg-list-slide-scroll::-webkit-scrollbar-track{background-color:transparent;display:none}.xg-list-slide-scroll:hover::-webkit-scrollbar-track{display:block}.xg-list-slide-scroll::-webkit-scrollbar{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#0000;height:4px;width:4px}.xg-list-slide-scroll::-webkit-scrollbar-corner{background:transparent;display:none}.xg-list-slide-scroll::-webkit-scrollbar-thumb{background:#ffffff80;border-radius:3px;display:none;width:4px}.xg-list-slide-scroll:hover::-webkit-scrollbar-thumb{display:block}@media only screen and (max-width: 480px){.xgplayer-mobile xg-icon{margin-right:10px;margin-left:10px}.xgplayer-mobile .xg-top-bar{left:10px;right:10px}}@media screen and (orientation: portrait){.xgplayer-mobile.xgplayer-is-fullscreen .xgplayer-controls,.xgplayer-mobile.xgplayer-is-cssfullscreen .xgplayer-controls{bottom:34px;bottom:constant(safe-area-inset-bottom);bottom:env(safe-area-inset-bottom)}.xgplayer-mobile.xgplayer-is-fullscreen .xg-top-bar,.xgplayer-mobile.xgplayer-is-cssfullscreen .xg-top-bar{top:34px;top:constant(safe-area-inset-top);top:env(safe-area-inset-top)}}@media only screen and (orientation: landscape){.xgplayer-mobile.xgplayer-is-fullscreen .xg-top-bar,.xgplayer-mobile.xgplayer-is-fullscreen .xg-pos{left:6%;right:6%}.xgplayer-mobile.xgplayer-rotate-fullscreen{left:0;width:100vw;height:100vh;transform:rotate(0)}}.xgplayer .xgplayer-screen-container{display:block;width:100%}.xgplayer .xg-options-icon{display:none;cursor:pointer}.xgplayer .xg-options-icon.show{display:block}@keyframes xg_right_options_active{0%{transform:translate(50%)}to{transform:translate(-50%)}}@keyframes xg_right_options_hide{0%{transform:translate(-50%)}to{transform:translate(50%)}}@keyframes xg_left_options_active{0%{transform:translate(-50%)}to{transform:translate(50%)}}@keyframes xg_left_options_hide{0%{transform:translate(50%)}to{transform:translate(-50%)}}.xgplayer .xg-options-list{display:none;position:absolute;z-index:5;width:78px;right:50%;bottom:100%;background:#0000008a;border-radius:1px;transform:translate(50%);cursor:pointer;overflow:auto;height:0;opacity:.85;font-size:14px;color:#fffc}.xgplayer .xg-options-list li{height:20px;line-height:20px;position:relative;padding:4px 0;text-align:center;color:#fffc}.xgplayer .xg-options-list li:hover,.xgplayer .xg-options-list li.selected{color:red;opacity:1}.xgplayer .xg-options-list li:nth-child(1){position:relative;margin-top:12px}.xgplayer .xg-options-list li:last-child{position:relative;margin-bottom:12px}.xgplayer .xg-options-list:hover{opacity:1}.xgplayer .xg-options-list.active{display:block;height:auto}.xgplayer .xg-options-list.xg-side-list{width:20%;height:100%;bottom:0;background:#000000e6;display:flex;flex-direction:column;box-sizing:border-box}.xgplayer .xg-options-list.xg-side-list li{flex:1;width:100%;padding:0;position:relative}.xgplayer .xg-options-list.xg-side-list li span{display:block;position:relative;top:50%;transform:translateY(-50%);pointer-events:none}.xgplayer .xg-options-list.xg-side-list li:nth-child(1){margin-top:20px}.xgplayer .xg-options-list.xg-side-list li:last-child{margin-bottom:20px}.xgplayer .xg-options-list.xg-right-side{right:-10.5%}.xgplayer .xg-options-list.xg-right-side.active{height:100%;animation:xg_right_options_active .2s ease-out forwards}.xgplayer .xg-options-list.xg-right-side.hide{height:100%;animation:xg_right_options_hide .2s ease-in forwards}.xgplayer .xg-options-list.xg-left-side{left:-10.5%;transform:translate(-50%)}.xgplayer .xg-options-list.xg-left-side.active{height:100%;animation:xg_left_options_active .2s ease-out forwards}.xgplayer .xg-options-list.xg-left-side.hide{height:100%;animation:xg_left_options_hide .2s ease-in forwards}@media only screen and (max-width: 480px){.xgplayer-mobile .xg-options-icon.portrait{display:none}.xgplayer-mobile .xg-options-list li:hover{color:#fffc}.xgplayer-mobile .xg-options-list li.selected{color:red}}.xgplayer-replay{display:none}.xgplayer .xgplayer-replay{display:none;position:absolute;left:50%;top:50%;width:100px;height:100px;justify-content:center;align-items:center;flex-direction:column;z-index:5;transform:translate(-50%,-50%);cursor:pointer}.xgplayer .xgplayer-replay .xgplayer-replay-txt{display:inline-block;font-size:14px;color:#fff;line-height:34px;text-align:center}.xgplayer.xgplayer-mobile .xgplayer-replay-svg{width:50px;height:50px}.xgplayer.xgplayer-mobile .xgplayer-replay-txt{line-height:24px;font-size:12px}.xgplayer .xgplayer-poster{display:block;opacity:1;visibility:visible;position:absolute;left:0;top:0;width:100%;height:100%;background-position:center center;background-size:100% auto;background-repeat:no-repeat;transition:opacity .3s ease,visibility .3s ease;pointer-events:none}.xgplayer .xgplayer-poster.hide,.xgplayer.xgplayer-playing .xgplayer-poster{opacity:0;visibility:hidden}.xgplayer.xgplayer-playing .xg-not-hidden,.xgplayer.xgplayer-is-enter .xgplayer-poster.xg-showplay,.xgplayer.xgplayer-playing .xgplayer-poster.xg-showplay,.xgplayer.xgplayer-nostart .xgplayer-poster,.xgplayer.xgplayer-ended .xgplayer-poster,.xgplayer.not-allow-autoplay .xgplayer-poster{opacity:1;visibility:visible}.xgplayer.xgplayer-nostart .xgplayer-poster.hide,.xgplayer.xgplayer-ended .xgplayer-poster.hide,.xgplayer.not-allow-autoplay .xgplayer-poster.hide{opacity:0;visibility:hidden}@keyframes playPause{0%{transform:scale(1);opacity:1}99%{transform:scale(1.3);opacity:0}to{transform:scale(1);opacity:0}}.xgplayer xg-start-inner{display:block;width:100%;height:100%;overflow:hidden;border-radius:50%;background:#00000061}.xgplayer .xgplayer-start{width:70px;height:70px;position:absolute;left:50%;top:50%;z-index:5;transform:translate(-50%,-50%);cursor:pointer}.xgplayer .xgplayer-start svg{width:100%;height:100%}.xgplayer .xgplayer-start.hide,.xgplayer .xgplayer-start.focus-hide{display:none;pointer-events:none}.xgplayer .xgplayer-start:hover{opacity:.85}.xgplayer .xgplayer-start .xg-icon-play{display:block}.xgplayer .xgplayer-start .xg-icon-pause,.xgplayer .xgplayer-start[data-state=pause] .xg-icon-play{display:none}.xgplayer .xgplayer-start[data-state=pause] .xg-icon-pause,.xgplayer .xgplayer-start.interact{display:block}.xgplayer .xgplayer-start.interact xg-start-inner{animation:playPause .4s .1s ease-out forwards}.xgplayer .xgplayer-start.show{display:block}.xgplayer.xgplayer-mobile xg-start-inner{background:initial;border-radius:0}.xgplayer.xgplayer-mobile .xgplayer-start{height:50px;width:50px}.xgplayer.xgplayer-mobile .xgplayer-start:hover{opacity:1}.xgplayer.xgplayer-inactive .xgplayer-start.auto-hide,.xgplayer.xgplayer-is-enter .xgplayer-start.auto-hide,.xgplayer.xgplayer-isloading.xgplayer-playing .xgplayer-start,.xgplayer.xgplayer-is-enter .xgplayer-start,.xgplayer.xgplayer-is-error .xgplayer-start,.xgplayer.xgplayer-is-enter .xgplayer-start.show,.xgplayer.xgplayer-is-error .xgplayer-start.show{display:none}.xgplayer-enter{display:none;position:absolute;left:0;top:0;width:100%;height:100%;background:#000c;z-index:5;pointer-events:none}.xgplayer-enter .show{display:block}.xgplayer-enter .xgplayer-enter-spinner{display:block;position:absolute;z-index:1;left:50%;top:50%;height:100px;width:100px;transform:translate(-50%,-50%)}.xgplayer-enter .xgplayer-enter-spinner div{width:6%;height:13%;background-color:#ffffffb3;position:absolute;left:45%;top:45%;opacity:0;border-radius:30px;animation:fade 1s linear infinite}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar1{transform:rotate(0) translateY(-140%);animation-delay:-0s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar2{transform:rotate(30deg) translateY(-140%);animation-delay:-.9163s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar3{transform:rotate(60deg) translateY(-140%);animation-delay:-.833s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar4{transform:rotate(90deg) translateY(-140%);animation-delay:-.7497s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar5{transform:rotate(120deg) translateY(-140%);animation-delay:-.6664s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar6{transform:rotate(150deg) translateY(-140%);animation-delay:-.5831s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar7{transform:rotate(180deg) translateY(-140%);animation-delay:-.4998s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar8{transform:rotate(210deg) translateY(-140%);animation-delay:-.4165s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar9{transform:rotate(240deg) translateY(-140%);animation-delay:-.3332s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar10{transform:rotate(270deg) translateY(-140%);animation-delay:-.2499s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar11{transform:rotate(300deg) translateY(-140%);animation-delay:-.1666s}.xgplayer-enter .xgplayer-enter-spinner div.xgplayer-enter-bar12{transform:rotate(330deg) translateY(-142%);animation-delay:-.0833s}@keyframes fade{0%{opacity:1}to{opacity:.25}}.xgplayer.xgplayer-is-enter .xgplayer-enter{display:block;opacity:1;transition:opacity .3s}.xgplayer.xgplayer-nostart .xgplayer-enter{display:none}.xgplayer.xgplayer-mobile .xgplayer-enter .xgplayer-enter-spinner{width:70px;height:70px}.xg-mini-layer{display:none;position:absolute;top:0;left:0;width:100%;height:100%;z-index:11;background:linear-gradient(180deg,#393939e6,#39393900 50.27%)}.xg-mini-layer .mask{pointer-events:none;position:absolute;top:0;left:0;height:100%;width:100%;background-color:#0006}.xg-mini-layer xg-mini-header{display:flex;top:0;left:0;right:40px;box-sizing:border-box;padding:10px 3px 0 8px;justify-content:space-between;color:#fff;font-size:14px;position:absolute;z-index:22}.xg-mini-layer xg-mini-header .xgplayer-pip-disableBtn{pointer-events:all}.xg-mini-layer xg-mini-header #disabledMini{display:none;position:relative}.xg-mini-layer xg-mini-header #disabledMini+label{cursor:pointer;position:relative;display:flex;align-items:center}.xg-mini-layer xg-mini-header #disabledMini+label:before{content:"";color:#ff142b;background-color:transparent;border-radius:2px;border:solid 1px #cdcdcd;width:16px;height:16px;display:inline-block;text-align:center;vertical-align:middle;line-height:16px;margin-right:7px}.xg-mini-layer xg-mini-header #disabledMini:checked+label{color:#ff142b}.xg-mini-layer xg-mini-header #disabledMini:checked+label:before{border-color:#ff142b}.xg-mini-layer xg-mini-header #disabledMini:checked+label:after{content:"";position:absolute;width:4px;height:8px;border-color:#ff142b;border-style:solid;border-width:0px 2px 2px 0px;transform:rotate(45deg);left:6px;top:5px}.xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn xg-tips{position:absolute;padding:4px 6px;white-space:nowrap;bottom:-30px;right:15px;border-radius:4px;background-color:#0000008a;display:none}.xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover #disabledMini+label:before{border-color:#ff142b}.xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover #disabledMini+label{color:#ff142b}.xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover xg-tips{display:block}.xg-mini-layer .mini-cancel-btn{cursor:pointer;display:block;color:#fff;width:40px;height:38px;position:absolute;right:0;top:0;text-align:center;line-height:38px}.xg-mini-layer .play-icon{cursor:pointer;height:48px;width:48px;position:absolute;background:#0000008a;border-radius:24px;top:50%;left:50%;margin:-24px 0 0 -24px}.xg-mini-layer .play-icon svg,.xg-mini-layer .play-icon img{width:50px;height:50px;fill:#faf7f7}.xg-mini-layer .xg-icon-play{display:none}.xg-mini-layer .xg-icon-pause,.xg-mini-layer[data-state=pause] .xg-icon-play{display:block}.xg-mini-layer[data-state=pause] .xg-icon-pause{display:none}.xgplayer-miniicon{position:relative;outline:none;display:block}.xgplayer-miniicon .name{text-align:center;font-size:13px;line-height:20px;height:20px;color:#fffc;line-height:40px}.xgplayer-miniicon .name span{font-size:13px;width:60px;height:20px;line-height:20px;background:#00000061;border-radius:10px;display:inline-block;vertical-align:middle}.xgplayer-mini{position:fixed;width:320px;height:180px;z-index:91;box-shadow:0 4px 7px 2px #0003}.xgplayer-mini:hover{cursor:move}.xgplayer-mini:hover .xg-mini-layer{display:block}.xgplayer-mini.xgplayer-ended .xg-mini-layer{display:none}.xgplayer-mobile .xg-mini-layer .play-icon{background:none;border-radius:initial}.xgplayer.xgplayer-inactive{cursor:none}.xgplayer xg-thumbnail{display:block}.xgplayer xg-trigger{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;top:0;left:0;height:100%;width:100%}.xgplayer xg-trigger .time-preview{display:none;position:absolute;width:200px;margin:0 auto;padding:0 20px 30px;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;text-shadow:0 0 1px rgba(0,0,0,.54);font-size:18px;text-align:center;pointer-events:none}.xgplayer xg-trigger .time-preview span{line-height:24px}.xgplayer xg-trigger .time-preview .xg-cur{color:red}.xgplayer xg-trigger .time-preview .xg-separator{font-size:14px}.xgplayer xg-trigger .time-preview .xg-seek-show{transform:translate(-10px)}.xgplayer xg-trigger .time-preview .xg-seek-show.xg-back .xg-seek-pre{transform:rotate(180deg) translate(-5px)}.xgplayer xg-trigger .time-preview .xg-seek-show.hide-seek-icon .xg-seek-icon{display:none}.xgplayer xg-trigger .time-preview .xg-bar{width:96px;height:2px;margin:8px auto 0;border-radius:10px;box-sizing:content-box;background:#ffffff4d}.xgplayer xg-trigger .time-preview .xg-bar .xg-curbar{width:0;height:100%;background-color:red}.xgplayer xg-trigger .time-preview .xg-bar.hide{display:none}.xgplayer xg-trigger .mobile-thumbnail{position:relative;left:50%;transform:translate(-50%)}.xgplayer xg-trigger .xg-top-note{position:absolute;height:32px;width:135px;top:26px;left:50%;margin-left:-78px;background:#0000004d;border-radius:100px;color:#fff}.xgplayer xg-trigger .xg-top-note span{display:block;line-height:32px;height:32px;font-size:13px;text-align:center}.xgplayer xg-trigger .xg-top-note i{color:red;margin:0 5px}.xgplayer xg-trigger .xg-playbackrate{display:none}.xgplayer xg-trigger[data-xg-action=seeking] .time-preview{display:block}.xgplayer xg-trigger[data-xg-action=playbackrate] .xg-playbackrate{display:block}.xgplayer .gradient{display:none;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none;background-image:linear-gradient(#0009,#0000005c 20%,#0000 36%,#0000 70%,#0000003d 77%,#0000005c 83%,#0009)}.xgplayer .gradient.top{background-image:linear-gradient(#0009,#0000005c 20%,#0000 36%,#0000 70%)}.xgplayer .gradient.bottom{background-image:linear-gradient(#0000 70%,#0000003d 77%,#0000005c 83%,#0009)}.xgplayer .gradient.none,.xgplayer-mobile .xgplayer-controls{background-image:initial}.xgplayer-mobile.xgplayer-playing .gradient{display:block}.xgplayer-mobile.xgplayer-inactive .gradient{background-image:initial}.xgplayer-mobile .xgmask{position:absolute;height:100%;z-index:10;top:0;left:0;width:100%;pointer-events:none;background-color:#0000}@media (prefers-color-scheme: dark){.xgplayer-mobile xg-trigger .time-preview{color:#fff}.xgplayer-mobile xg-trigger .time-preview span.xg-cur{color:red}.xgplayer-mobile xg-trigger .time-preview .xg-bar{background-color:#ffffff4d}.xgplayer-mobile xg-trigger .time-preview .xg-bar.xg-curbar{background-color:red}}@keyframes loadingRotate{0%{transform:rotate(0)}25%{transform:rotate(90deg)}50%{transform:rotate(180deg)}75%{transform:rotate(270deg)}to{transform:rotate(360deg)}}@keyframes loadingDashOffset{0%{stroke-dashoffset:236}to{stroke-dashoffset:0}}xg-loading-inner{display:block;height:100%;width:100%;transform-origin:center;animation:loadingRotate 1s .1s linear infinite}.xgplayer-loading{display:none;width:70px;height:70px;overflow:hidden;position:absolute;z-index:10;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none}.xgplayer-loading svg,.xgplayer-loading img{width:100%;height:100%}.xgplayer-mobile .xgplayer-loading{width:50px;height:50px}.xgplayer-isloading .xgplayer-loading{display:block}.xgplayer-nostart .xgplayer-loading,.xgplayer-pause .xgplayer-loading,.xgplayer-is-enter .xgplayer-loading,.xgplayer-is-ended .xgplayer-loading,.xgplayer-is-error .xgplayer-loading{display:none}.xgplayer .xgplayer-progress{display:flex;align-items:center;position:relative;min-width:10px;height:20px;left:0;right:0;top:0;outline:none;flex:1;cursor:pointer}.xgplayer .xgplayer-progress-outer{position:relative;width:100%;height:2px;border-radius:3px;cursor:pointer}.xgplayer .progress-list{display:flex;height:100%;width:100%;border-radius:inherit}.xgplayer .xgplayer-progress-inner{position:relative;flex:1;height:100%;background:#ffffff4d;transition:height .2s ease-in,opacity .2s ease-out;border-radius:inherit;margin-right:2px;pointer-events:none}.xgplayer .xgplayer-progress-inner:last-child,.xgplayer .xgplayer-progress-inner:only-child{margin-right:0}.xgplayer .inner-focus-point{background:#fff;position:relative}.xgplayer .inner-focus-point:before,.xgplayer .inner-focus-point:after{position:absolute;content:" ";display:block;width:2px;height:300%;top:50%;z-index:1;transform:translateY(-50%);border-radius:3px;background:#fff}.xgplayer .inner-focus-point:before{left:0}.xgplayer .inner-focus-point:after{right:0}.xgplayer .xgplayer-progress-cache,.xgplayer .xgplayer-progress-played{display:block;height:100%;width:0;position:absolute;top:0;left:0;border-radius:inherit}.xgplayer .xgplayer-progress-played{background:linear-gradient(-90deg,#fa1f41,#e31106)}.xgplayer .xgplayer-progress-cache{background:#ffffff80}.xgplayer .xgplayer-progress-btn{display:block;background:#ff5e5e4e;border:.5px solid rgba(255,94,94,.056545);box-shadow:0 0 1px #ff000062;width:20px;height:20px;border-radius:30px;left:0;top:50%;position:absolute;z-index:1;transform:translate(-50%,-50%);box-sizing:border-box;pointer-events:none}.xgplayer .xgplayer-progress-btn:before{content:" ";display:block;position:relative;width:12px;height:12px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:30px;background:#fff}.xgplayer .xgplayer-progress-btn.active{border:4px solid rgba(255,94,94,.064057)}.xgplayer .xgplayer-progress-btn.active:before{box-shadow:0 0 3px #f85959b0}.xgplayer .xgplayer-progress-dot{display:inline-block;position:absolute;height:100%;width:5px;top:0;background:#fff;border-radius:6px;z-index:16}.xgplayer .xgplayer-progress-dot .xgplayer-progress-tip{position:absolute;left:25%;top:-40px;height:auto;line-height:30px;width:auto;transform:scale(.8) translate(-50%);background:#0000004d;border-radius:6px;border:1px solid rgba(0,0,0,.8);cursor:default;white-space:nowrap;display:none}.xgplayer .xgplayer-progress-dot:hover .xgplayer-progress-tip{display:block}.xgplayer .flex-controls .xgplayer-progress{transform:translateY(0)}.xgplayer.xgplayer-pc .xgplayer-progress-btn{transform:translate(-50%,-50%) scale(0)}.xgplayer.xgplayer-pc .xgplayer-progress-outer{height:3px}.xgplayer.xgplayer-pc .xgplayer-progress-inner{margin-right:4px}.xgplayer.xgplayer-pc .xgplayer-progress-inner:last-child,.xgplayer.xgplayer-pc .xgplayer-progress-inner:only-child{margin-right:0}.xgplayer.xgplayer-pc .inner-focus-point:before,.xgplayer.xgplayer-pc .inner-focus-point:after{width:3px}.xgplayer.xgplayer-pc .inner-focus-highlight{background:#fffc}.xgplayer.xgplayer-pc .xgplayer-progress.active .xgplayer-progress-outer{height:6px;margin-bottom:3px;transition:height .3s ease,margin-bottom .3s ease}.xgplayer.xgplayer-pc .xgplayer-progress.active .xgplayer-progress-btn{transform:translate(-50%,-50%) scale(1)}.xgplayer.xgplayer-pc .xgplayer-progress.active .inner-focus-point:before,.xgplayer.xgplayer-pc .xgplayer-progress.active .inner-focus-point:after{width:6px}.xgplayer .xgplayer-progress-bottom .xgplayer-progress-outer{top:9px}.xgplayer .xgplayer-progress-bottom .xgplayer-progress-btn:before{height:6px;width:6px}.xgplayer.xgplayer-mobile .xgplayer-progress-bottom .xgplayer-progress-outer{height:4px}@media (prefers-color-scheme: dark){.xgplayer .xgplayer-progress .xgplayer-progress-inner{background-color:#ffffff4d}.xgplayer .xgplayer-progress .inner-focus-highlight{background:#fffc}.xgplayer .xgplayer-progress .xgplayer-progress-btn{background:#ff5e5e4e;border:.5px solid rgba(255,94,94,.056545);box-shadow:0 0 1px #ff000062}.xgplayer .xgplayer-progress .xgplayer-progress-btn:before{background-color:#fff}.xgplayer .xgplayer-progress .xgplayer-progress-played{background-color:linear-gradient(-90deg,#FA1F41 0%,#E31106 100%)}.xgplayer .xgplayer-progress .xgplayer-progress-cache{background-color:#ffffff80}}.xg-mini-progress{display:none;position:absolute;height:2px;left:0;right:0;bottom:0;pointer-events:none}.xg-mini-progress xg-mini-progress-played,.xg-mini-progress xg-mini-progress-cache{height:100%;width:0;position:absolute;top:0;left:0;border-radius:inherit}.xg-mini-progress xg-mini-progress-played{background:linear-gradient(-90deg,#fa1f41,#e31106)}.xg-mini-progress xg-mini-progress-cache{background:#ffffff80}.xg-mini-progress-show,.xgplayer-inactive .xg-mini-progress,.xgplayer-mini .xg-mini-progress{display:block}.xgplayer .xgplayer-play .xg-icon-play{display:none}.xgplayer .xgplayer-play .xg-icon-pause,.xgplayer .xgplayer-play[data-state=pause] .xg-icon-play{display:block}.xgplayer .xgplayer-play[data-state=pause] .xg-icon-pause,.xgplayer .xgplayer-fullscreen .xg-exit-fullscreen{display:none}.xgplayer .xgplayer-fullscreen .xg-get-fullscreen,.xgplayer .xgplayer-fullscreen[data-state=full] .xg-exit-fullscreen{display:block}.xgplayer .xgplayer-fullscreen[data-state=full] .xg-get-fullscreen{display:none}.xgplayer .xg-top-bar .xgplayer-back{position:relative;left:0;top:16px;width:34px;height:40px;display:none}.xgplayer .xg-top-bar .xgplayer-back.show{display:block}.xgplayer .xgplayer-time{pointer-events:none;min-width:40px;font-size:14px;font-family:PingFangSC-Semibold;color:#fff;text-align:center;display:inline-block;line-height:40px}.xgplayer .xgplayer-time span{display:inline-block;line-height:40px;height:40px}.xgplayer .xgplayer-time span .time-min-width{text-align:center;min-width:2ch}.xgplayer .xgplayer-time span .time-min-width:first-child{text-align:right}.xgplayer .xgplayer-time span .time-min-width:last-child{text-align:left}.xgplayer .xgplayer-time .time-duration{color:#ffffff80}.xgplayer .xgplayer-time .time-live-tag{display:none}.xgplayer .xgplayer-time.xg-time-left{margin-left:0}.xgplayer .xgplayer-time.xg-time-right{margin-right:0}.xgplayer.xgplayer-mobile .xgplayer-time{min-width:30px;font-size:12px}.xgplayer.xgplayer-mobile .xgplayer-time.xg-time-left{margin-right:8px}.xgplayer.xgplayer-mobile .xgplayer-time.xg-time-right{margin-left:8px}.xgplayer .xgplayer-volume.slide-show .xgplayer-slider{display:block}.xgplayer .xgplayer-slider{display:none;position:absolute;width:28px;height:92px;background:#0000008a;border-radius:1px;bottom:40px;outline:none}.xgplayer .xgplayer-slider:after{content:" ";display:block;height:15px;width:28px;position:absolute;bottom:-15px;left:0;z-index:20;cursor:initial}.xgplayer .xgplayer-value-label{position:absolute;left:0;right:0;bottom:100%;padding:5px 0 0;font-size:12px;background-color:#0000008a;color:#fff;text-align:center}.xgplayer .xgplayer-bar,.xgplayer .xgplayer-drag{display:block;position:absolute;bottom:6px;left:12px;background:#ffffff4d;border-radius:100px;width:4px;height:76px;outline:none;cursor:pointer}.xgplayer .xgplayer-drag{bottom:0;left:0;background:#fa1f41;max-height:76px}.xgplayer .xgplayer-drag:after{content:" ";display:inline-block;width:8px;height:8px;background:#fff;box-shadow:0 0 5px #00000042;position:absolute;border-radius:50%;left:-2px;top:-4px}.xgplayer .xgplayer-volume[data-state=normal] .xg-volume{display:block}.xgplayer .xgplayer-volume[data-state=normal] .xg-volume-small,.xgplayer .xgplayer-volume[data-state=normal] .xg-volume-mute,.xgplayer .xgplayer-volume[data-state=small] .xg-volume{display:none}.xgplayer .xgplayer-volume[data-state=small] .xg-volume-small{display:block}.xgplayer .xgplayer-volume[data-state=small] .xg-volume-mute,.xgplayer .xgplayer-volume[data-state=mute] .xg-volume,.xgplayer .xgplayer-volume[data-state=mute] .xg-volume-small{display:none}.xgplayer .xgplayer-volume[data-state=mute] .xg-volume-mute{display:block}.xgplayer.xgplayer-mobile .xgplayer-volume .xgplayer-slider,.xgplayer .xgplayer-pip .xg-exit-pip{display:none}.xgplayer .xgplayer-pip .xg-get-pip,.xgplayer .xgplayer-pip[data-state=pip] .xg-exit-pip{display:block}.xgplayer .xgplayer-pip[data-state=pip] .xg-get-pip{display:none}.xgplayer .xgplayer-playnext{position:relative;display:none;cursor:pointer}.xgplayer .xgplayer-playnext .xgplayer-tips .xgplayer-tip-playnext{display:block}.xgplayer .xgplayer-playnext:hover{opacity:.85}.xgplayer .xgplayer-playnext:hover .xgplayer-tips{display:block}.lang-is-en .xgplayer-playnext .xgplayer-tips{margin-left:-25px}.lang-is-jp .xgplayer-playnext .xgplayer-tips{margin-left:-38px}.xgplayer .xgplayer-download{position:relative;display:block;cursor:pointer}.lang-is-en .xgplayer-download .xgplayer-tips{margin-left:-32px}.lang-is-jp .xgplayer-download .xgplayer-tips{margin-left:-40px}.xgplayer .xgplayer-shot{display:none}.xgplayer-definition{display:none;cursor:pointer}.xgplayer .xgplayer-playbackrate{display:none;cursor:default}.xgplayer .xgplayer-cssfullscreen .xg-get-cssfull{display:block}.xgplayer .xgplayer-cssfullscreen .xg-exit-cssfull,.xgplayer .xgplayer-cssfullscreen[data-state=full] .xg-get-cssfull{display:none}.xgplayer .xgplayer-cssfullscreen[data-state=full] .xg-exit-cssfull{display:block}.xgplayer-error{background:#000;display:none;position:absolute;left:0;top:0;width:100%;height:100%;z-index:6;color:#fff;text-align:center;line-height:100%;justify-content:center;align-items:center}.xgplayer-error .xgplayer-error-refresh{color:#fa1f41;padding:0 3px;cursor:pointer}.xgplayer-error .xgplayer-error-text{line-height:18px;margin:auto 6px 20px;display:block}.xgplayer-is-error .xgplayer-error{display:flex}.xgplayer .xgplayer-prompt{display:block;pointer-events:none;position:absolute;z-index:1;padding:6px 12px 5px;opacity:0;left:10px;background:#00000080;border-radius:50px;font-size:12px;line-height:17px;text-align:center;color:#fff}.xgplayer .xgplayer-prompt.show{display:block;opacity:1;z-index:10;pointer-events:initial}.xgplayer .xgplayer-prompt.arrow{transform:translate(-50%)}.xgplayer .xgplayer-prompt.arrow:after{content:"";display:block;position:absolute;left:50%;bottom:0;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid rgba(0,0,0,.5);transform:translate(-50%,100%)}.xgplayer .xgplayer-prompt .highlight{display:inline-block;margin-left:6px;color:red;cursor:pointer}.xgplayer.xgplayer-is-error .xgplayer-prompt.show{display:none;opacity:1}.xgplayer .xgplayer-spot{position:absolute;top:0;left:0;height:100%;background:#fff;border-radius:12px}.xgplayer .xgplayer-spot.mini{min-width:6px;transform:translate(-50%)}.xgplayer .xgplayer-spot.active .xgplayer-spot-pop{display:block;opacity:1;pointer-events:initial}.xgplayer .xgplayer-spot-pop{display:block;opacity:0;pointer-events:none;position:absolute;left:50%;bottom:5px;padding-bottom:5px;transform:translate(-50%)}.xgplayer-mobile .xgplayer-spot{height:3px;min-width:3px;top:50%;opacity:1;transform:translateY(-50%)}.xgplayer-mobile .xgplayer-spot.mini{min-width:3px;transform:translate(-50%,-50%)}.xgplayer .xgplayer-progress.active .xgplayer-spot{opacity:1;transition:opacity .3s;visibility:visible}.xgplayer .xg-spot-info{position:absolute;left:0;bottom:100%;display:none}.xgplayer .xg-spot-info.short-line .xg-spot-line{height:6px}.xgplayer .xg-spot-info.short-line .xg-spot-content{bottom:-4px}.xgplayer .xg-spot-info.no-thumbnail .xg-spot-thumbnail{display:none}.xgplayer .xg-spot-info.no-thumbnail .xgplayer-progress-point{display:block}.xgplayer .xg-spot-info.no-timepoint .xgplayer-progress-point,.xgplayer .xg-spot-info.hide{display:none}.xgplayer .xgplayer-progress.active .xg-spot-info{display:block}.xgplayer .xgplayer-progress.active .xg-spot-info.hide{display:none}.xgplayer .xg-spot-line{position:relative;bottom:-7px;margin-left:50%;display:block;width:1px;height:41px;background-color:#fff;pointer-events:none}.xgplayer .xgplayer-progress-point{display:none;position:relative;bottom:-4px;left:50%;transform:translate(-50%);background:#0000008a;font-size:11px;color:#fff;padding:4px 6px;border-radius:4px;text-align:center;opacity:.85;white-space:nowrap}.xgplayer .xg-spot-content{position:relative;bottom:-7px;color:#fff;border-radius:2px 2px 0 0}.xgplayer .xg-spot-ext-text{position:relative;bottom:-7px}.xgplayer .xg-spot-thumbnail{position:relative;background-color:#111010;pointer-events:none;border-radius:2px 2px 0 0}.xgplayer .xg-spot-time{position:absolute;bottom:2px;font-size:12px;line-height:16.8px;left:50%;transform:translate(-50%);pointer-events:none}.xgplayer .progress-thumbnail{margin:0 auto;display:block}.xgplayer .xg-spot-text{display:none;padding:5px 8px;background:#000c;border-radius:0 0 2px 2px;pointer-events:none;box-sizing:border-box}.xgplayer .spot-inner-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:20px;font-size:12px;max-height:40px}.xgplayer .xg-spot-content.show-text .xg-spot-text{display:block}.xgplayer .product .xg-spot-text{background:#3370ff}.xgplayer .product .xg-spot-line{border-left:10px solid transparent;border-right:10px solid transparent;border-top:7px solid #3370FF;width:0;height:15px;left:-10px;background:none}.xgplayer .xgvideo-preview{position:absolute;width:100%;height:100%;top:0;left:0;opacity:0;visibility:hidden;transition:visibility .3s,opacity .3s;background-color:#000}.xgplayer .xgvideo-preview .xgvideo-thumbnail{position:relative;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:0}.xgplayer .xgvideo-preview.show{opacity:1;visibility:visible}.xgplayer-dynamic-bg,.xgplayer-dynamic-bg canvas,.xgplayer-dynamic-bg xgmask,.xgplayer-dynamic-bg xgfilter{display:block;position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:none}.xgplayer-dynamic-bg canvas{transform:translateZ(0)}.xgplayer-dynamic-bg xgmask{background:#000000b3}.n-card-header__close .n-base-icon,.n-dialog__close .n-base-icon,.n-icon{font-size:18px} ');
  30.  
  31. (function (vue, naiveUi, CryptoJS, bigInt, Player, HlsJsPlugin) {
  32. 'use strict';
  33.  
  34. var _GM_cookie = /* @__PURE__ */ (() => typeof GM_cookie != "undefined" ? GM_cookie : void 0)();
  35. var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)();
  36. var _GM_info = /* @__PURE__ */ (() => typeof GM_info != "undefined" ? GM_info : void 0)();
  37. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  38. var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)();
  39. var _GM_xmlhttpRequest = /* @__PURE__ */ (() => typeof GM_xmlhttpRequest != "undefined" ? GM_xmlhttpRequest : void 0)();
  40. const gKts = [
  41. 240,
  42. 229,
  43. 105,
  44. 174,
  45. 191,
  46. 220,
  47. 191,
  48. 138,
  49. 26,
  50. 69,
  51. 232,
  52. 190,
  53. 125,
  54. 166,
  55. 115,
  56. 184,
  57. 222,
  58. 143,
  59. 231,
  60. 196,
  61. 69,
  62. 218,
  63. 134,
  64. 196,
  65. 155,
  66. 100,
  67. 139,
  68. 20,
  69. 106,
  70. 180,
  71. 241,
  72. 170,
  73. 56,
  74. 1,
  75. 53,
  76. 158,
  77. 38,
  78. 105,
  79. 44,
  80. 134,
  81. 0,
  82. 107,
  83. 79,
  84. 165,
  85. 54,
  86. 52,
  87. 98,
  88. 166,
  89. 42,
  90. 150,
  91. 104,
  92. 24,
  93. 242,
  94. 74,
  95. 253,
  96. 189,
  97. 107,
  98. 151,
  99. 143,
  100. 77,
  101. 143,
  102. 137,
  103. 19,
  104. 183,
  105. 108,
  106. 142,
  107. 147,
  108. 237,
  109. 14,
  110. 13,
  111. 72,
  112. 62,
  113. 215,
  114. 47,
  115. 136,
  116. 216,
  117. 254,
  118. 254,
  119. 126,
  120. 134,
  121. 80,
  122. 149,
  123. 79,
  124. 209,
  125. 235,
  126. 131,
  127. 38,
  128. 52,
  129. 219,
  130. 102,
  131. 123,
  132. 156,
  133. 126,
  134. 157,
  135. 122,
  136. 129,
  137. 50,
  138. 234,
  139. 182,
  140. 51,
  141. 222,
  142. 58,
  143. 169,
  144. 89,
  145. 52,
  146. 102,
  147. 59,
  148. 170,
  149. 186,
  150. 129,
  151. 96,
  152. 72,
  153. 185,
  154. 213,
  155. 129,
  156. 156,
  157. 248,
  158. 108,
  159. 132,
  160. 119,
  161. 255,
  162. 84,
  163. 120,
  164. 38,
  165. 95,
  166. 190,
  167. 232,
  168. 30,
  169. 54,
  170. 159,
  171. 52,
  172. 128,
  173. 92,
  174. 69,
  175. 44,
  176. 155,
  177. 118,
  178. 213,
  179. 27,
  180. 143,
  181. 204,
  182. 195,
  183. 184,
  184. 245
  185. ];
  186. const gKeyS = [41, 35, 33, 94];
  187. const gKeyL = [120, 6, 173, 76, 51, 134, 93, 24, 76, 1, 63, 70];
  188. const md5 = CryptoJS.MD5;
  189. const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
  190. const getDownLoadUrl = async (code) => {
  191. const time = Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3);
  192. const { data, key } = m115Encode(
  193. JSON.stringify({
  194. pickcode: code
  195. }),
  196. time
  197. );
  198. const download = {
  199. name: "",
  200. url: "",
  201. code: ""
  202. };
  203. await wait(1e3);
  204. const res = await request({
  205. method: "POST",
  206. url: `http://proapi.115.com/app/chrome/downurl?t=${time}`,
  207. data: `data=${encodeURIComponent(data)}`,
  208. headers: {
  209. "Content-Type": "application/x-www-form-urlencoded"
  210. }
  211. });
  212. const json = JSON.parse(res.responseText);
  213. if (!json.state) {
  214. throw new Error(json.msg);
  215. } else {
  216. const data2 = Object.values(JSON.parse(m115Decode(json.data, key)))[0];
  217. download.name = data2.file_name;
  218. download.url = data2.url.url;
  219. download.code = data2.pick_code;
  220. return download;
  221. }
  222. };
  223. const m115Encode = (code, time) => {
  224. const key = stringToBytes(md5(`!@###@#${time}DFDR@#@#`).toString());
  225. const bytes = stringToBytes(code);
  226. const tmp1 = m115SymEncode(bytes, bytes.length, key);
  227. const tmp2 = key.slice(0, 16).concat(tmp1);
  228. return {
  229. data: m115AsymEncode(tmp2, tmp2.length),
  230. key
  231. };
  232. };
  233. const m115Decode = function(src, key) {
  234. const bytes = stringToBytes(window.atob(src));
  235. const tmp = m115AsymDecode(bytes, bytes.length);
  236. return bytesToString(m115SymDecode(tmp.slice(16), tmp.length - 16, key, tmp.slice(0, 16)));
  237. };
  238. const stringToBytes = (str) => {
  239. const arr = [];
  240. const strLength = str.length;
  241. for (let i = 0; i < strLength; i++) {
  242. arr.push(str.charCodeAt(i));
  243. }
  244. return arr;
  245. };
  246. const m115SymEncode = (src, srclen, key1) => {
  247. let ret;
  248. const k1 = m115Getkey(4, key1);
  249. const k2 = m115Getkey(12, null);
  250. ret = xor115Enc(src, srclen, k1, 4);
  251. ret.reverse();
  252. ret = xor115Enc(ret, srclen, k2, 12);
  253. return ret;
  254. };
  255. const m115SymDecode = (src, srclen, key1, key2) => {
  256. const k1 = m115Getkey(4, key1);
  257. const k2 = m115Getkey(12, key2);
  258. let ret = xor115Enc(src, srclen, k2, 12);
  259. ret.reverse();
  260. ret = xor115Enc(ret, srclen, k1, 4);
  261. return ret;
  262. };
  263. const m115Getkey = (length, key) => {
  264. if (key != null) {
  265. const results = [];
  266. for (let i = 0; i < length; i++) {
  267. results.push(key[i] + gKts[length * i] & 255 ^ gKts[length * (length - 1 - i)]);
  268. }
  269. return results;
  270. }
  271. if (length === 12) {
  272. return gKeyL.slice(0);
  273. }
  274. return gKeyS.slice(0);
  275. };
  276. const xor115Enc = (src, srclen, key, keylen) => {
  277. const mod4 = srclen % 4;
  278. const ret = [];
  279. if (mod4 !== 0) {
  280. for (let i = 0, j = 0; 0 <= mod4 ? j < mod4 : j > mod4; i = 0 <= mod4 ? ++j : --j) {
  281. ret.push(src[i] ^ key[i % keylen]);
  282. }
  283. }
  284. for (let i = mod4, k = mod4; mod4 <= srclen ? k < srclen : k > srclen; i = mod4 <= srclen ? ++k : --k) {
  285. ret.push(src[i] ^ key[(i - mod4) % keylen]);
  286. }
  287. return ret;
  288. };
  289. const m115AsymEncode = (src, srclen) => {
  290. const m = 128 - 11;
  291. let ret = "";
  292. const ref2 = Math.floor((srclen + m - 1) / m);
  293. for (let i = 0, j = 0; 0 <= ref2 ? j < ref2 : j > ref2; i = 0 <= ref2 ? ++j : --j) {
  294. ret += RSA().encrypt(bytesToString(src.slice(i * m, Math.min((i + 1) * m, srclen))));
  295. }
  296. return window.btoa(RSA().hex2a(ret));
  297. };
  298. const m115AsymDecode = function(src, srclen) {
  299. const m = 128;
  300. let ret = "";
  301. const ref2 = Math.floor((srclen + m - 1) / m);
  302. for (let i = 0, j = 0; 0 <= ref2 ? j < ref2 : j > ref2; i = 0 <= ref2 ? ++j : --j) {
  303. ret += RSA().decrypt(bytesToString(src.slice(i * m, Math.min((i + 1) * m, srclen))));
  304. }
  305. return stringToBytes(ret);
  306. };
  307. const bytesToString = (b) => {
  308. let ret = "";
  309. for (let j = 0; j < b.length; j++) {
  310. ret += String.fromCharCode(b[j]);
  311. }
  312. return ret;
  313. };
  314. const RSA = () => {
  315. const n = bigInt(
  316. "8686980c0f5a24c4b9d43020cd2c22703ff3f450756529058b1cf88f09b8602136477198a6e2683149659bd122c33592fdb5ad47944ad1ea4d36c6b172aad6338c3bb6ac6227502d010993ac967d1aef00f0c8e038de2e4d3bc2ec368af2e9f10a6f1eda4f7262f136420c07c331b871bf139f74f3010e3c4fe57df3afb71683",
  317. 16
  318. );
  319. const e = bigInt("10001", 16);
  320. const pkcs1pad2 = (s, n2) => {
  321. if (n2 < s.length + 11) {
  322. return null;
  323. }
  324. const ba = [];
  325. let i = s.length - 1;
  326. while (i >= 0 && n2 > 0) {
  327. ba[--n2] = s.charCodeAt(i--);
  328. }
  329. ba[--n2] = 0;
  330. while (n2 > 2) {
  331. ba[--n2] = 255;
  332. }
  333. ba[--n2] = 2;
  334. ba[--n2] = 0;
  335. const c = a2hex(ba);
  336. return bigInt(c, 16);
  337. };
  338. const pkcs1unpad2 = (a) => {
  339. let b = a.toString(16);
  340. if (b.length % 2 !== 0) {
  341. b = "0" + b;
  342. }
  343. const c = hex2a(b);
  344. let i = 1;
  345. while (c.charCodeAt(i) !== 0) {
  346. i++;
  347. }
  348. return c.slice(i + 1);
  349. };
  350. const a2hex = (byteArray) => {
  351. let hexString = "";
  352. for (let i = 0; i < byteArray.length; i++) {
  353. let nextHexByte = byteArray[i].toString(16);
  354. if (nextHexByte.length < 2) {
  355. nextHexByte = "0" + nextHexByte;
  356. }
  357. hexString += nextHexByte;
  358. }
  359. return hexString;
  360. };
  361. const hex2a = (hex) => {
  362. let str = "";
  363. for (let i = 0; i < hex.length; i += 2) {
  364. str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
  365. }
  366. return str;
  367. };
  368. const encrypt = (text) => {
  369. const m = pkcs1pad2(text, 128);
  370. if (m === null) {
  371. return null;
  372. }
  373. let h = m.modPow(e, n).toString(16);
  374. while (h.length < 128 * 2) {
  375. h = "0" + h;
  376. }
  377. return h;
  378. };
  379. const decrypt = (text) => {
  380. const ba = [];
  381. let i = 0;
  382. while (i < text.length) {
  383. ba[i] = text.charCodeAt(i);
  384. i += 1;
  385. }
  386. const c = bigInt(a2hex(ba), 16).modPow(e, n);
  387. const d = pkcs1unpad2(c);
  388. return d;
  389. };
  390. return {
  391. encrypt,
  392. decrypt,
  393. hex2a
  394. };
  395. };
  396. const settings = _GM_getValue("settings", null);
  397. const request = (req) => {
  398. return new Promise((resolve, reject) => {
  399. _GM_xmlhttpRequest({
  400. method: req.method,
  401. url: req.url,
  402. data: req.data,
  403. headers: req.headers,
  404. cookie: req.cookie,
  405. anonymous: req.anonymous,
  406. onload: (response) => {
  407. resolve(response);
  408. },
  409. onerror: (error) => {
  410. reject(error);
  411. }
  412. });
  413. });
  414. };
  415. const getCookie = () => {
  416. return new Promise((resolve, reject) => {
  417. _GM_cookie.list({ domain: "115.com" }, (cookie, error) => {
  418. if (error) {
  419. reject(error);
  420. } else {
  421. resolve(cookie);
  422. }
  423. });
  424. });
  425. };
  426. const useTheme = () => {
  427. const osThemeRef = naiveUi.useOsTheme();
  428. const theme = vue.computed(
  429. () => osThemeRef.value === "dark" && (settings == null ? void 0 : settings.darkMode.enable) ? naiveUi.darkTheme : null
  430. );
  431. return theme;
  432. };
  433. const buttonThemeOverrides = {
  434. textColorTextHover: "#2777F8",
  435. textColorTextPressed: "#2777F8",
  436. textColorTextFocus: "#2777F8"
  437. };
  438. const menuThemeOverrides = {
  439. itemColorActive: "#EEF0FF",
  440. itemColorActiveHover: "#EEF0FF",
  441. itemTextColorActive: "#2777F8",
  442. itemTextColorActiveHover: "#2777F8"
  443. };
  444. const _hoisted_1$7 = {
  445. style: {
  446. "border-right": "1px solid #edeeef",
  447. "height": "100%"
  448. }
  449. };
  450. const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
  451. __name: "Sidebar",
  452. setup(__props) {
  453. const menuOptions = [{
  454. label: () => vue.createVNode("a", {
  455. "href": "//115.com/?cid=0&offset=0&mode=wangpan"
  456. }, [vue.createTextVNode("全部文件")]),
  457. key: "all"
  458. }, {
  459. label: () => vue.createVNode("a", {
  460. "href": "//115.com/?tab=upload&mode=wangpan"
  461. }, [vue.createTextVNode("最近上传")]),
  462. key: "upload"
  463. }, {
  464. label: () => vue.createVNode("a", {
  465. "href": "//115.com/?tab=offline&mode=wangpan"
  466. }, [vue.createTextVNode("云下载")]),
  467. key: "offline"
  468. }];
  469. const menuValue = vue.ref("all");
  470. const theme = useTheme();
  471. const url = new URL(window.location.href);
  472. if (url.searchParams.has("cid")) {
  473. menuValue.value = "all";
  474. } else if (url.searchParams.has("tab")) {
  475. const tab = url.searchParams.get("tab");
  476. if (tab === "upload") {
  477. menuValue.value = "upload";
  478. } else if (tab === "offline") {
  479. menuValue.value = "offline";
  480. }
  481. }
  482. return (_ctx, _cache) => {
  483. const _component_NMenu = naiveUi.NMenu;
  484. const _component_NConfigProvider = naiveUi.NConfigProvider;
  485. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [vue.createVNode(_component_NConfigProvider, {
  486. theme: vue.unref(theme)
  487. }, {
  488. default: vue.withCtx(() => [vue.createVNode(_component_NMenu, {
  489. value: vue.unref(menuValue),
  490. "onUpdate:value": _cache[0] || (_cache[0] = ($event) => vue.isRef(menuValue) ? menuValue.value = $event : null),
  491. options: menuOptions,
  492. "theme-overrides": vue.unref(menuThemeOverrides)
  493. }, null, 8, ["value", "theme-overrides"])]),
  494. _: 1
  495. }, 8, ["theme"])]);
  496. };
  497. }
  498. });
  499. function tryOnScopeDispose(fn) {
  500. if (vue.getCurrentScope()) {
  501. vue.onScopeDispose(fn);
  502. return true;
  503. }
  504. return false;
  505. }
  506. const isClient = typeof window !== "undefined" && typeof document !== "undefined";
  507. typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
  508. const toString = Object.prototype.toString;
  509. const isObject = (val) => toString.call(val) === "[object Object]";
  510. const noop = () => {
  511. };
  512. function createSingletonPromise(fn) {
  513. let _promise;
  514. function wrapper() {
  515. if (!_promise)
  516. _promise = fn();
  517. return _promise;
  518. }
  519. wrapper.reset = async () => {
  520. const _prev = _promise;
  521. _promise = void 0;
  522. if (_prev)
  523. await _prev;
  524. };
  525. return wrapper;
  526. }
  527. function toArray(value) {
  528. return Array.isArray(value) ? value : [value];
  529. }
  530. function useTimeoutFn(cb, interval, options = {}) {
  531. const {
  532. immediate = true,
  533. immediateCallback = false
  534. } = options;
  535. const isPending = vue.shallowRef(false);
  536. let timer = null;
  537. function clear() {
  538. if (timer) {
  539. clearTimeout(timer);
  540. timer = null;
  541. }
  542. }
  543. function stop() {
  544. isPending.value = false;
  545. clear();
  546. }
  547. function start(...args) {
  548. if (immediateCallback)
  549. cb();
  550. clear();
  551. isPending.value = true;
  552. timer = setTimeout(() => {
  553. isPending.value = false;
  554. timer = null;
  555. cb(...args);
  556. }, vue.toValue(interval));
  557. }
  558. if (immediate) {
  559. isPending.value = true;
  560. if (isClient)
  561. start();
  562. }
  563. tryOnScopeDispose(stop);
  564. return {
  565. isPending: vue.shallowReadonly(isPending),
  566. start,
  567. stop
  568. };
  569. }
  570. function watchImmediate(source, cb, options) {
  571. return vue.watch(
  572. source,
  573. cb,
  574. {
  575. ...options,
  576. immediate: true
  577. }
  578. );
  579. }
  580. const defaultWindow = isClient ? window : void 0;
  581. const defaultNavigator = isClient ? window.navigator : void 0;
  582. function unrefElement(elRef) {
  583. var _a;
  584. const plain = vue.toValue(elRef);
  585. return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
  586. }
  587. function useEventListener(...args) {
  588. const cleanups = [];
  589. const cleanup = () => {
  590. cleanups.forEach((fn) => fn());
  591. cleanups.length = 0;
  592. };
  593. const register = (el, event, listener, options) => {
  594. el.addEventListener(event, listener, options);
  595. return () => el.removeEventListener(event, listener, options);
  596. };
  597. const firstParamTargets = vue.computed(() => {
  598. const test = toArray(vue.toValue(args[0])).filter((e) => e != null);
  599. return test.every((e) => typeof e !== "string") ? test : void 0;
  600. });
  601. const stopWatch = watchImmediate(
  602. () => {
  603. var _a, _b;
  604. return [
  605. (_b = (_a = firstParamTargets.value) == null ? void 0 : _a.map((e) => unrefElement(e))) != null ? _b : [defaultWindow].filter((e) => e != null),
  606. toArray(vue.toValue(firstParamTargets.value ? args[1] : args[0])),
  607. toArray(vue.unref(firstParamTargets.value ? args[2] : args[1])),
  608. // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
  609. vue.toValue(firstParamTargets.value ? args[3] : args[2])
  610. ];
  611. },
  612. ([raw_targets, raw_events, raw_listeners, raw_options]) => {
  613. cleanup();
  614. if (!(raw_targets == null ? void 0 : raw_targets.length) || !(raw_events == null ? void 0 : raw_events.length) || !(raw_listeners == null ? void 0 : raw_listeners.length))
  615. return;
  616. const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
  617. cleanups.push(
  618. ...raw_targets.flatMap(
  619. (el) => raw_events.flatMap(
  620. (event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))
  621. )
  622. )
  623. );
  624. },
  625. { flush: "post" }
  626. );
  627. const stop = () => {
  628. stopWatch();
  629. cleanup();
  630. };
  631. tryOnScopeDispose(cleanup);
  632. return stop;
  633. }
  634. function useMounted() {
  635. const isMounted = vue.shallowRef(false);
  636. const instance = vue.getCurrentInstance();
  637. if (instance) {
  638. vue.onMounted(() => {
  639. isMounted.value = true;
  640. }, instance);
  641. }
  642. return isMounted;
  643. }
  644. function useSupported(callback) {
  645. const isMounted = useMounted();
  646. return vue.computed(() => {
  647. isMounted.value;
  648. return Boolean(callback());
  649. });
  650. }
  651. function usePermission(permissionDesc, options = {}) {
  652. const {
  653. controls = false,
  654. navigator: navigator2 = defaultNavigator
  655. } = options;
  656. const isSupported = useSupported(() => navigator2 && "permissions" in navigator2);
  657. const permissionStatus = vue.shallowRef();
  658. const desc = typeof permissionDesc === "string" ? { name: permissionDesc } : permissionDesc;
  659. const state = vue.shallowRef();
  660. const update = () => {
  661. var _a, _b;
  662. state.value = (_b = (_a = permissionStatus.value) == null ? void 0 : _a.state) != null ? _b : "prompt";
  663. };
  664. useEventListener(permissionStatus, "change", update, { passive: true });
  665. const query = createSingletonPromise(async () => {
  666. if (!isSupported.value)
  667. return;
  668. if (!permissionStatus.value) {
  669. try {
  670. permissionStatus.value = await navigator2.permissions.query(desc);
  671. } catch (e) {
  672. permissionStatus.value = void 0;
  673. } finally {
  674. update();
  675. }
  676. }
  677. if (controls)
  678. return vue.toRaw(permissionStatus.value);
  679. });
  680. query();
  681. if (controls) {
  682. return {
  683. state,
  684. isSupported,
  685. query
  686. };
  687. } else {
  688. return state;
  689. }
  690. }
  691. function useClipboard(options = {}) {
  692. const {
  693. navigator: navigator2 = defaultNavigator,
  694. read = false,
  695. source,
  696. copiedDuring = 1500,
  697. legacy = false
  698. } = options;
  699. const isClipboardApiSupported = useSupported(() => navigator2 && "clipboard" in navigator2);
  700. const permissionRead = usePermission("clipboard-read");
  701. const permissionWrite = usePermission("clipboard-write");
  702. const isSupported = vue.computed(() => isClipboardApiSupported.value || legacy);
  703. const text = vue.shallowRef("");
  704. const copied = vue.shallowRef(false);
  705. const timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });
  706. async function updateText() {
  707. let useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionRead.value));
  708. if (!useLegacy) {
  709. try {
  710. text.value = await navigator2.clipboard.readText();
  711. } catch (e) {
  712. useLegacy = true;
  713. }
  714. }
  715. if (useLegacy) {
  716. text.value = legacyRead();
  717. }
  718. }
  719. if (isSupported.value && read)
  720. useEventListener(["copy", "cut"], updateText, { passive: true });
  721. async function copy(value = vue.toValue(source)) {
  722. if (isSupported.value && value != null) {
  723. let useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionWrite.value));
  724. if (!useLegacy) {
  725. try {
  726. await navigator2.clipboard.writeText(value);
  727. } catch (e) {
  728. useLegacy = true;
  729. }
  730. }
  731. if (useLegacy)
  732. legacyCopy(value);
  733. text.value = value;
  734. copied.value = true;
  735. timeout.start();
  736. }
  737. }
  738. function legacyCopy(value) {
  739. const ta = document.createElement("textarea");
  740. ta.value = value != null ? value : "";
  741. ta.style.position = "absolute";
  742. ta.style.opacity = "0";
  743. document.body.appendChild(ta);
  744. ta.select();
  745. document.execCommand("copy");
  746. ta.remove();
  747. }
  748. function legacyRead() {
  749. var _a, _b, _c;
  750. return (_c = (_b = (_a = document == null ? void 0 : document.getSelection) == null ? void 0 : _a.call(document)) == null ? void 0 : _b.toString()) != null ? _c : "";
  751. }
  752. function isAllowed(status) {
  753. return status === "granted" || status === "prompt";
  754. }
  755. return {
  756. isSupported,
  757. text,
  758. copied,
  759. copy
  760. };
  761. }
  762. const DefaultMagicKeysAliasMap = {
  763. ctrl: "control",
  764. command: "meta",
  765. cmd: "meta",
  766. option: "alt",
  767. up: "arrowup",
  768. down: "arrowdown",
  769. left: "arrowleft",
  770. right: "arrowright"
  771. };
  772. function useMagicKeys(options = {}) {
  773. const {
  774. reactive: useReactive = false,
  775. target = defaultWindow,
  776. aliasMap = DefaultMagicKeysAliasMap,
  777. passive = true,
  778. onEventFired = noop
  779. } = options;
  780. const current = vue.reactive(/* @__PURE__ */ new Set());
  781. const obj = {
  782. toJSON() {
  783. return {};
  784. },
  785. current
  786. };
  787. const refs = useReactive ? vue.reactive(obj) : obj;
  788. const metaDeps = /* @__PURE__ */ new Set();
  789. const usedKeys = /* @__PURE__ */ new Set();
  790. function setRefs(key, value) {
  791. if (key in refs) {
  792. if (useReactive)
  793. refs[key] = value;
  794. else
  795. refs[key].value = value;
  796. }
  797. }
  798. function reset() {
  799. current.clear();
  800. for (const key of usedKeys)
  801. setRefs(key, false);
  802. }
  803. function updateRefs(e, value) {
  804. var _a, _b;
  805. const key = (_a = e.key) == null ? void 0 : _a.toLowerCase();
  806. const code = (_b = e.code) == null ? void 0 : _b.toLowerCase();
  807. const values = [code, key].filter(Boolean);
  808. if (key) {
  809. if (value)
  810. current.add(key);
  811. else
  812. current.delete(key);
  813. }
  814. for (const key2 of values) {
  815. usedKeys.add(key2);
  816. setRefs(key2, value);
  817. }
  818. if (key === "meta" && !value) {
  819. metaDeps.forEach((key2) => {
  820. current.delete(key2);
  821. setRefs(key2, false);
  822. });
  823. metaDeps.clear();
  824. } else if (typeof e.getModifierState === "function" && e.getModifierState("Meta") && value) {
  825. [...current, ...values].forEach((key2) => metaDeps.add(key2));
  826. }
  827. }
  828. useEventListener(target, "keydown", (e) => {
  829. updateRefs(e, true);
  830. return onEventFired(e);
  831. }, { passive });
  832. useEventListener(target, "keyup", (e) => {
  833. updateRefs(e, false);
  834. return onEventFired(e);
  835. }, { passive });
  836. useEventListener("blur", reset, { passive });
  837. useEventListener("focus", reset, { passive });
  838. const proxy = new Proxy(
  839. refs,
  840. {
  841. get(target2, prop, rec) {
  842. if (typeof prop !== "string")
  843. return Reflect.get(target2, prop, rec);
  844. prop = prop.toLowerCase();
  845. if (prop in aliasMap)
  846. prop = aliasMap[prop];
  847. if (!(prop in refs)) {
  848. if (/[+_-]/.test(prop)) {
  849. const keys2 = prop.split(/[+_-]/g).map((i) => i.trim());
  850. refs[prop] = vue.computed(() => keys2.map((key) => vue.toValue(proxy[key])).every(Boolean));
  851. } else {
  852. refs[prop] = vue.shallowRef(false);
  853. }
  854. }
  855. const r = Reflect.get(target2, prop, rec);
  856. return useReactive ? vue.toValue(r) : r;
  857. }
  858. }
  859. );
  860. return proxy;
  861. }
  862. function usePageLeave(options = {}) {
  863. const { window: window2 = defaultWindow } = options;
  864. const isLeft = vue.shallowRef(false);
  865. const handler = (event) => {
  866. if (!window2)
  867. return;
  868. event = event || window2.event;
  869. const from = event.relatedTarget || event.toElement;
  870. isLeft.value = !from;
  871. };
  872. if (window2) {
  873. const listenerOptions = { passive: true };
  874. useEventListener(window2, "mouseout", handler, listenerOptions);
  875. useEventListener(window2.document, "mouseleave", handler, listenerOptions);
  876. useEventListener(window2.document, "mouseenter", handler, listenerOptions);
  877. }
  878. return isLeft;
  879. }
  880. const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
  881. __name: "DownloadContent",
  882. setup(__props) {
  883. const message2 = naiveUi.useMessage();
  884. const showDownload = vue.ref(false);
  885. const downloads = vue.ref([]);
  886. const keys = useMagicKeys();
  887. const ctrlAltD = keys["Ctrl+Alt+D"];
  888. const ctrlAltO = keys["Ctrl+Alt+O"];
  889. const f9 = keys["F9"];
  890. const videoList = vue.ref([]);
  891. const bc = new BroadcastChannel("115Plus");
  892. vue.watch(ctrlAltD, (v) => {
  893. if (v && _GM_info.userAgentData.platform !== "macOS") {
  894. handleDownload();
  895. }
  896. });
  897. vue.watch(ctrlAltO, (v) => {
  898. if (v) {
  899. openFile();
  900. }
  901. });
  902. vue.watch(f9, (v) => {
  903. if (v && _GM_info.userAgentData.platform === "macOS") {
  904. handleDownload();
  905. }
  906. });
  907. const getSelectFile = () => {
  908. const files = [];
  909. downloads.value = [];
  910. const lists = document.querySelectorAll(".list-contents > ul > li");
  911. lists.forEach((item) => {
  912. const checkbox = item.querySelector('input[type="checkbox"]');
  913. if (checkbox && checkbox.checked) {
  914. files.push({
  915. name: item.getAttribute("title"),
  916. isDir: item.getAttribute("file_type") === "0" ? true : false,
  917. code: item.getAttribute("pick_code"),
  918. cateId: item.getAttribute("cate_id") || "",
  919. fileMode: item.getAttribute("file_mode") || ""
  920. });
  921. }
  922. });
  923. if (files.length === 0) {
  924. message2.destroyAll();
  925. message2.warning("请选择文件");
  926. return false;
  927. }
  928. return files;
  929. };
  930. const handleDownload = async () => {
  931. try {
  932. const selectFiles = getSelectFile();
  933. if (!selectFiles) return;
  934. const loading = message2.loading("获取下载链接中,如果文件较多等待时间会比较长,并且有几率卡住", {
  935. duration: 0
  936. });
  937. for (const file of selectFiles) {
  938. if (file.isDir) {
  939. const children = await getForderDownLoads(file.cateId);
  940. downloads.value.push({
  941. name: file.name,
  942. code: file.cateId,
  943. children
  944. });
  945. } else {
  946. const download = await getDownLoadUrl(file.code);
  947. downloads.value.push(download);
  948. }
  949. }
  950. loading.destroy();
  951. if (downloads.value.length === 0) {
  952. message2.error("获取下载链接失败");
  953. } else {
  954. showDownload.value = true;
  955. }
  956. } catch (error) {
  957. console.error(error);
  958. message2.error(`获取信息失败,错误信息:${error}`);
  959. }
  960. };
  961. const openFile = () => {
  962. const files = getSelectFile();
  963. if (!files) return;
  964. files.forEach((file) => {
  965. if (file.isDir) {
  966. _GM_openInTab(`https://115.com/?cid=${file.cateId}&offset=0&tab=&mode=wangpan`, {
  967. setParent: settings == null ? void 0 : settings.openNewTab.setParent
  968. });
  969. } else if (file.fileMode === "9") {
  970. _GM_openInTab(`https://115vod.com/?pickcode=${file.code}&share_id=0`, {
  971. setParent: settings == null ? void 0 : settings.openNewTab.setParent
  972. });
  973. }
  974. });
  975. };
  976. const handlePlay = async () => {
  977. var _a;
  978. try {
  979. const files = getSelectFile();
  980. if (!files) return;
  981. videoList.value = [];
  982. for (const file of files) {
  983. if (file.isDir) {
  984. message2.error("暂不支持选择文件夹播放,请勿选择文件夹");
  985. return;
  986. }
  987. if (file.fileMode === "9") {
  988. videoList.value.push({
  989. name: file.name,
  990. code: file.code
  991. });
  992. }
  993. }
  994. if (videoList.value.length === 0) {
  995. message2.error("未选择视频文件");
  996. return;
  997. }
  998. bc.postMessage({
  999. type: "VideoPlay",
  1000. data: JSON.stringify(videoList.value),
  1001. url: (_a = window.top) == null ? void 0 : _a.location.href
  1002. });
  1003. } catch (error) {
  1004. console.error(error);
  1005. message2.error(`视频播放失败,错误信息:${error}`);
  1006. }
  1007. };
  1008. const handleFolderPlay = async () => {
  1009. var _a;
  1010. try {
  1011. const url = new URL(window.parent.location.href);
  1012. const files = await getForderVideos(url.searchParams.get("cid"));
  1013. if (files.length === 0) {
  1014. message2.error("文件夹内没有视频文件");
  1015. return;
  1016. }
  1017. videoList.value = files.map((item) => {
  1018. return {
  1019. name: item.n,
  1020. code: item.pc
  1021. };
  1022. });
  1023. bc.postMessage({
  1024. type: "VideoPlay",
  1025. data: JSON.stringify(videoList.value),
  1026. url: (_a = window.top) == null ? void 0 : _a.location.href
  1027. });
  1028. } catch (error) {
  1029. console.error(error);
  1030. message2.error(`视频播放失败,错误信息:${error}`);
  1031. }
  1032. };
  1033. const getForderVideos = async (cid) => {
  1034. var _a, _b, _c, _d;
  1035. const cookie = await getCookie();
  1036. const res = await request({
  1037. method: "GET",
  1038. url: `https://115vod.com/aps/natsort/files.php?aid=1&cid=${cid}&offset=0&limit=9999&show_dir=0&nf=&qid=0&type=4&source=&format=json&star=&is_q=&is_share=&r_all=1&o=file_name&asc=1&cur=1&natsort=1`,
  1039. cookie: `CID=${(_a = cookie.find((item) => item.name === "CID")) == null ? void 0 : _a.value};SEID=${(_b = cookie.find((item) => item.name === "SEID")) == null ? void 0 : _b.value};UID=${(_c = cookie.find((item) => item.name === "UID")) == null ? void 0 : _c.value};KID=${(_d = cookie.find((item) => item.name === "KID")) == null ? void 0 : _d.value}`,
  1040. anonymous: true
  1041. });
  1042. const json = JSON.parse(res.responseText);
  1043. if (json.state) {
  1044. return json.data;
  1045. } else {
  1046. if (json.error) {
  1047. throw new Error(json.error);
  1048. } else {
  1049. throw new Error("获取文件夹文件失败");
  1050. }
  1051. }
  1052. };
  1053. const getForderDownLoads = async (id) => {
  1054. const temp = [];
  1055. const files = await getForderFiles(id);
  1056. for (const file of files) {
  1057. if (file.fid) {
  1058. const download = await getDownLoadUrl(file.pc);
  1059. temp.push(download);
  1060. } else {
  1061. const children = await getForderDownLoads(file.cid);
  1062. temp.push({
  1063. name: file.n,
  1064. code: file.pc,
  1065. children
  1066. });
  1067. }
  1068. }
  1069. return temp;
  1070. };
  1071. const getForderFiles = async (id) => {
  1072. const res = await request({
  1073. method: "GET",
  1074. url: `https://webapi.115.com/files?aid=1&cid=${id}&show_dir=1&limit=9999&format=json`
  1075. });
  1076. const json = JSON.parse(res.responseText);
  1077. if (json.state) {
  1078. return json.data;
  1079. } else {
  1080. if (json.error) {
  1081. throw new Error(json.error);
  1082. } else {
  1083. throw new Error("获取文件夹中的文件失败");
  1084. }
  1085. }
  1086. };
  1087. const suffixRender = (info) => {
  1088. if (info.option.url) {
  1089. return vue.createVNode(naiveUi.NButton, {
  1090. "text": true,
  1091. "theme-overrides": buttonThemeOverrides,
  1092. "tag": "a",
  1093. "href": info.option.url,
  1094. "target": "_blank"
  1095. }, {
  1096. default: () => [vue.createTextVNode("下载")]
  1097. });
  1098. } else {
  1099. return void 0;
  1100. }
  1101. };
  1102. return (_ctx, _cache) => {
  1103. const _component_NTree = naiveUi.NTree;
  1104. const _component_NModal = naiveUi.NModal;
  1105. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [(vue.unref(settings) ? vue.unref(settings).download.enable : true) ? (vue.openBlock(), vue.createBlock(vue.unref(naiveUi.NButton), {
  1106. key: 0,
  1107. text: "",
  1108. "theme-overrides": vue.unref(buttonThemeOverrides),
  1109. onClick: handleDownload
  1110. }, {
  1111. default: vue.withCtx(() => _cache[1] || (_cache[1] = [vue.createTextVNode(" 下载 ")])),
  1112. _: 1
  1113. }, 8, ["theme-overrides"])) : vue.createCommentVNode("", true), (vue.unref(settings) ? vue.unref(settings).openNewTab.enable : true) ? (vue.openBlock(), vue.createBlock(vue.unref(naiveUi.NButton), {
  1114. key: 1,
  1115. text: "",
  1116. "theme-overrides": vue.unref(buttonThemeOverrides),
  1117. style: {
  1118. "margin-left": "1rem"
  1119. },
  1120. onClick: openFile
  1121. }, {
  1122. default: vue.withCtx(() => _cache[2] || (_cache[2] = [vue.createTextVNode(" 批量新标签打开 ")])),
  1123. _: 1
  1124. }, 8, ["theme-overrides"])) : vue.createCommentVNode("", true), (vue.unref(settings) ? vue.unref(settings).video.enable : true) ? (vue.openBlock(), vue.createBlock(vue.unref(naiveUi.NButton), {
  1125. key: 2,
  1126. text: "",
  1127. "theme-overrides": vue.unref(buttonThemeOverrides),
  1128. style: {
  1129. "margin-left": "1rem"
  1130. },
  1131. onClick: handlePlay
  1132. }, {
  1133. default: vue.withCtx(() => _cache[3] || (_cache[3] = [vue.createTextVNode(" 播放 ")])),
  1134. _: 1
  1135. }, 8, ["theme-overrides"])) : vue.createCommentVNode("", true), (vue.unref(settings) ? vue.unref(settings).video.enable : true) ? (vue.openBlock(), vue.createBlock(vue.unref(naiveUi.NButton), {
  1136. key: 3,
  1137. text: "",
  1138. "theme-overrides": vue.unref(buttonThemeOverrides),
  1139. style: {
  1140. "margin-left": "1rem"
  1141. },
  1142. onClick: handleFolderPlay
  1143. }, {
  1144. default: vue.withCtx(() => _cache[4] || (_cache[4] = [vue.createTextVNode(" 播放当前文件夹 ")])),
  1145. _: 1
  1146. }, 8, ["theme-overrides"])) : vue.createCommentVNode("", true), vue.createVNode(_component_NModal, {
  1147. show: vue.unref(showDownload),
  1148. "onUpdate:show": _cache[0] || (_cache[0] = ($event) => vue.isRef(showDownload) ? showDownload.value = $event : null),
  1149. style: {
  1150. "width": "40%"
  1151. },
  1152. title: "文件下载",
  1153. bordered: false,
  1154. preset: "card"
  1155. }, {
  1156. default: vue.withCtx(() => [vue.createVNode(_component_NTree, {
  1157. data: vue.unref(downloads),
  1158. "block-line": "",
  1159. "expand-on-click": "",
  1160. "key-field": "code",
  1161. "label-field": "name",
  1162. "show-line": "",
  1163. "virtual-scroll": "",
  1164. style: {
  1165. "max-height": "40vh"
  1166. },
  1167. "render-suffix": suffixRender
  1168. }, null, 8, ["data"])]),
  1169. _: 1
  1170. }, 8, ["show"])], 64);
  1171. };
  1172. }
  1173. });
  1174. const _hoisted_1$6 = { style: { "height": "100%", "display": "flex", "align-items": "center", "margin-left": "1rem" } };
  1175. const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
  1176. __name: "Download",
  1177. setup(__props) {
  1178. const theme = useTheme();
  1179. return (_ctx, _cache) => {
  1180. const _component_DownloadContent = _sfc_main$8;
  1181. const _component_NMessageProvider = naiveUi.NMessageProvider;
  1182. const _component_NModalProvider = naiveUi.NModalProvider;
  1183. const _component_NConfigProvider = naiveUi.NConfigProvider;
  1184. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
  1185. vue.createVNode(_component_NConfigProvider, { theme: vue.unref(theme) }, {
  1186. default: vue.withCtx(() => [
  1187. vue.createVNode(_component_NModalProvider, null, {
  1188. default: vue.withCtx(() => [
  1189. vue.createVNode(_component_NMessageProvider, null, {
  1190. default: vue.withCtx(() => [
  1191. vue.createVNode(_component_DownloadContent)
  1192. ]),
  1193. _: 1
  1194. })
  1195. ]),
  1196. _: 1
  1197. })
  1198. ]),
  1199. _: 1
  1200. }, 8, ["theme"])
  1201. ]);
  1202. };
  1203. }
  1204. });
  1205. const _hoisted_1$5 = {
  1206. xmlns: "http://www.w3.org/2000/svg",
  1207. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  1208. viewBox: "0 0 1024 1024"
  1209. };
  1210. const CopyOutlined = vue.defineComponent({
  1211. name: "CopyOutlined",
  1212. render: function render(_ctx, _cache) {
  1213. return vue.openBlock(), vue.createElementBlock(
  1214. "svg",
  1215. _hoisted_1$5,
  1216. _cache[0] || (_cache[0] = [
  1217. vue.createElementVNode(
  1218. "path",
  1219. {
  1220. d: "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z",
  1221. fill: "currentColor"
  1222. },
  1223. null,
  1224. -1
  1225. /* HOISTED */
  1226. )
  1227. ])
  1228. );
  1229. }
  1230. });
  1231. const _hoisted_1$4 = {
  1232. xmlns: "http://www.w3.org/2000/svg",
  1233. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  1234. viewBox: "0 0 1024 1024"
  1235. };
  1236. const DeleteOutlined = vue.defineComponent({
  1237. name: "DeleteOutlined",
  1238. render: function render2(_ctx, _cache) {
  1239. return vue.openBlock(), vue.createElementBlock(
  1240. "svg",
  1241. _hoisted_1$4,
  1242. _cache[0] || (_cache[0] = [
  1243. vue.createElementVNode(
  1244. "path",
  1245. {
  1246. d: "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z",
  1247. fill: "currentColor"
  1248. },
  1249. null,
  1250. -1
  1251. /* HOISTED */
  1252. )
  1253. ])
  1254. );
  1255. }
  1256. });
  1257. const _hoisted_1$3 = {
  1258. xmlns: "http://www.w3.org/2000/svg",
  1259. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  1260. viewBox: "0 0 1024 1024"
  1261. };
  1262. const FolderOutlined = vue.defineComponent({
  1263. name: "FolderOutlined",
  1264. render: function render3(_ctx, _cache) {
  1265. return vue.openBlock(), vue.createElementBlock(
  1266. "svg",
  1267. _hoisted_1$3,
  1268. _cache[0] || (_cache[0] = [
  1269. vue.createElementVNode(
  1270. "path",
  1271. {
  1272. d: "M880 298.4H521L403.7 186.2a8.15 8.15 0 0 0-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z",
  1273. fill: "currentColor"
  1274. },
  1275. null,
  1276. -1
  1277. /* HOISTED */
  1278. )
  1279. ])
  1280. );
  1281. }
  1282. });
  1283. const _hoisted_1$2 = {
  1284. xmlns: "http://www.w3.org/2000/svg",
  1285. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  1286. viewBox: "0 0 1024 1024"
  1287. };
  1288. const SettingOutlined = vue.defineComponent({
  1289. name: "SettingOutlined",
  1290. render: function render4(_ctx, _cache) {
  1291. return vue.openBlock(), vue.createElementBlock(
  1292. "svg",
  1293. _hoisted_1$2,
  1294. _cache[0] || (_cache[0] = [
  1295. vue.createElementVNode(
  1296. "path",
  1297. {
  1298. d: "M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 0 0 9.3-35.2l-.9-2.6a443.74 443.74 0 0 0-79.7-137.9l-1.8-2.1a32.12 32.12 0 0 0-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 0 0-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 0 0-25.8 25.7l-15.8 85.4a351.86 351.86 0 0 0-99 57.4l-81.9-29.1a32 32 0 0 0-35.1 9.5l-1.8 2.1a446.02 446.02 0 0 0-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1c0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 0 0-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0 0 35.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0 0 25.8 25.7l2.7.5a449.4 449.4 0 0 0 159 0l2.7-.5a32.05 32.05 0 0 0 25.8-25.7l15.7-85a350 350 0 0 0 99.7-57.6l81.3 28.9a32 32 0 0 0 35.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1l74.7 63.9a370.03 370.03 0 0 1-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3l-17.9 97a377.5 377.5 0 0 1-85 0l-17.9-97.2l-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9l-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5l-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5c0-15.3 1.2-30.6 3.7-45.5l6.5-40l-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2l31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3l17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97l38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8l92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176s-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 0 1 512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 0 1 400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 0 1 624 502c0 29.9-11.7 58-32.8 79.2z",
  1299. fill: "currentColor"
  1300. },
  1301. null,
  1302. -1
  1303. /* HOISTED */
  1304. )
  1305. ])
  1306. );
  1307. }
  1308. });
  1309. const _hoisted_1$1 = { style: { "display": "flex", "justify-content": "center", "margin-top": "8px" } };
  1310. const _hoisted_2$1 = { style: { "display": "flex", "justify-content": "end" } };
  1311. const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
  1312. __name: "Setting",
  1313. setup(__props) {
  1314. const showSetting = vue.ref(false);
  1315. const theme = useTheme();
  1316. const settingsRef = vue.ref(
  1317. settings ?? {
  1318. sidebar: {
  1319. enable: true
  1320. },
  1321. download: {
  1322. enable: true
  1323. },
  1324. openNewTab: {
  1325. enable: true,
  1326. setParent: false
  1327. },
  1328. oldButton: {
  1329. enable: true,
  1330. deleteSource: true
  1331. },
  1332. video: {
  1333. enable: true,
  1334. volume: 1,
  1335. defaultPlaybackRate: 1,
  1336. autoplay: true,
  1337. history: true
  1338. },
  1339. darkMode: {
  1340. enable: false
  1341. },
  1342. fp: {
  1343. enable: true
  1344. }
  1345. }
  1346. );
  1347. const handleOpen = () => {
  1348. showSetting.value = true;
  1349. };
  1350. const handleClose = () => {
  1351. showSetting.value = false;
  1352. };
  1353. const handleSave = () => {
  1354. _GM_setValue("settings", settingsRef.value);
  1355. handleClose();
  1356. history.go(0);
  1357. };
  1358. return (_ctx, _cache) => {
  1359. const _component_NIcon = naiveUi.NIcon;
  1360. const _component_NButton = naiveUi.NButton;
  1361. const _component_NSwitch = naiveUi.NSwitch;
  1362. const _component_NFormItem = naiveUi.NFormItem;
  1363. const _component_NForm = naiveUi.NForm;
  1364. const _component_NTabPane = naiveUi.NTabPane;
  1365. const _component_NSlider = naiveUi.NSlider;
  1366. const _component_NRadio = naiveUi.NRadio;
  1367. const _component_NSpace = naiveUi.NSpace;
  1368. const _component_NRadioGroup = naiveUi.NRadioGroup;
  1369. const _component_NTabs = naiveUi.NTabs;
  1370. const _component_NCard = naiveUi.NCard;
  1371. const _component_NModal = naiveUi.NModal;
  1372. const _component_NConfigProvider = naiveUi.NConfigProvider;
  1373. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  1374. vue.createVNode(_component_NConfigProvider, { theme: vue.unref(theme) }, {
  1375. default: vue.withCtx(() => [
  1376. vue.createVNode(_component_NButton, {
  1377. text: "",
  1378. style: { "font-size": "12px" },
  1379. "theme-overrides": vue.unref(buttonThemeOverrides),
  1380. onClick: handleOpen
  1381. }, {
  1382. default: vue.withCtx(() => [
  1383. vue.createElementVNode("div", null, [
  1384. vue.createVNode(_component_NIcon, { size: "24" }, {
  1385. default: vue.withCtx(() => [
  1386. vue.createVNode(vue.unref(SettingOutlined))
  1387. ]),
  1388. _: 1
  1389. })
  1390. ]),
  1391. _cache[14] || (_cache[14] = vue.createElementVNode("div", null, " 115+ 设置 ", -1))
  1392. ]),
  1393. _: 1
  1394. }, 8, ["theme-overrides"]),
  1395. vue.createVNode(_component_NModal, {
  1396. show: vue.unref(showSetting),
  1397. "onUpdate:show": _cache[13] || (_cache[13] = ($event) => vue.isRef(showSetting) ? showSetting.value = $event : null)
  1398. }, {
  1399. default: vue.withCtx(() => [
  1400. vue.createVNode(_component_NCard, {
  1401. style: { "width": "40%" },
  1402. title: "115+ 设置",
  1403. bordered: false,
  1404. role: "dialog",
  1405. closable: "",
  1406. onClose: handleClose
  1407. }, {
  1408. action: vue.withCtx(() => [
  1409. vue.createElementVNode("div", _hoisted_2$1, [
  1410. vue.createVNode(_component_NButton, {
  1411. type: "primary",
  1412. onClick: handleSave
  1413. }, {
  1414. default: vue.withCtx(() => _cache[24] || (_cache[24] = [
  1415. vue.createTextVNode("保存")
  1416. ])),
  1417. _: 1
  1418. })
  1419. ])
  1420. ]),
  1421. default: vue.withCtx(() => [
  1422. vue.createVNode(_component_NTabs, {
  1423. type: "segment",
  1424. animated: ""
  1425. }, {
  1426. default: vue.withCtx(() => [
  1427. vue.createVNode(_component_NTabPane, {
  1428. name: "functionSwitch",
  1429. tab: "功能开关"
  1430. }, {
  1431. default: vue.withCtx(() => [
  1432. vue.createVNode(_component_NForm, {
  1433. ref: "formRef",
  1434. "label-placement": "left",
  1435. "label-width": "auto",
  1436. "show-feedback": false
  1437. }, {
  1438. default: vue.withCtx(() => [
  1439. vue.createVNode(_component_NFormItem, {
  1440. label: "精简侧边栏",
  1441. path: "sidebar.enable"
  1442. }, {
  1443. default: vue.withCtx(() => [
  1444. vue.createVNode(_component_NSwitch, {
  1445. value: vue.unref(settingsRef).sidebar.enable,
  1446. "onUpdate:value": _cache[0] || (_cache[0] = ($event) => vue.unref(settingsRef).sidebar.enable = $event)
  1447. }, null, 8, ["value"])
  1448. ]),
  1449. _: 1
  1450. }),
  1451. vue.createVNode(_component_NFormItem, {
  1452. label: "下载文件",
  1453. path: "download.enable"
  1454. }, {
  1455. default: vue.withCtx(() => [
  1456. vue.createVNode(_component_NSwitch, {
  1457. value: vue.unref(settingsRef).download.enable,
  1458. "onUpdate:value": _cache[1] || (_cache[1] = ($event) => vue.unref(settingsRef).download.enable = $event)
  1459. }, null, 8, ["value"])
  1460. ]),
  1461. _: 1
  1462. }),
  1463. vue.createVNode(_component_NFormItem, {
  1464. label: "批量新标签打开",
  1465. path: "openNewTab.enable"
  1466. }, {
  1467. default: vue.withCtx(() => [
  1468. vue.createVNode(_component_NSwitch, {
  1469. value: vue.unref(settingsRef).openNewTab.enable,
  1470. "onUpdate:value": _cache[2] || (_cache[2] = ($event) => vue.unref(settingsRef).openNewTab.enable = $event)
  1471. }, null, 8, ["value"])
  1472. ]),
  1473. _: 1
  1474. }),
  1475. vue.createVNode(_component_NFormItem, {
  1476. label: "自定义离线下载按钮和云下载列表",
  1477. path: "oldButton.enable"
  1478. }, {
  1479. default: vue.withCtx(() => [
  1480. vue.createVNode(_component_NSwitch, {
  1481. value: vue.unref(settingsRef).oldButton.enable,
  1482. "onUpdate:value": _cache[3] || (_cache[3] = ($event) => vue.unref(settingsRef).oldButton.enable = $event)
  1483. }, null, 8, ["value"])
  1484. ]),
  1485. _: 1
  1486. }),
  1487. vue.createVNode(_component_NFormItem, {
  1488. label: "视频播放",
  1489. path: "video.enable"
  1490. }, {
  1491. default: vue.withCtx(() => [
  1492. vue.createVNode(_component_NSwitch, {
  1493. value: vue.unref(settingsRef).video.enable,
  1494. "onUpdate:value": _cache[4] || (_cache[4] = ($event) => vue.unref(settingsRef).video.enable = $event)
  1495. }, null, 8, ["value"])
  1496. ]),
  1497. _: 1
  1498. }),
  1499. vue.createVNode(_component_NFormItem, {
  1500. label: "跟随系统暗黑模式",
  1501. path: "darkMode.enable"
  1502. }, {
  1503. default: vue.withCtx(() => [
  1504. vue.createVNode(_component_NSwitch, {
  1505. value: vue.unref(settingsRef).darkMode.enable,
  1506. "onUpdate:value": _cache[5] || (_cache[5] = ($event) => vue.unref(settingsRef).darkMode.enable = $event)
  1507. }, null, 8, ["value"])
  1508. ]),
  1509. _: 1
  1510. }),
  1511. vue.createVNode(_component_NFormItem, {
  1512. label: "去水印",
  1513. path: "fp.enable"
  1514. }, {
  1515. default: vue.withCtx(() => [
  1516. vue.createVNode(_component_NSwitch, {
  1517. value: vue.unref(settingsRef).fp.enable,
  1518. "onUpdate:value": _cache[6] || (_cache[6] = ($event) => vue.unref(settingsRef).fp.enable = $event)
  1519. }, null, 8, ["value"])
  1520. ]),
  1521. _: 1
  1522. })
  1523. ]),
  1524. _: 1
  1525. }, 512)
  1526. ]),
  1527. _: 1
  1528. }),
  1529. vue.createVNode(_component_NTabPane, {
  1530. name: "playSetting",
  1531. tab: "播放设置"
  1532. }, {
  1533. default: vue.withCtx(() => [
  1534. vue.createVNode(_component_NForm, {
  1535. ref: "formRef",
  1536. "label-placement": "left",
  1537. "label-width": "auto",
  1538. "show-feedback": false
  1539. }, {
  1540. default: vue.withCtx(() => [
  1541. vue.createVNode(_component_NFormItem, {
  1542. label: "默认音量",
  1543. path: "video.volume"
  1544. }, {
  1545. default: vue.withCtx(() => [
  1546. vue.createVNode(_component_NSlider, {
  1547. value: vue.unref(settingsRef).video.volume,
  1548. "onUpdate:value": _cache[7] || (_cache[7] = ($event) => vue.unref(settingsRef).video.volume = $event),
  1549. step: 0.01,
  1550. max: 1,
  1551. "format-tooltip": (v) => `${(v * 100).toFixed(0)}%`
  1552. }, null, 8, ["value", "format-tooltip"])
  1553. ]),
  1554. _: 1
  1555. }),
  1556. vue.createVNode(_component_NFormItem, {
  1557. label: "默认速度",
  1558. path: "video.defaultPlaybackRate"
  1559. }, {
  1560. default: vue.withCtx(() => [
  1561. vue.createVNode(_component_NRadioGroup, {
  1562. value: vue.unref(settingsRef).video.defaultPlaybackRate,
  1563. "onUpdate:value": _cache[8] || (_cache[8] = ($event) => vue.unref(settingsRef).video.defaultPlaybackRate = $event),
  1564. name: "radiogroup"
  1565. }, {
  1566. default: vue.withCtx(() => [
  1567. vue.createVNode(_component_NSpace, null, {
  1568. default: vue.withCtx(() => [
  1569. vue.createVNode(_component_NRadio, { value: 0.5 }, {
  1570. default: vue.withCtx(() => _cache[15] || (_cache[15] = [
  1571. vue.createTextVNode(" 0.5x ")
  1572. ])),
  1573. _: 1
  1574. }),
  1575. vue.createVNode(_component_NRadio, { value: 0.75 }, {
  1576. default: vue.withCtx(() => _cache[16] || (_cache[16] = [
  1577. vue.createTextVNode(" 0.75x ")
  1578. ])),
  1579. _: 1
  1580. }),
  1581. vue.createVNode(_component_NRadio, { value: 1 }, {
  1582. default: vue.withCtx(() => _cache[17] || (_cache[17] = [
  1583. vue.createTextVNode(" 1x ")
  1584. ])),
  1585. _: 1
  1586. }),
  1587. vue.createVNode(_component_NRadio, { value: 1.25 }, {
  1588. default: vue.withCtx(() => _cache[18] || (_cache[18] = [
  1589. vue.createTextVNode(" 1.25x ")
  1590. ])),
  1591. _: 1
  1592. }),
  1593. vue.createVNode(_component_NRadio, { value: 1.5 }, {
  1594. default: vue.withCtx(() => _cache[19] || (_cache[19] = [
  1595. vue.createTextVNode(" 1.5x ")
  1596. ])),
  1597. _: 1
  1598. }),
  1599. vue.createVNode(_component_NRadio, { value: 2 }, {
  1600. default: vue.withCtx(() => _cache[20] || (_cache[20] = [
  1601. vue.createTextVNode(" 2x ")
  1602. ])),
  1603. _: 1
  1604. }),
  1605. vue.createVNode(_component_NRadio, { value: 3 }, {
  1606. default: vue.withCtx(() => _cache[21] || (_cache[21] = [
  1607. vue.createTextVNode(" 3x ")
  1608. ])),
  1609. _: 1
  1610. }),
  1611. vue.createVNode(_component_NRadio, { value: 4 }, {
  1612. default: vue.withCtx(() => _cache[22] || (_cache[22] = [
  1613. vue.createTextVNode(" 4x ")
  1614. ])),
  1615. _: 1
  1616. }),
  1617. vue.createVNode(_component_NRadio, { value: 5 }, {
  1618. default: vue.withCtx(() => _cache[23] || (_cache[23] = [
  1619. vue.createTextVNode(" 5x ")
  1620. ])),
  1621. _: 1
  1622. })
  1623. ]),
  1624. _: 1
  1625. })
  1626. ]),
  1627. _: 1
  1628. }, 8, ["value"])
  1629. ]),
  1630. _: 1
  1631. }),
  1632. vue.createVNode(_component_NFormItem, {
  1633. label: "自动播放",
  1634. path: "video.autoplay"
  1635. }, {
  1636. default: vue.withCtx(() => [
  1637. vue.createVNode(_component_NSwitch, {
  1638. value: vue.unref(settingsRef).video.autoplay,
  1639. "onUpdate:value": _cache[9] || (_cache[9] = ($event) => vue.unref(settingsRef).video.autoplay = $event)
  1640. }, null, 8, ["value"])
  1641. ]),
  1642. _: 1
  1643. }),
  1644. vue.createVNode(_component_NFormItem, {
  1645. label: "同步播放进度",
  1646. path: "video.history"
  1647. }, {
  1648. default: vue.withCtx(() => [
  1649. vue.createVNode(_component_NSwitch, {
  1650. value: vue.unref(settingsRef).video.history,
  1651. "onUpdate:value": _cache[10] || (_cache[10] = ($event) => vue.unref(settingsRef).video.history = $event)
  1652. }, null, 8, ["value"])
  1653. ]),
  1654. _: 1
  1655. })
  1656. ]),
  1657. _: 1
  1658. }, 512)
  1659. ]),
  1660. _: 1
  1661. }),
  1662. vue.createVNode(_component_NTabPane, {
  1663. name: "cloudDownloadSetting",
  1664. tab: "离线下载设置"
  1665. }, {
  1666. default: vue.withCtx(() => [
  1667. vue.createVNode(_component_NForm, {
  1668. ref: "formRef",
  1669. "label-placement": "left",
  1670. "label-width": "auto",
  1671. "show-feedback": false
  1672. }, {
  1673. default: vue.withCtx(() => [
  1674. vue.createVNode(_component_NFormItem, {
  1675. label: "默认删除源文件",
  1676. path: "oldButton.deleteSource"
  1677. }, {
  1678. default: vue.withCtx(() => [
  1679. vue.createVNode(_component_NSwitch, {
  1680. value: vue.unref(settingsRef).oldButton.deleteSource,
  1681. "onUpdate:value": _cache[11] || (_cache[11] = ($event) => vue.unref(settingsRef).oldButton.deleteSource = $event)
  1682. }, null, 8, ["value"])
  1683. ]),
  1684. _: 1
  1685. })
  1686. ]),
  1687. _: 1
  1688. }, 512)
  1689. ]),
  1690. _: 1
  1691. }),
  1692. vue.createVNode(_component_NTabPane, {
  1693. name: "otherSeetting",
  1694. tab: "其他设置"
  1695. }, {
  1696. default: vue.withCtx(() => [
  1697. vue.createVNode(_component_NForm, {
  1698. ref: "formRef",
  1699. "label-placement": "left",
  1700. "label-width": "auto",
  1701. "show-feedback": false
  1702. }, {
  1703. default: vue.withCtx(() => [
  1704. vue.createVNode(_component_NFormItem, {
  1705. label: "火狐默认在身份组内打开标签",
  1706. path: "openNewTab.setParent"
  1707. }, {
  1708. default: vue.withCtx(() => [
  1709. vue.createVNode(_component_NSwitch, {
  1710. value: vue.unref(settingsRef).openNewTab.setParent,
  1711. "onUpdate:value": _cache[12] || (_cache[12] = ($event) => vue.unref(settingsRef).openNewTab.setParent = $event)
  1712. }, null, 8, ["value"])
  1713. ]),
  1714. _: 1
  1715. })
  1716. ]),
  1717. _: 1
  1718. }, 512)
  1719. ]),
  1720. _: 1
  1721. })
  1722. ]),
  1723. _: 1
  1724. })
  1725. ]),
  1726. _: 1
  1727. })
  1728. ]),
  1729. _: 1
  1730. }, 8, ["show"])
  1731. ]),
  1732. _: 1
  1733. }, 8, ["theme"])
  1734. ]);
  1735. };
  1736. }
  1737. });
  1738. const _export_sfc = (sfc, props) => {
  1739. const target = sfc.__vccOpts || sfc;
  1740. for (const [key, val] of props) {
  1741. target[key] = val;
  1742. }
  1743. return target;
  1744. };
  1745. const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-83bc69cf"]]);
  1746. const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
  1747. __name: "CloudDownload",
  1748. setup(__props) {
  1749. const theme = useTheme();
  1750. const options = [
  1751. {
  1752. label: "云下载",
  1753. key: "CloudDownload"
  1754. }
  1755. ];
  1756. const bc = new BroadcastChannel("115Plus");
  1757. const handleSelect = (option) => {
  1758. var _a;
  1759. if (option === "CloudDownload") {
  1760. bc.postMessage({
  1761. type: "CloudDownload",
  1762. url: (_a = window.top) == null ? void 0 : _a.location.href
  1763. });
  1764. }
  1765. };
  1766. const handleDownload = () => {
  1767. var _a;
  1768. bc.postMessage({
  1769. type: "OfflineDownload",
  1770. url: (_a = window.top) == null ? void 0 : _a.location.href
  1771. });
  1772. };
  1773. return (_ctx, _cache) => {
  1774. const _component_NButton = naiveUi.NButton;
  1775. const _component_NDropdown = naiveUi.NDropdown;
  1776. const _component_NConfigProvider = naiveUi.NConfigProvider;
  1777. return vue.openBlock(), vue.createBlock(_component_NConfigProvider, { theme: vue.unref(theme) }, {
  1778. default: vue.withCtx(() => [
  1779. vue.createVNode(_component_NDropdown, {
  1780. trigger: "hover",
  1781. options,
  1782. onSelect: handleSelect
  1783. }, {
  1784. default: vue.withCtx(() => [
  1785. vue.createVNode(_component_NButton, { onClick: handleDownload }, {
  1786. default: vue.withCtx(() => _cache[0] || (_cache[0] = [
  1787. vue.createTextVNode("离线下载")
  1788. ])),
  1789. _: 1
  1790. })
  1791. ]),
  1792. _: 1
  1793. })
  1794. ]),
  1795. _: 1
  1796. }, 8, ["theme"]);
  1797. };
  1798. }
  1799. });
  1800. const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
  1801. __name: "VideoModal",
  1802. props: /* @__PURE__ */ vue.mergeModels({
  1803. data: {}
  1804. }, {
  1805. "show": {
  1806. type: Boolean,
  1807. default: false
  1808. },
  1809. "showModifiers": {}
  1810. }),
  1811. emits: ["update:show"],
  1812. setup(__props) {
  1813. const show = vue.useModel(__props, "show");
  1814. const props = __props;
  1815. const message2 = naiveUi.useMessage();
  1816. const menuOptions = vue.ref([]);
  1817. const menuValue = vue.ref("");
  1818. const videoList = vue.ref([]);
  1819. const videoRef = vue.ref(null);
  1820. const player = vue.ref(null);
  1821. const saveTimer = vue.ref(null);
  1822. const layoutHeight = vue.ref(700);
  1823. vue.watch(show, (value) => {
  1824. if (value) {
  1825. videoList.value = [...props.data];
  1826. play();
  1827. }
  1828. });
  1829. const play = async () => {
  1830. try {
  1831. menuOptions.value = videoList.value.map((item) => {
  1832. return {
  1833. label: item.name,
  1834. key: item.code
  1835. };
  1836. });
  1837. menuValue.value = videoList.value[0].code;
  1838. videoList.value[0].url = await getVideoUrl(videoList.value[0].code);
  1839. videoList.value[0].time = await getVideoHistory(videoList.value[0].code) || 0;
  1840. if (videoRef.value) {
  1841. const playerConfig = {
  1842. el: videoRef.value,
  1843. url: videoList.value[0].url,
  1844. autoplay: settings ? settings.video.autoplay : true,
  1845. fluid: true,
  1846. volume: settings ? settings.video.volume : 1,
  1847. defaultPlaybackRate: settings ? settings.video.defaultPlaybackRate : 1,
  1848. playbackRate: { list: [5, 4, 3, 2, 1.5, 1.25, 1, 0.75, 0.5] },
  1849. rotate: true,
  1850. pip: true,
  1851. dynamicBg: {
  1852. disable: false
  1853. }
  1854. };
  1855. if (document.createElement("video").canPlayType("application/vnd.apple.mpegurl")) {
  1856. player.value = new Player(playerConfig);
  1857. } else if (HlsJsPlugin.isSupported()) {
  1858. player.value = new Player({
  1859. ...playerConfig,
  1860. isLive: false,
  1861. plugins: [HlsJsPlugin]
  1862. });
  1863. }
  1864. if (player.value) {
  1865. if (!settings || settings.video.history) {
  1866. player.value.currentTime = videoList.value[0].time;
  1867. saveTimer.value = setInterval(() => {
  1868. if (player.value.paused) {
  1869. return;
  1870. }
  1871. const time = player.value.currentTime;
  1872. if (time && Math.floor(time) !== videoList.value[0].time) {
  1873. videoList.value[0].time = Math.floor(time);
  1874. setVideoHistory(videoList.value[0].code, Math.floor(time));
  1875. }
  1876. }, 5e3);
  1877. }
  1878. player.value.on(Player.Events.VIDEO_RESIZE, () => {
  1879. var _a;
  1880. layoutHeight.value = ((_a = videoRef.value) == null ? void 0 : _a.clientHeight) || 700;
  1881. });
  1882. }
  1883. }
  1884. } catch (error) {
  1885. console.error(error);
  1886. message2.error(`视频播放失败,错误信息:${error}`);
  1887. }
  1888. };
  1889. const getVideoUrl = async (code) => {
  1890. var _a, _b, _c, _d;
  1891. const cookie = await getCookie();
  1892. const res = await request({
  1893. method: "GET",
  1894. url: `https://115vod.com/webapi/files/video?pickcode=${code}&share_id=0&local=1`,
  1895. cookie: `CID=${(_a = cookie.find((item) => item.name === "CID")) == null ? void 0 : _a.value};SEID=${(_b = cookie.find((item) => item.name === "SEID")) == null ? void 0 : _b.value};UID=${(_c = cookie.find((item) => item.name === "UID")) == null ? void 0 : _c.value};KID=${(_d = cookie.find((item) => item.name === "KID")) == null ? void 0 : _d.value}`,
  1896. anonymous: true
  1897. });
  1898. const json = JSON.parse(res.responseText);
  1899. if (json.state) {
  1900. if (json.video_url) {
  1901. return json.video_url.replace("http://", "https://");
  1902. } else {
  1903. throw new Error("视频地址获取失败");
  1904. }
  1905. } else {
  1906. throw new Error(json.error);
  1907. }
  1908. };
  1909. const getVideoHistory = async (code) => {
  1910. var _a, _b, _c, _d;
  1911. const cookie = await getCookie();
  1912. const res = await request({
  1913. method: "GET",
  1914. url: `https://115vod.com/webapi/files/history?pick_code=${code}&fetch=one&category=1&share_id=0`,
  1915. cookie: `CID=${(_a = cookie.find((item) => item.name === "CID")) == null ? void 0 : _a.value};SEID=${(_b = cookie.find((item) => item.name === "SEID")) == null ? void 0 : _b.value};UID=${(_c = cookie.find((item) => item.name === "UID")) == null ? void 0 : _c.value};KID=${(_d = cookie.find((item) => item.name === "KID")) == null ? void 0 : _d.value}`,
  1916. anonymous: true
  1917. });
  1918. const json = JSON.parse(res.responseText);
  1919. if (json.state) {
  1920. return json.data.time ? json.data.time : 0;
  1921. } else {
  1922. if (json.error) {
  1923. throw new Error(json.error);
  1924. } else {
  1925. return 0;
  1926. }
  1927. }
  1928. };
  1929. const setVideoHistory = async (code, time) => {
  1930. var _a, _b, _c, _d;
  1931. const cookie = await getCookie();
  1932. request({
  1933. method: "POST",
  1934. url: "https://115vod.com/webapi/files/history",
  1935. headers: {
  1936. "Content-Type": "application/x-www-form-urlencoded"
  1937. },
  1938. cookie: `CID=${(_a = cookie.find((item) => item.name === "CID")) == null ? void 0 : _a.value};SEID=${(_b = cookie.find((item) => item.name === "SEID")) == null ? void 0 : _b.value};UID=${(_c = cookie.find((item) => item.name === "UID")) == null ? void 0 : _c.value};KID=${(_d = cookie.find((item) => item.name === "KID")) == null ? void 0 : _d.value}`,
  1939. anonymous: true,
  1940. data: `op=update&pick_code=${code}&time=${time}&definition=0&category=1&share_id=0`
  1941. });
  1942. };
  1943. const handleVideoClose = () => {
  1944. if (saveTimer.value) {
  1945. clearInterval(saveTimer.value);
  1946. saveTimer.value = null;
  1947. }
  1948. if (player.value) {
  1949. player.value.destroy();
  1950. player.value = null;
  1951. }
  1952. show.value = false;
  1953. };
  1954. const handleMenuUpdate = async (value) => {
  1955. try {
  1956. if (player.value) {
  1957. const videoIndex = videoList.value.findIndex((item) => item.code === value);
  1958. if (!videoList.value[videoIndex].url) {
  1959. videoList.value[videoIndex].url = await getVideoUrl(value);
  1960. videoList.value[videoIndex].time = await getVideoHistory(value) || 0;
  1961. }
  1962. if (saveTimer.value) {
  1963. clearInterval(saveTimer.value);
  1964. saveTimer.value = null;
  1965. }
  1966. player.value.src = videoList.value[videoIndex].url;
  1967. if (!settings || settings.video.autoplay) {
  1968. player.value.play();
  1969. }
  1970. if (!settings || settings.video.history) {
  1971. player.value.currentTime = videoList.value[videoIndex].time;
  1972. saveTimer.value = setInterval(() => {
  1973. if (player.value.paused) {
  1974. return;
  1975. }
  1976. const time = player.value.currentTime;
  1977. if (time && Math.floor(time) !== videoList.value[videoIndex].time) {
  1978. videoList.value[videoIndex].time = Math.floor(time);
  1979. setVideoHistory(value, Math.floor(time));
  1980. }
  1981. }, 5e3);
  1982. }
  1983. }
  1984. } catch (error) {
  1985. console.error(error);
  1986. message2.error(`视频播放失败,错误信息:${error}`);
  1987. }
  1988. };
  1989. return (_ctx, _cache) => {
  1990. const _component_NMenu = naiveUi.NMenu;
  1991. const _component_NLayoutSider = naiveUi.NLayoutSider;
  1992. const _component_NLayout = naiveUi.NLayout;
  1993. const _component_NModal = naiveUi.NModal;
  1994. return vue.openBlock(), vue.createBlock(_component_NModal, {
  1995. show: show.value,
  1996. "onUpdate:show": _cache[1] || (_cache[1] = ($event) => show.value = $event),
  1997. style: { "width": "60%" },
  1998. title: "视频播放",
  1999. preset: "card",
  2000. bordered: false,
  2001. onAfterLeave: handleVideoClose
  2002. }, {
  2003. default: vue.withCtx(() => [
  2004. vue.createVNode(_component_NLayout, {
  2005. "has-sider": "",
  2006. "content-style": { height: vue.unref(layoutHeight) + "px" }
  2007. }, {
  2008. default: vue.withCtx(() => [
  2009. vue.createVNode(_component_NLayoutSider, {
  2010. "native-scrollbar": false,
  2011. bordered: ""
  2012. }, {
  2013. default: vue.withCtx(() => [
  2014. vue.createVNode(_component_NMenu, {
  2015. value: vue.unref(menuValue),
  2016. "onUpdate:value": [
  2017. _cache[0] || (_cache[0] = ($event) => vue.isRef(menuValue) ? menuValue.value = $event : null),
  2018. handleMenuUpdate
  2019. ],
  2020. options: vue.unref(menuOptions),
  2021. "theme-overrides": vue.unref(menuThemeOverrides)
  2022. }, null, 8, ["value", "options", "theme-overrides"])
  2023. ]),
  2024. _: 1
  2025. }),
  2026. vue.createVNode(_component_NLayout, { "native-scrollbar": false }, {
  2027. default: vue.withCtx(() => [
  2028. vue.createElementVNode("div", {
  2029. ref_key: "videoRef",
  2030. ref: videoRef,
  2031. class: "video-js"
  2032. }, null, 512)
  2033. ]),
  2034. _: 1
  2035. })
  2036. ]),
  2037. _: 1
  2038. }, 8, ["content-style"])
  2039. ]),
  2040. _: 1
  2041. }, 8, ["show"]);
  2042. };
  2043. }
  2044. });
  2045. const _hoisted_1 = { style: { "display": "flex", "justify-content": "space-between" } };
  2046. const _hoisted_2 = { style: { "display": "flex", "justify-content": "space-between" } };
  2047. const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
  2048. __name: "OfflineDownloadModal",
  2049. props: /* @__PURE__ */ vue.mergeModels({
  2050. signData: {},
  2051. downPath: {}
  2052. }, {
  2053. "show": {
  2054. type: Boolean,
  2055. default: false
  2056. },
  2057. "showModifiers": {}
  2058. }),
  2059. emits: ["update:show"],
  2060. setup(__props) {
  2061. const show = vue.useModel(__props, "show");
  2062. const props = __props;
  2063. const inputInstRef = vue.ref(null);
  2064. const message2 = naiveUi.useMessage();
  2065. const url = vue.ref("");
  2066. const pathId = vue.ref("");
  2067. const countData = vue.ref({
  2068. used: 0,
  2069. count: 0
  2070. });
  2071. const showCaptcha = vue.ref(false);
  2072. const iframe = vue.ref(null);
  2073. const showResult = vue.ref(false);
  2074. const resultData = vue.ref({
  2075. success: 0,
  2076. fail: 0,
  2077. list: []
  2078. });
  2079. const resultTitle = vue.computed(() => {
  2080. return (resultData.value.success ? resultData.value.success + "个任务添加成功," : "") + resultData.value.fail + "个任务添加失败";
  2081. });
  2082. vue.watch(show, (value) => {
  2083. if (value) {
  2084. getCount();
  2085. vue.nextTick(() => {
  2086. var _a;
  2087. (_a = inputInstRef.value) == null ? void 0 : _a.focus();
  2088. });
  2089. }
  2090. });
  2091. const getCount = async () => {
  2092. try {
  2093. const res = await request({
  2094. url: `https://115.com/web/lixian/?ct=lixian&ac=get_quota_package_info`,
  2095. method: "GET"
  2096. });
  2097. const json = JSON.parse(res.responseText);
  2098. countData.value.used = json.used;
  2099. countData.value.count = json.count;
  2100. if (json.used >= json.count) {
  2101. message2.error("本月配额已用完");
  2102. }
  2103. } catch (error) {
  2104. message2.error(error);
  2105. }
  2106. };
  2107. const handleDownload = async () => {
  2108. if (!url.value) {
  2109. message2.error("下载链接不能为空");
  2110. return;
  2111. }
  2112. if (pathId.value && !/^\d+$/.test(pathId.value)) {
  2113. message2.error("文件夹ID只能为数字");
  2114. return;
  2115. }
  2116. try {
  2117. const sp = new URLSearchParams();
  2118. sp.append("savepath", "");
  2119. sp.append("wp_path_id", pathId.value ? pathId.value : props.downPath.file_id);
  2120. const urls = url.value.split("\n").filter((item) => item.trim());
  2121. if (urls.length > 1) {
  2122. urls.forEach((item, index) => {
  2123. sp.append(`url[${index}]`, item);
  2124. });
  2125. } else {
  2126. sp.append("url", urls[0]);
  2127. }
  2128. sp.append("uid", props.downPath.user_id);
  2129. sp.append("sign", props.signData.sign);
  2130. sp.append("time", props.signData.time);
  2131. const res = await request({
  2132. url: `https://115.com/web/lixian/?ct=lixian&ac=add_task_url${urls.length > 1 ? "s" : ""}`,
  2133. method: "POST",
  2134. data: sp,
  2135. headers: {
  2136. "Content-Type": "application/x-www-form-urlencoded",
  2137. Accept: "application/json, text/javascript, */*; q=0.01",
  2138. Origin: "https://115.com",
  2139. "X-Requested-With": "XMLHttpRequest"
  2140. }
  2141. });
  2142. const json = JSON.parse(res.responseText);
  2143. if (json.state) {
  2144. if (urls.length > 1) {
  2145. json.result.forEach((item) => {
  2146. if (item.state) {
  2147. resultData.value.success++;
  2148. } else {
  2149. resultData.value.fail++;
  2150. resultData.value.list.push({ url: item.url, error: item.error_msg || "未知原因" });
  2151. }
  2152. });
  2153. if (resultData.value.fail) {
  2154. showResult.value = true;
  2155. return;
  2156. }
  2157. }
  2158. message2.success("添加下载成功");
  2159. show.value = false;
  2160. url.value = "";
  2161. pathId.value = "";
  2162. } else {
  2163. if (json.errcode === 911) {
  2164. message2.warning(json.error_msg);
  2165. showCaptcha.value = true;
  2166. vue.nextTick(() => {
  2167. if (iframe.value) {
  2168. iframe.value.onload = () => {
  2169. var _a;
  2170. const contentWindow = (_a = iframe.value) == null ? void 0 : _a.contentWindow;
  2171. const iframeUrl = contentWindow == null ? void 0 : contentWindow.location.href;
  2172. if (iframeUrl !== "https://captchaapi.115.com/?ac=security_code&type=web") {
  2173. message2.success("验证成功, 请重试");
  2174. showCaptcha.value = false;
  2175. }
  2176. };
  2177. }
  2178. });
  2179. } else {
  2180. if (json.error_msg) {
  2181. throw json.error_msg;
  2182. } else {
  2183. throw "添加失败";
  2184. }
  2185. }
  2186. }
  2187. } catch (error) {
  2188. message2.error(error);
  2189. }
  2190. };
  2191. const handleCencel = () => {
  2192. showResult.value = false;
  2193. show.value = false;
  2194. };
  2195. return (_ctx, _cache) => {
  2196. const _component_NInput = naiveUi.NInput;
  2197. const _component_NFormItem = naiveUi.NFormItem;
  2198. const _component_NButton = naiveUi.NButton;
  2199. const _component_NModal = naiveUi.NModal;
  2200. const _component_NEllipsis = naiveUi.NEllipsis;
  2201. const _component_NText = naiveUi.NText;
  2202. const _component_NListItem = naiveUi.NListItem;
  2203. const _component_NScrollbar = naiveUi.NScrollbar;
  2204. const _component_NList = naiveUi.NList;
  2205. const _component_NSpace = naiveUi.NSpace;
  2206. const _component_NResult = naiveUi.NResult;
  2207. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  2208. vue.createVNode(_component_NModal, {
  2209. show: show.value,
  2210. "onUpdate:show": _cache[2] || (_cache[2] = ($event) => show.value = $event),
  2211. style: { "width": "40%" },
  2212. title: "添加离线下载",
  2213. preset: "card",
  2214. bordered: false
  2215. }, {
  2216. action: vue.withCtx(() => [
  2217. vue.createElementVNode("div", _hoisted_1, [
  2218. vue.createElementVNode("div", null, "本月配额:剩" + vue.toDisplayString(vue.unref(countData).count - vue.unref(countData).used) + "/总" + vue.toDisplayString(vue.unref(countData).count), 1),
  2219. vue.createElementVNode("div", null, [
  2220. vue.createVNode(_component_NButton, {
  2221. type: "primary",
  2222. disabled: vue.unref(countData).used >= vue.unref(countData).count,
  2223. onClick: handleDownload
  2224. }, {
  2225. default: vue.withCtx(() => _cache[7] || (_cache[7] = [
  2226. vue.createTextVNode(" 开始下载 ")
  2227. ])),
  2228. _: 1
  2229. }, 8, ["disabled"])
  2230. ])
  2231. ])
  2232. ]),
  2233. default: vue.withCtx(() => [
  2234. vue.createElementVNode("div", null, [
  2235. vue.createVNode(_component_NInput, {
  2236. ref_key: "inputInstRef",
  2237. ref: inputInstRef,
  2238. value: vue.unref(url),
  2239. "onUpdate:value": _cache[0] || (_cache[0] = ($event) => vue.isRef(url) ? url.value = $event : null),
  2240. type: "textarea",
  2241. placeholder: "支持HTTP、HTTPS、FTP、磁力链和电驴链接,换行可添加多个",
  2242. clearable: "",
  2243. rows: 10
  2244. }, null, 8, ["value"]),
  2245. vue.createVNode(_component_NFormItem, {
  2246. label: "保存到:",
  2247. "label-placement": "left",
  2248. style: { "margin-top": "10px" }
  2249. }, {
  2250. default: vue.withCtx(() => [
  2251. vue.createVNode(_component_NInput, {
  2252. value: vue.unref(pathId),
  2253. "onUpdate:value": _cache[1] || (_cache[1] = ($event) => vue.isRef(pathId) ? pathId.value = $event : null),
  2254. placeholder: "暂时只支持填入文件夹ID,不填默认云下载文件夹"
  2255. }, null, 8, ["value"])
  2256. ]),
  2257. _: 1
  2258. })
  2259. ])
  2260. ]),
  2261. _: 1
  2262. }, 8, ["show"]),
  2263. vue.createVNode(_component_NModal, {
  2264. show: vue.unref(showCaptcha),
  2265. "onUpdate:show": _cache[3] || (_cache[3] = ($event) => vue.isRef(showCaptcha) ? showCaptcha.value = $event : null),
  2266. title: "验证账号",
  2267. style: { "width": "360px" },
  2268. preset: "card"
  2269. }, {
  2270. default: vue.withCtx(() => [
  2271. vue.createElementVNode("iframe", {
  2272. ref_key: "iframe",
  2273. ref: iframe,
  2274. src: "https://captchaapi.115.com/?ac=security_code&type=web",
  2275. style: { "width": "100%", "height": "500px", "border": "none" }
  2276. }, null, 512)
  2277. ]),
  2278. _: 1
  2279. }, 8, ["show"]),
  2280. vue.createVNode(_component_NModal, {
  2281. show: vue.unref(showResult),
  2282. "onUpdate:show": _cache[5] || (_cache[5] = ($event) => vue.isRef(showResult) ? showResult.value = $event : null),
  2283. title: "下载任务错误列表",
  2284. style: { "width": "40%" },
  2285. preset: "card",
  2286. "close-on-esc": false,
  2287. "mask-closable": false,
  2288. onAfterLeave: _cache[6] || (_cache[6] = () => {
  2289. vue.unref(resultData).success = 0;
  2290. vue.unref(resultData).fail = 0;
  2291. vue.unref(resultData).list = [];
  2292. })
  2293. }, {
  2294. default: vue.withCtx(() => [
  2295. vue.createVNode(_component_NResult, {
  2296. status: "warning",
  2297. size: "small",
  2298. title: vue.unref(resultTitle)
  2299. }, {
  2300. footer: vue.withCtx(() => [
  2301. vue.createVNode(_component_NSpace, { justify: "end" }, {
  2302. default: vue.withCtx(() => [
  2303. vue.createVNode(_component_NButton, { onClick: handleCencel }, {
  2304. default: vue.withCtx(() => _cache[9] || (_cache[9] = [
  2305. vue.createTextVNode("取消")
  2306. ])),
  2307. _: 1
  2308. }),
  2309. vue.createVNode(_component_NButton, {
  2310. type: "primary",
  2311. onClick: _cache[4] || (_cache[4] = ($event) => showResult.value = false)
  2312. }, {
  2313. default: vue.withCtx(() => _cache[10] || (_cache[10] = [
  2314. vue.createTextVNode("重试")
  2315. ])),
  2316. _: 1
  2317. })
  2318. ]),
  2319. _: 1
  2320. })
  2321. ]),
  2322. default: vue.withCtx(() => [
  2323. vue.createVNode(_component_NList, null, {
  2324. header: vue.withCtx(() => _cache[8] || (_cache[8] = [
  2325. vue.createTextVNode(" 失败任务列表: ")
  2326. ])),
  2327. default: vue.withCtx(() => [
  2328. vue.createVNode(_component_NScrollbar, { style: { "max-height": "120px" } }, {
  2329. default: vue.withCtx(() => [
  2330. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(resultData).list, (item, index) => {
  2331. return vue.openBlock(), vue.createBlock(_component_NListItem, { key: index }, {
  2332. default: vue.withCtx(() => [
  2333. vue.createElementVNode("div", _hoisted_2, [
  2334. vue.createVNode(_component_NEllipsis, { style: { "max-width": "300px" } }, {
  2335. default: vue.withCtx(() => [
  2336. vue.createTextVNode(vue.toDisplayString(item.url), 1)
  2337. ]),
  2338. _: 2
  2339. }, 1024),
  2340. vue.createElementVNode("div", null, [
  2341. vue.createVNode(_component_NText, { type: "error" }, {
  2342. default: vue.withCtx(() => [
  2343. vue.createTextVNode(vue.toDisplayString(item.error), 1)
  2344. ]),
  2345. _: 2
  2346. }, 1024)
  2347. ])
  2348. ])
  2349. ]),
  2350. _: 2
  2351. }, 1024);
  2352. }), 128))
  2353. ]),
  2354. _: 1
  2355. })
  2356. ]),
  2357. _: 1
  2358. })
  2359. ]),
  2360. _: 1
  2361. }, 8, ["title"])
  2362. ]),
  2363. _: 1
  2364. }, 8, ["show"])
  2365. ], 64);
  2366. };
  2367. }
  2368. });
  2369. /**
  2370. * filesize
  2371. *
  2372. * @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
  2373. * @license BSD-3-Clause
  2374. * @version 10.1.6
  2375. */
  2376. const ARRAY = "array";
  2377. const BIT = "bit";
  2378. const BITS = "bits";
  2379. const BYTE = "byte";
  2380. const BYTES = "bytes";
  2381. const EMPTY = "";
  2382. const EXPONENT = "exponent";
  2383. const FUNCTION = "function";
  2384. const IEC = "iec";
  2385. const INVALID_NUMBER = "Invalid number";
  2386. const INVALID_ROUND = "Invalid rounding method";
  2387. const JEDEC = "jedec";
  2388. const OBJECT = "object";
  2389. const PERIOD = ".";
  2390. const ROUND = "round";
  2391. const S = "s";
  2392. const SI = "si";
  2393. const SI_KBIT = "kbit";
  2394. const SI_KBYTE = "kB";
  2395. const SPACE = " ";
  2396. const STRING = "string";
  2397. const ZERO = "0";
  2398. const STRINGS = {
  2399. symbol: {
  2400. iec: {
  2401. bits: ["bit", "Kibit", "Mibit", "Gibit", "Tibit", "Pibit", "Eibit", "Zibit", "Yibit"],
  2402. bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
  2403. },
  2404. jedec: {
  2405. bits: ["bit", "Kbit", "Mbit", "Gbit", "Tbit", "Pbit", "Ebit", "Zbit", "Ybit"],
  2406. bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
  2407. }
  2408. },
  2409. fullform: {
  2410. iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
  2411. jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
  2412. }
  2413. };
  2414. function filesize(arg, {
  2415. bits = false,
  2416. pad = false,
  2417. base = -1,
  2418. round = 2,
  2419. locale = EMPTY,
  2420. localeOptions = {},
  2421. separator = EMPTY,
  2422. spacer = SPACE,
  2423. symbols = {},
  2424. standard = EMPTY,
  2425. output = STRING,
  2426. fullform = false,
  2427. fullforms = [],
  2428. exponent = -1,
  2429. roundingMethod = ROUND,
  2430. precision = 0
  2431. } = {}) {
  2432. let e = exponent, num = Number(arg), result = [], val = 0, u = EMPTY;
  2433. if (standard === SI) {
  2434. base = 10;
  2435. standard = JEDEC;
  2436. } else if (standard === IEC || standard === JEDEC) {
  2437. base = 2;
  2438. } else if (base === 2) {
  2439. standard = IEC;
  2440. } else {
  2441. base = 10;
  2442. standard = JEDEC;
  2443. }
  2444. const ceil = base === 10 ? 1e3 : 1024, full = fullform === true, neg = num < 0, roundingFunc = Math[roundingMethod];
  2445. if (typeof arg !== "bigint" && isNaN(arg)) {
  2446. throw new TypeError(INVALID_NUMBER);
  2447. }
  2448. if (typeof roundingFunc !== FUNCTION) {
  2449. throw new TypeError(INVALID_ROUND);
  2450. }
  2451. if (neg) {
  2452. num = -num;
  2453. }
  2454. if (e === -1 || isNaN(e)) {
  2455. e = Math.floor(Math.log(num) / Math.log(ceil));
  2456. if (e < 0) {
  2457. e = 0;
  2458. }
  2459. }
  2460. if (e > 8) {
  2461. if (precision > 0) {
  2462. precision += 8 - e;
  2463. }
  2464. e = 8;
  2465. }
  2466. if (output === EXPONENT) {
  2467. return e;
  2468. }
  2469. if (num === 0) {
  2470. result[0] = 0;
  2471. u = result[1] = STRINGS.symbol[standard][bits ? BITS : BYTES][e];
  2472. } else {
  2473. val = num / (base === 2 ? Math.pow(2, e * 10) : Math.pow(1e3, e));
  2474. if (bits) {
  2475. val = val * 8;
  2476. if (val >= ceil && e < 8) {
  2477. val = val / ceil;
  2478. e++;
  2479. }
  2480. }
  2481. const p = Math.pow(10, e > 0 ? round : 0);
  2482. result[0] = roundingFunc(val * p) / p;
  2483. if (result[0] === ceil && e < 8 && exponent === -1) {
  2484. result[0] = 1;
  2485. e++;
  2486. }
  2487. u = result[1] = base === 10 && e === 1 ? bits ? SI_KBIT : SI_KBYTE : STRINGS.symbol[standard][bits ? BITS : BYTES][e];
  2488. }
  2489. if (neg) {
  2490. result[0] = -result[0];
  2491. }
  2492. if (precision > 0) {
  2493. result[0] = result[0].toPrecision(precision);
  2494. }
  2495. result[1] = symbols[result[1]] || result[1];
  2496. if (locale === true) {
  2497. result[0] = result[0].toLocaleString();
  2498. } else if (locale.length > 0) {
  2499. result[0] = result[0].toLocaleString(locale, localeOptions);
  2500. } else if (separator.length > 0) {
  2501. result[0] = result[0].toString().replace(PERIOD, separator);
  2502. }
  2503. if (pad && round > 0) {
  2504. const i = result[0].toString(), x = separator || ((i.match(/(\D)/g) || []).pop() || PERIOD), tmp = i.toString().split(x), s = tmp[1] || EMPTY, l = s.length, n = round - l;
  2505. result[0] = `${tmp[0]}${x}${s.padEnd(l + n, ZERO)}`;
  2506. }
  2507. if (full) {
  2508. result[1] = fullforms[e] ? fullforms[e] : STRINGS.fullform[standard][e] + (bits ? BIT : BYTE) + (result[0] === 1 ? EMPTY : S);
  2509. }
  2510. return output === ARRAY ? result : output === OBJECT ? {
  2511. value: result[0],
  2512. symbol: result[1],
  2513. exponent: e,
  2514. unit: u
  2515. } : result.join(spacer);
  2516. }
  2517. const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
  2518. __name: "CloudDownloadModal",
  2519. props: /* @__PURE__ */ vue.mergeModels({
  2520. signData: {},
  2521. downPath: {}
  2522. }, {
  2523. "show": {
  2524. type: Boolean,
  2525. default: false
  2526. },
  2527. "showModifiers": {}
  2528. }),
  2529. emits: ["update:show"],
  2530. setup(__props) {
  2531. const show = vue.useModel(__props, "show");
  2532. const props = __props;
  2533. const message2 = naiveUi.useMessage();
  2534. const dialog = naiveUi.useDialog();
  2535. const {
  2536. copy
  2537. } = useClipboard();
  2538. const columns = [{
  2539. title: "文件名",
  2540. key: "name"
  2541. }, {
  2542. title: "大小",
  2543. key: "size",
  2544. width: 100,
  2545. render(row) {
  2546. return filesize(row.size, {
  2547. standard: "jedec"
  2548. });
  2549. }
  2550. }, {
  2551. title: "进度",
  2552. key: "percentDone",
  2553. width: 300,
  2554. render(row) {
  2555. if (row.percentDone === 100) {
  2556. return "已完成";
  2557. } else {
  2558. return vue.createVNode(naiveUi.NProgress, {
  2559. "type": "line",
  2560. "percentage": Math.floor(row.percentDone),
  2561. "processing": true
  2562. }, null);
  2563. }
  2564. }
  2565. }, {
  2566. title: "操作",
  2567. key: "action",
  2568. width: 150,
  2569. render: (row) => {
  2570. return vue.createVNode(naiveUi.NSpace, null, {
  2571. default: () => [row.file_id ? vue.createVNode(naiveUi.NButton, {
  2572. "text": true,
  2573. "onClick": () => _GM_openInTab(`https://115.com/?cid=${row.file_id}&offset=0&tab=&mode=wangpan`, {
  2574. setParent: settings == null ? void 0 : settings.openNewTab.setParent
  2575. })
  2576. }, {
  2577. icon: () => vue.createVNode(naiveUi.NIcon, null, {
  2578. default: () => [vue.createVNode(FolderOutlined, null, null)]
  2579. })
  2580. }) : null, vue.createVNode(naiveUi.NButton, {
  2581. "text": true,
  2582. "onClick": async () => {
  2583. await copy(row.url);
  2584. message2.success("复制成功!");
  2585. }
  2586. }, {
  2587. icon: () => vue.createVNode(naiveUi.NIcon, null, {
  2588. default: () => [vue.createVNode(CopyOutlined, null, null)]
  2589. })
  2590. }), vue.createVNode(naiveUi.NButton, {
  2591. "text": true,
  2592. "onClick": () => {
  2593. dialog.warning({
  2594. title: "信息提示",
  2595. content: () => vue.createVNode("div", {
  2596. "style": {
  2597. display: "flex",
  2598. flexDirection: "column",
  2599. alignItems: "center"
  2600. }
  2601. }, [vue.createVNode("div", {
  2602. "style": {
  2603. marginBottom: "10px"
  2604. }
  2605. }, [vue.createTextVNode("是否确认删除该下载任务?")]), vue.createVNode(naiveUi.NCheckbox, {
  2606. "checked": flag.value,
  2607. "onUpdate:checked": ($event) => flag.value = $event,
  2608. "checked-value": 1,
  2609. "unchecked-value": 0
  2610. }, {
  2611. default: () => [vue.createTextVNode("删除源文件")]
  2612. })]),
  2613. positiveText: "确定",
  2614. negativeText: "取消",
  2615. onPositiveClick: () => {
  2616. handleDelete(row.info_hash);
  2617. }
  2618. });
  2619. }
  2620. }, {
  2621. icon: () => vue.createVNode(naiveUi.NIcon, null, {
  2622. default: () => [vue.createVNode(DeleteOutlined, null, null)]
  2623. })
  2624. })]
  2625. });
  2626. }
  2627. }];
  2628. const data = vue.ref([]);
  2629. const pagination = vue.reactive({
  2630. page: 1,
  2631. pageCount: 1,
  2632. pageSize: 30
  2633. });
  2634. const loading = vue.ref(false);
  2635. const flag = vue.ref(0);
  2636. vue.onMounted(() => {
  2637. if (settings == null ? void 0 : settings.oldButton.deleteSource) {
  2638. flag.value = 1;
  2639. }
  2640. });
  2641. vue.watch(show, (value) => {
  2642. if (value) {
  2643. getList();
  2644. }
  2645. });
  2646. const getList = async (page) => {
  2647. try {
  2648. loading.value = true;
  2649. const sp = new URLSearchParams();
  2650. sp.append("sign", props.signData.sign);
  2651. sp.append("time", props.signData.time);
  2652. sp.append("page", page ? page.toString() : pagination.page.toString());
  2653. sp.append("uid", props.downPath.user_id);
  2654. const res = await request({
  2655. url: `https://115.com/web/lixian/?ct=lixian&ac=task_lists`,
  2656. method: "POST",
  2657. data: sp,
  2658. headers: {
  2659. "Content-Type": "application/x-www-form-urlencoded"
  2660. }
  2661. });
  2662. const json = JSON.parse(res.responseText);
  2663. if (json.state) {
  2664. data.value = json.tasks;
  2665. pagination.page = json.page;
  2666. pagination.pageCount = json.page_count;
  2667. pagination.itemCount = json.count;
  2668. } else {
  2669. if (json.error) {
  2670. throw new Error(json.error);
  2671. } else {
  2672. throw new Error("获取签名失败");
  2673. }
  2674. }
  2675. } catch (error) {
  2676. message2.error(error);
  2677. } finally {
  2678. loading.value = false;
  2679. }
  2680. };
  2681. const handlePageChange = (page) => {
  2682. getList(page);
  2683. };
  2684. const handleDelete = async (hash) => {
  2685. try {
  2686. const sp = new URLSearchParams();
  2687. sp.append("sign", props.signData.sign);
  2688. sp.append("time", props.signData.time);
  2689. sp.append("hash[0]", hash);
  2690. sp.append("uid", props.downPath.user_id);
  2691. if (flag.value) {
  2692. sp.append("flag", flag.value.toString());
  2693. }
  2694. const res = await request({
  2695. url: `https://115.com/web/lixian/?ct=lixian&ac=task_del`,
  2696. method: "POST",
  2697. data: sp,
  2698. headers: {
  2699. "Content-Type": "application/x-www-form-urlencoded"
  2700. }
  2701. });
  2702. const json = JSON.parse(res.responseText);
  2703. if (json.state) {
  2704. message2.success("删除成功");
  2705. getList();
  2706. } else {
  2707. if (json.error) {
  2708. throw new Error(json.error);
  2709. } else {
  2710. throw new Error("删除失败");
  2711. }
  2712. }
  2713. } catch (error) {
  2714. message2.error(error);
  2715. }
  2716. };
  2717. return (_ctx, _cache) => {
  2718. const _component_NDataTable = naiveUi.NDataTable;
  2719. const _component_NModal = naiveUi.NModal;
  2720. return vue.openBlock(), vue.createBlock(_component_NModal, {
  2721. show: show.value,
  2722. "onUpdate:show": _cache[0] || (_cache[0] = ($event) => show.value = $event),
  2723. style: {
  2724. "width": "80%"
  2725. },
  2726. title: "云下载",
  2727. preset: "card",
  2728. bordered: false
  2729. }, {
  2730. default: vue.withCtx(() => [vue.createVNode(_component_NDataTable, {
  2731. remote: "",
  2732. "flex-height": "",
  2733. columns,
  2734. data: vue.unref(data),
  2735. pagination: vue.unref(pagination),
  2736. "row-key": (row) => row.info_hash,
  2737. loading: vue.unref(loading),
  2738. style: {
  2739. "height": "70vh"
  2740. },
  2741. "onUpdate:page": handlePageChange
  2742. }, null, 8, ["data", "pagination", "row-key", "loading"])]),
  2743. _: 1
  2744. }, 8, ["show"]);
  2745. };
  2746. }
  2747. });
  2748. const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
  2749. __name: "AppContent",
  2750. setup(__props) {
  2751. const message2 = naiveUi.useMessage();
  2752. const isLeft = usePageLeave();
  2753. const bc = new BroadcastChannel("115Plus");
  2754. const showList = vue.ref(false);
  2755. const showDownload = vue.ref(false);
  2756. const showVideo = vue.ref(false);
  2757. const videoList = vue.ref([]);
  2758. const signData = vue.ref({
  2759. sign: "",
  2760. time: ""
  2761. });
  2762. const downPath = vue.ref({
  2763. file_id: "",
  2764. user_id: ""
  2765. });
  2766. vue.onMounted(async () => {
  2767. bc.onmessage = (event) => {
  2768. console.log(event.data);
  2769. if (isLeft.value || event.data.url !== window.location.href) {
  2770. return;
  2771. }
  2772. if (event.data.type === "CloudDownload") {
  2773. showList.value = true;
  2774. } else if (event.data.type === "VideoPlay") {
  2775. videoList.value = JSON.parse(event.data.data);
  2776. showVideo.value = true;
  2777. } else if (event.data.type === "OfflineDownload") {
  2778. showDownload.value = true;
  2779. }
  2780. };
  2781. const cookies = await getCookie();
  2782. if (cookies.find((item) => item.name === "UID")) {
  2783. getSign();
  2784. getDownPath();
  2785. }
  2786. });
  2787. const getSign = async () => {
  2788. try {
  2789. const res = await request({
  2790. url: `https://115.com/?ct=offline&ac=space&_${Date.now()}`,
  2791. method: "GET"
  2792. });
  2793. const json = JSON.parse(res.responseText);
  2794. if (json.state) {
  2795. signData.value.sign = json.sign;
  2796. signData.value.time = json.time;
  2797. } else {
  2798. if (json.error) {
  2799. throw new Error(json.error);
  2800. } else {
  2801. throw new Error("获取签名失败");
  2802. }
  2803. }
  2804. } catch (error) {
  2805. message2.error(error);
  2806. }
  2807. };
  2808. const getDownPath = async () => {
  2809. try {
  2810. const res = await request({
  2811. url: `https://webapi.115.com/offine/downpath`,
  2812. method: "GET"
  2813. });
  2814. const json = JSON.parse(res.responseText);
  2815. if (json.state) {
  2816. downPath.value.file_id = json.data[0].file_id;
  2817. downPath.value.user_id = json.data[0].user_id;
  2818. } else {
  2819. if (json.error) {
  2820. throw new Error(json.error);
  2821. } else {
  2822. throw new Error("获取云下载路径失败");
  2823. }
  2824. }
  2825. } catch (error) {
  2826. message2.error(error);
  2827. }
  2828. };
  2829. return (_ctx, _cache) => {
  2830. const _component_CloudDownloadModal = _sfc_main$2;
  2831. const _component_OfflineDownloadModal = _sfc_main$3;
  2832. const _component_VideoModal = _sfc_main$4;
  2833. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  2834. vue.createVNode(_component_CloudDownloadModal, {
  2835. show: vue.unref(showList),
  2836. "onUpdate:show": _cache[0] || (_cache[0] = ($event) => vue.isRef(showList) ? showList.value = $event : null),
  2837. "down-path": vue.unref(downPath),
  2838. "sign-data": vue.unref(signData)
  2839. }, null, 8, ["show", "down-path", "sign-data"]),
  2840. vue.createVNode(_component_OfflineDownloadModal, {
  2841. show: vue.unref(showDownload),
  2842. "onUpdate:show": _cache[1] || (_cache[1] = ($event) => vue.isRef(showDownload) ? showDownload.value = $event : null),
  2843. "down-path": vue.unref(downPath),
  2844. "sign-data": vue.unref(signData)
  2845. }, null, 8, ["show", "down-path", "sign-data"]),
  2846. vue.createVNode(_component_VideoModal, {
  2847. show: vue.unref(showVideo),
  2848. "onUpdate:show": _cache[2] || (_cache[2] = ($event) => vue.isRef(showVideo) ? showVideo.value = $event : null),
  2849. data: vue.unref(videoList)
  2850. }, null, 8, ["show", "data"])
  2851. ], 64);
  2852. };
  2853. }
  2854. });
  2855. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  2856. __name: "App",
  2857. setup(__props) {
  2858. const theme = useTheme();
  2859. return (_ctx, _cache) => {
  2860. const _component_AppContent = _sfc_main$1;
  2861. const _component_NMessageProvider = naiveUi.NMessageProvider;
  2862. const _component_NModalProvider = naiveUi.NModalProvider;
  2863. const _component_NDialogProvider = naiveUi.NDialogProvider;
  2864. const _component_NConfigProvider = naiveUi.NConfigProvider;
  2865. return vue.openBlock(), vue.createBlock(_component_NConfigProvider, { theme: vue.unref(theme) }, {
  2866. default: vue.withCtx(() => [
  2867. vue.createVNode(_component_NDialogProvider, null, {
  2868. default: vue.withCtx(() => [
  2869. vue.createVNode(_component_NModalProvider, null, {
  2870. default: vue.withCtx(() => [
  2871. vue.createVNode(_component_NMessageProvider, null, {
  2872. default: vue.withCtx(() => [
  2873. vue.createVNode(_component_AppContent)
  2874. ]),
  2875. _: 1
  2876. })
  2877. ]),
  2878. _: 1
  2879. })
  2880. ]),
  2881. _: 1
  2882. })
  2883. ]),
  2884. _: 1
  2885. }, 8, ["theme"]);
  2886. };
  2887. }
  2888. });
  2889. const { message } = naiveUi.createDiscreteApi(["message"]);
  2890. if (settings) {
  2891. let newSettings = settings;
  2892. let flag = false;
  2893. if (!settings.darkMode) {
  2894. newSettings = {
  2895. ...newSettings,
  2896. darkMode: {
  2897. enable: false
  2898. }
  2899. };
  2900. flag = true;
  2901. }
  2902. if (!settings.fp) {
  2903. newSettings = {
  2904. ...newSettings,
  2905. fp: {
  2906. enable: true
  2907. }
  2908. };
  2909. flag = true;
  2910. }
  2911. if (typeof settings.oldButton.deleteSource !== "boolean") {
  2912. newSettings = {
  2913. ...newSettings,
  2914. oldButton: {
  2915. enable: settings.oldButton.enable,
  2916. deleteSource: true
  2917. }
  2918. };
  2919. flag = true;
  2920. }
  2921. if (typeof settings.openNewTab.setParent !== "boolean") {
  2922. newSettings = {
  2923. ...newSettings,
  2924. openNewTab: {
  2925. enable: settings.openNewTab.enable,
  2926. setParent: false
  2927. }
  2928. };
  2929. flag = true;
  2930. }
  2931. _GM_setValue("settings", newSettings);
  2932. if (flag) {
  2933. message.loading("115+ 功能更新中,即将刷新页面……");
  2934. setTimeout(() => {
  2935. window.location.reload();
  2936. }, 3e3);
  2937. }
  2938. }
  2939. if (window.top === window.self) {
  2940. vue.createApp(_sfc_main).mount(
  2941. (() => {
  2942. const body = document.querySelector("body");
  2943. const app = document.createElement("div");
  2944. if (body) {
  2945. body.appendChild(app);
  2946. }
  2947. return app;
  2948. })()
  2949. );
  2950. }
  2951. vue.createApp(Setting).mount(
  2952. (() => {
  2953. const top_side = document.querySelector(".top-side");
  2954. const setting = document.createElement("div");
  2955. if (top_side) {
  2956. top_side.appendChild(setting);
  2957. }
  2958. return setting;
  2959. })()
  2960. );
  2961. if (!settings || settings.sidebar.enable) {
  2962. vue.createApp(_sfc_main$9).mount(
  2963. (() => {
  2964. const wrap_hflow = document.getElementsByClassName("wrap-hflow")[0];
  2965. const site_left_bar = document.getElementById("site_left_bar");
  2966. const sidebar = document.createElement("div");
  2967. sidebar.addEventListener("mousedown", (e) => {
  2968. e.stopPropagation();
  2969. });
  2970. if (site_left_bar && wrap_hflow) {
  2971. wrap_hflow.insertBefore(sidebar, site_left_bar);
  2972. wrap_hflow.removeChild(site_left_bar);
  2973. }
  2974. return sidebar;
  2975. })()
  2976. );
  2977. }
  2978. if (!settings || settings.download.enable || settings.openNewTab.enable || settings.video.enable) {
  2979. vue.createApp(_sfc_main$7).mount(
  2980. (() => {
  2981. const js_top_header_file_path_box = document.getElementById("js_top_header_file_path_box");
  2982. const download = document.createElement("div");
  2983. download.addEventListener("mousedown", (e) => {
  2984. e.stopPropagation();
  2985. });
  2986. if (js_top_header_file_path_box) {
  2987. js_top_header_file_path_box.appendChild(download);
  2988. }
  2989. return download;
  2990. })()
  2991. );
  2992. }
  2993. if (!settings || settings.oldButton.enable) {
  2994. vue.createApp(_sfc_main$5).mount(
  2995. (() => {
  2996. const upload_btn_add_dir = document.querySelector(
  2997. 'a[data-dropdown-tab="upload_btn_add_dir"]'
  2998. );
  2999. const cloudDownload = document.createElement("div");
  3000. cloudDownload.addEventListener("mousedown", (e) => {
  3001. e.stopPropagation();
  3002. });
  3003. cloudDownload.style.display = "inline-block";
  3004. if (upload_btn_add_dir) {
  3005. upload_btn_add_dir.parentNode.insertBefore(cloudDownload, upload_btn_add_dir.nextSibling);
  3006. }
  3007. return cloudDownload;
  3008. })()
  3009. );
  3010. }
  3011. if (!settings || settings.fp.enable) {
  3012. const observer = new MutationObserver((mutationsList) => {
  3013. mutationsList.some((mutation) => {
  3014. if (mutation.type === "childList" && mutation.addedNodes.length > 0) {
  3015. const fp = document.querySelector('div[class|="fp"]');
  3016. if (fp && fp.style.display !== "none") {
  3017. fp.style.display = "none";
  3018. }
  3019. return true;
  3020. }
  3021. return false;
  3022. });
  3023. });
  3024. observer.observe(document.querySelector("body"), { childList: true });
  3025. }
  3026.  
  3027. })(Vue, naive, CryptoJS, bigInt, Player, HlsJsPlugin);