diff --git a/bilibili-evolved.offline.user.js b/bilibili-evolved.offline.user.js index 8b3138631..70abfb707 100644 --- a/bilibili-evolved.offline.user.js +++ b/bilibili-evolved.offline.user.js @@ -542,12 +542,12 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/toast.min.scss"] = `.toast-card-container{position:fixed;left:16px;bottom:16px;display:flex;flex-direction:column;align-items:start;z-index:100001;}.toast-card{background:#444;min-width:240px;border-radius:8px;box-shadow:0 1px 20px rgba(0,0,0,.1);height:0;transition:all 0.3s cubic-bezier(0.18,0.89,0.32,1.28);transform:translateY(16px);transform-origin:bottom;opacity:0;overflow:hidden;display:flex;flex-direction:column;}.toast-card.visible{height:96px;transform:scale(1) translateY(0);opacity:0.95;margin-top:16px;}.toast-card-header{display:flex;align-items:center;}.toast-card-title{font-size:18px;color:#fff6;margin:16px;font-weight:bold;flex:1 1 auto;}svg.toast-card-dismiss{height:24px;width:24px;flex:0 0 auto;padding:16px;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:all .2s ease-out;transform-origin:center;}svg.toast-card-dismiss:hover{transform:scale(1.2);}svg.toast-card-dismiss:active{transform:scale(1.1);}svg.toast-card-dismiss path{fill:#fff6;}.toast-card-message{color:#eeed;font-size:14px;margin:16px;margin-top:0;}.toast-card.toast-default{background:#444;}.toast-card.toast-error{background:#652020;}.toast-card.toast-info{background:#303d61;}.toast-card.toast-success{background:#274227;}.toast-card span,.toast-card .link{display:inline-block;padding:4px 8px;background-color:rgba(0,0,0,.1);border-radius:4px;text-decoration:none;color:#eeed;transition:all .2s ease-out;}.toast-card .link:hover{background-color:rgba(0,0,0,.2);}.toast-card .link:active{background-color:rgba(0,0,0,.1);}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/blur-video-control.min.css"] = `@supports (backdrop-filter: blur(48px)) or (-webkit-backdrop-filter: blur(48px)){.video-control-blur-layer{width:100%;height:100%;position:absolute;-webkit-backdrop-filter:blur(48px);backdrop-filter:blur(48px);z-index:-1;}.bui-slider .bui-track.bui-track-video-progress .bui-bar-wrap{background-color:transparent!important;}.bilibili-player-area .bilibili-player-video-control-wrap{transition:none!important;}}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/force-wide.min.scss"] = `@media screen and (min-width: $forceWideMinWidth){.bili-wrapper{width:1160px;}.bili-wrapper .l-con{width:900px;}.bili-header-m .bili-wrapper{width:1160px;}.bili-header-m .bili-wrapper .l-con{width:900px;}.gg-floor-module{width:1160px;max-height:96px;}.bangumi-timing-module .headline .bili-tab{width:650px;}.bangumi-timing-module .headline .bili-tab .bili-tab-item{width:70px;}.bangumi-timing-module .card-timing:first-child:nth-child(4),.bangumi-timing-module .card-timing:nth-child(2):nth-child(4),.bangumi-timing-module .card-timing:nth-child(3):nth-child(4),.bangumi-timing-module .card-timing:nth-child(4):nth-child(4){padding-top:0;}.bangumi-timing-module .card-timing{padding:36px 34px 0 0;}.audio-list .song-list .song-li:nth-child(5n) .content .text{margin-right:0;}.audiolist-list .song-list .song-li:nth-child(5n) .content .text{margin-right:0;}.elevator-module{margin-left:590px;}#primary_menu,#primary_menu>ul.nav-menu,.uns_box li.u-i.b-post{display:flex;align-items:center;justify-content:space-between;}.primary-menu{width:100%;}.primary-menu .nav-menu{flex-grow:1;}.primary-menu .nav-gif{position:static;margin-left:2%;}.primary-menu .nav-menu>li{margin-right:0!important;}.primary-menu .nav-menu>li.home{padding-right:1%;}}`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.scss"] = `.download-video-panel.opened{transform:scaleY(1);}.download-video-panel{position:absolute;top:calc(100% + 8px);transition:all .16s ease-out;transform-origin:top;transform:scaleY(0);background:white;border-radius:4px;box-shadow:0px 3px 20px 2px #0004;z-index:100;}.gui-settings-content ol.video-quality li,.video-action>div{cursor:pointer;align-items:center;margin:0;padding:8px 16px;border-radius:4px;transition:all .2s ease-out;}.gui-settings-content ol.video-quality li:hover{background:rgba(0,0,0,0.16);}.video-quality,.video-progress,.video-action,.video-error{display:none;}.download-video-panel.quality:not(.error) .video-quality,.download-video-panel.progress:not(.error) .video-progress,.download-video-panel.action:not(.error) .video-action,.download-video-panel.error .video-error{display:block;}.download-progress-text{display:flex;}.download-progress-title{flex:1 0 0;}.download-progress-background{background-color:#8884;height:4px;width:100%;margin-top:4px;}.download-progress-foreground{background-color:$customStyleColor;transform-origin:left;transition:all .2s ease-out;transform:scaleX(0);height:100%;width:100%;}.video-error,.video-progress{padding:12px;}.video-progress{min-width:160px;}#video-complete{display:none;}`; +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.scss"] = `.download-video-panel.opened{transform:scaleY(1);}.download-video-panel{position:absolute;top:calc(100% + 8px);transition:all .16s ease-out;transform-origin:top;transform:scaleY(0);background:white;border-radius:4px;box-shadow:0px 3px 20px 2px #0004;z-index:100;}.gui-settings-content ol.video-quality li,.video-action>div{cursor:pointer;align-items:center;margin:0;padding:8px 16px;border-radius:4px;transition:all .2s ease-out;}.video-action>div{padding:12px 24px;}.gui-settings-content ol.video-quality li:hover,.video-action>div:hover{background:rgba(0,0,0,0.16);}.video-quality,.video-progress,.video-action,.video-error{display:none;}.download-video-panel.quality:not(.error) .video-quality,.download-video-panel.progress:not(.error) .video-progress,.download-video-panel.action:not(.error) .video-action,.download-video-panel.error .video-error{display:block;}.download-progress-text{display:flex;}.download-progress-title{flex:1 0 0;}.download-progress-background{background-color:#8884;height:4px;width:100%;margin-top:4px;}.download-progress-foreground{background-color:$customStyleColor;transform-origin:left;transition:all .2s ease-out;transform:scaleX(0);height:100%;width:100%;}.video-error,.video-progress{padding:12px;}.video-progress{min-width:160px;}#video-complete{display:none;}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.html"] = `
设置
    样式
  • 顶栏(对横幅)不透明度起始时间结束时间显示顶部横幅触发宽度工具视频与直播触摸优化启用实验性动画效果启用双击控制其他模糊设置面板背景启用缓存
`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/image-viewer.min.html"] = `
`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.html"] = ``; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/version.txt"] = `1.5.17`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(e,t)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={settings:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",close:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",ok:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"};const o={forceWideMinWidth:e=>e,customStyleColor:t=>{const n=t.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(t.length<7){return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`}else{return t}}else{return e.customStyleColor}},blurBackgroundOpacity:t=>{const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e.blurBackgroundOpacity}};function s(e,t){const n=e.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const e={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(e);return`${e.hour}:${e.minute<10?"0"+e.minute:e.minute}`}else{return t}}o.darkScheduleStart=(t=>s(t,e.darkScheduleStart));o.darkScheduleEnd=(t=>s(t,e.darkScheduleEnd));function c(e,t,n){$(`input[type='checkbox'][key='${e}']`).prop("checked",n);$(`input[type='text'][key='${e}']`).val(n)}function r(){for(const t in e){c(t,undefined,e[t])}}function a(){$(".gui-settings-header .gui-settings-close").on("click",()=>{$(".gui-settings-panel").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const e=o.customStyleColor($("input[key='customStyleColor']").val());$("div.custom-color-preview").css("background",e)});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")});onSettingsChange(c)}function u(){const t=()=>{$("input[type='checkbox'][key]").each((t,n)=>{e[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((t,n)=>{const i=$(n).attr("key");const s=$(n).val();e[i]=o[i](s)});saveSettings(e)};$("input[type='checkbox'][key]").on("change",()=>t());$("input[type='text'][key]").on("change",()=>t())}function l(){$(".gui-settings-close path").attr("d",i.close);$(".gui-settings-ok path").attr("d",i.ok);$(".gui-settings svg path").attr("d",i.settings)}function d(){const e={};$(`input[dependencies]`).each((t,n)=>{const i=$(n).attr("dependencies");if(i){e[$(n).attr("key")]=i}});const t=t=>{const n=t.prop("checked");for(const i in e){const o=e[i].split(" ");if(o.indexOf(t.attr("key"))!==-1){let e=true;if(n&&o.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}$(`input[key='${i}']`).prop("disabled",e);if(e){$(`input[key='${i}'][type='text']`).parent().addClass("disabled")}else{$(`input[key='${i}'][type='text']`).parent().removeClass("disabled")}}}const i=$(".predefined-colors");if(i.hasClass("opened")){i.removeClass("opened")}};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function p(e){if($(".gui-settings").length===0){e.append(`
\n \n \n \n
`);$(".gui-settings").on("click",()=>{$(".gui-settings-panel").addClass("opened")})}t.applyStyle("guiSettingsStyle")}function g(){const e=$(".predefined-colors-grid");for(const t of Object.values(n)){$(`
`).appendTo(e).css("background",t).attr("data-color",t).on("click",e=>{$(`input[key='customStyleColor']`).val($(e.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}p($("body"));const h=t.data.guiSettingsDom.text;if(h){$("body").append(h);a();l();r();d();g();u();if(e.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}else{$(".gui-settings-panel").addClass("animation")}if(typeof offlineData!=="undefined"){$("input[key=useCache]").prop("disabled",true)}}new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(e,t)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={settings:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",close:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",ok:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"};const o={forceWideMinWidth:e=>e,customStyleColor:t=>{const n=t.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(t.length<7){return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`}else{return t}}else{return e.customStyleColor}},blurBackgroundOpacity:t=>{const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e.blurBackgroundOpacity}};function s(e,t){const n=e.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const e={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(e);return`${e.hour}:${e.minute<10?"0"+e.minute:e.minute}`}else{return t}}o.darkScheduleStart=(t=>s(t,e.darkScheduleStart));o.darkScheduleEnd=(t=>s(t,e.darkScheduleEnd));function c(e,t,n){$(`input[type='checkbox'][key='${e}']`).prop("checked",n);$(`input[type='text'][key='${e}']`).val(n)}function r(){for(const t in e){c(t,undefined,e[t])}}function a(){$(".gui-settings-header .gui-settings-close").on("click",()=>{$(".gui-settings-panel").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const e=o.customStyleColor($("input[key='customStyleColor']").val());$("div.custom-color-preview").css("background",e)});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")});onSettingsChange(c)}function u(){const t=()=>{$("input[type='checkbox'][key]").each((t,n)=>{e[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((t,n)=>{const i=$(n).attr("key");const s=$(n).val();e[i]=o[i](s)});saveSettings(e)};$("input[type='checkbox'][key]").on("change",()=>t());$("input[type='text'][key]").on("change",()=>t())}function l(){$(".gui-settings-close path").attr("d",i.close);$(".gui-settings-ok path").attr("d",i.ok);$(".gui-settings svg path").attr("d",i.settings)}function d(){const e={};$(`input[dependencies]`).each((t,n)=>{const i=$(n).attr("dependencies");if(i){e[$(n).attr("key")]=i}});const t=t=>{const n=t.prop("checked");for(const i in e){const o=e[i].split(" ");if(o.indexOf(t.attr("key"))!==-1){let e=true;if(n&&o.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}$(`input[key='${i}']`).prop("disabled",e);if(e){$(`input[key='${i}'][type='text']`).parent().addClass("disabled")}else{$(`input[key='${i}'][type='text']`).parent().removeClass("disabled")}}}$(".download-video-panel,.predefined-colors").removeClass("opened")};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function p(e){if($(".gui-settings").length===0){e.append(`
\n \n \n \n
`);$(".gui-settings").on("click",()=>{$(".gui-settings-panel").addClass("opened")})}t.applyStyle("guiSettingsStyle")}function g(){const e=$(".predefined-colors-grid");for(const t of Object.values(n)){$(`
`).appendTo(e).css("background",t).attr("data-color",t).on("click",e=>{$(`input[key='customStyleColor']`).val($(e.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}p($("body"));const h=t.data.guiSettingsDom.text;if(h){$("body").append(h);a();l();r();d();g();u();if(e.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}else{$(".gui-settings-panel").addClass("animation")}if(typeof offlineData!=="undefined"){$("input[key=useCache]").prop("disabled",true)}}new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/dark-styles.min.js"] = (()=>{return(l,e)=>{if(l.useDarkStyle){e.applyStyle("scrollbarStyle");SpinQuery.any(()=>$(".custom-scrollbar"),l=>l.removeClass("custom-scrollbar"));if($("#banner_link").length===0||$("#banner_link").length>0&&l.overrideNavBar&&!l.showBanner){e.applyImportantStyle("darkStyleNavBar")}e.applyStyle("darkStyle");e.applyImportantStyle("darkStyleImportant")}else{$("#bilibili-scrollbar-style,#bilibili-new-style-dark-nav-bar,#bilibili-new-style-dark,#bilibili-new-style-dark-important").remove()}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/new-styles.min.js"] = (()=>{return(e,t)=>{if(document.URL===`https://h.bilibili.com/`){return}t.applyStyle("scrollbarStyle");SpinQuery.any(()=>$(".custom-scrollbar"),e=>e.removeClass("custom-scrollbar"));const l={selectors:["div.nav-con.fl","#link-navbar-vm",".link-navbar",".nav-header-wrapper",".z_top .z_header"],get allSelectors(){return this.selectors.reduce((e,t)=>e+","+t)},get navbar(){let e=null;for(const t of this.selectors){e=e||document.querySelector(t)}return e},supports(e){if(e instanceof Element){const t=parseInt(window.getComputedStyle(e).height);const l=[60,50,0,56];return l.indexOf(t)!==-1}return false}};SpinQuery.any(()=>$(l.allSelectors),()=>{const e=l.navbar;if(l.supports(e)){t.applyStyle("style","bilibili-style-optimization")}else{t.applyStyle("oldStyle","bilibili-style-optimization")}})}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/override-navbar.min.js"] = (()=>{return(e,n)=>{new SpinQuery(()=>$(".head-content.bili-wrapper>div.search").not(".filter-item"),e=>e.length>0&&$(".nav-con.fr").length>0,e=>{e.detach().insertAfter(".nav-con.fr")}).start();n.applyStyle("navbarOverrideStyle");if(!e.showBanner){n.applyStyle("noBannerStyle")}}})(); @@ -568,7 +568,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/dark-schedule.min.js"] = (()=>{return(e,t)=>{class s{constructor(e){if(arguments.length===0){const e=new Date;this.hour=e.getHours();this.minute=e.getMinutes()}else if(arguments.length===1){[this.hour,this.minute]=e.split(":").slice(0,2).map(e=>this.validatePart(e));this.normalize()}else if(arguments.length===2){[this.hour,this.minute]=arguments}}validatePart(e){const t=parseInt(e);if(!isNaN(t)&&0<=t&&t<=59){return t}else{return null}}normalize(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}lessThan(e){if(this.houre.hour||this.hour===e.hour&&this.minute>e.minute){return true}return false}equals(e){return this.hour===e.hour&&this.minute===e.minute}isInRange(e,t){if(e.equals(t)){return false}let s=this.greaterThan(e)&&this.lessThan(t);if(e.greaterThan(t)){s=this.greaterThan(e)||this.lessThan(t)}const i=s||this.equals(e);return i}static millisecondsBefore(e){const t=new s;const i=(new Date).getSeconds();const r=1e3*(t.hour*3600+t.minute*60+i);const n=1e3*(e.hour*3600+e.minute*60);let h=n-r;if(t.greaterThan(e)||t.equals(e)&&i!==0){h+=24*3600*1e3}return h}}function i(){if(e.darkSchedule){const r=new s(e.darkScheduleStart);const n=new s(e.darkScheduleEnd);const h=new s;const u=h.isInRange(r,n);if(e.useDarkStyle!==u){e.useDarkStyle=u;saveSettings(e);t.fetchByKey("useDarkStyle")}let o=0;if(u){o=s.millisecondsBefore(n)}else{o=s.millisecondsBefore(r)}if(o!==0){setTimeout(()=>i(),o)}}}i();return{export:s}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/force-wide.min.js"] = (()=>{return(e,t)=>{t.applyImportantStyle("forceWideStyle")}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/clear-cache.min.js"] = (()=>{return(e,n)=>{return{settingsWidget:{category:"其他",content:`
  • \n \n 清除缓存\n \n
  • `,success:()=>{$("#clear-cache").on("click",()=>{e.cache={};Toast.show("已删除全部缓存.","清除缓存",5e3)});if(typeof offlineData!=="undefined"){$("button#clear-cache").parent().addClass("hidden")}}}}}})(); -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.js"] = (()=>{return(e,t)=>{const o=(unsafeWindow||window).aid;const s=(unsafeWindow||window).cid;if(o===undefined||s===undefined){return}class n{constructor(e,t,o){this.quality=e;this.internalName=t;this.displayName=o}async downloadInfo(){const e=new i(this);await e.fetchVideoInfo();return e}static get availableFormats(){return new Promise((e,t)=>{const a=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const t=JSON.parse(i.responseText).data;const o=t.accept_quality;const s=t.accept_format.split(",");const a=t.accept_description;const r=[];while(o.length>0){const e=new n(o.pop(),s.pop(),a.pop());r.push(e)}e(r)});i.addEventListener("error",()=>t(`获取清晰度信息失败.`));i.withCredentials=true;i.open("GET",a);i.send()})}}class a{constructor(e,t,o,s){this.length=e;this.size=t;this.url=o;this.backupUrls=s}}class i{constructor(e,t){this.format=e;this.fragments=t||[];this.progress=null;this.loaded=0;this.totalSize=null}fetchVideoInfo(){return new Promise((e,t)=>{const n=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&qn=${this.format.quality}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const o=JSON.parse(i.responseText.replace(/http:/g,"https:")).data;if(o.quality!==this.format.quality){t("获取下载链接失败, 请确认当前账号有下载权限后重试.")}const s=o.durl;this.fragments=s.map(e=>new a(e.length,e.size,e.url,e.backup_url));e(this.fragments)});i.withCredentials=true;i.open("GET",n);i.send()})}downloadUrl(e){return new Promise((t,o)=>{const s=new XMLHttpRequest;s.open("GET",e);s.responseType="arraybuffer";s.withCredentials=false;s.addEventListener("progress",e=>{this.progress&&this.progress((this.loaded+e.loaded)/this.totalSize)});s.addEventListener("load",()=>{if(s.status===200){t(s.response)}else{o(`请求失败.`)}});s.addEventListener("error",()=>{o(`下载失败.`)});s.send()})}copyUrl(){const e=this.fragments.map(e=>e.url).reduce((e,t)=>e+"\r\n"+t);GM_setClipboard(e,"text")}async download(){const e=[];this.loaded=0;this.totalSize=this.fragments.map(e=>e.size).reduce((e,t)=>e+t);for(const t of this.fragments){const o=await this.downloadUrl(t.url);this.loaded+=t.size;e.push(o)}if(e.length<1){throw new Error("下载失败.")}let t=null;let o=null;const s=e=>(e||this.fragments[0]).url.indexOf(".flv")!==-1?".flv":".mp4";if(e.length===1){const[n]=e;t=new Blob([n],{type:s()===".flv"?"video/x-flv":"video/mp4"});o=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","")+s()}else{const n=new JSZip;const a=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","");e.forEach((e,t)=>{n.file(`${a} - ${t+1}${s(this.fragments[t])}`,e)});t=await n.generateAsync({type:"blob"});o=a+".zip"}const n=URL.createObjectURL(t);const a=$("a#video-complete").attr("href");if(a){URL.revokeObjectURL(a)}this.progress&&this.progress(0);return{url:n,filename:o}}}return{settingsWidget:{category:"视频与直播",content:t.data.downloadVideoDom.text,success:()=>{n.availableFormats.then(e=>{let[o]=e;const s=()=>o.downloadInfo().catch(e=>{$(".download-video-panel").addClass("error");$(".video-error").text(e)});async function n(){if(!o){return}$(".download-video-panel").removeClass("action").addClass("progress");const e=await s();e.progress=(e=>{$(".download-progress-value").text(`${fixed(e*100)}`);$(".download-progress-foreground").css("transform",`scaleX(${e})`)});const t=await e.download();const n=document.getElementById("video-complete");n.setAttribute("href",t.url);n.setAttribute("download",t.filename);n.click();$(".download-video-panel").removeClass("opened").removeClass("progress").addClass("quality")}async function a(){if(!o){return}const e=await s();e.copyUrl();$(".download-video-panel").removeClass("opened").removeClass("action").addClass("quality")}$(".video-action>#video-action-download").on("click",n);$(".video-action>#video-action-copy").on("click",a);e.forEach(e=>{$(`
  • ${e.displayName}
  • `).on("click",()=>{o=e;$(".download-video-panel").removeClass("quality").addClass("action")}).prependTo("ol.video-quality")});t.applyStyle("downloadVideoStyle");$("#download-video").on("click",()=>{$(".download-video-panel").toggleClass("opened")}).parent().removeClass("hidden")});$(".video-error").on("click",()=>{$(".video-error").text("");$(".download-video-panel").removeClass("error").removeClass("progress").addClass("quality")})}}}}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.js"] = (()=>{return(e,t)=>{const o=(unsafeWindow||window).aid;const s=(unsafeWindow||window).cid;if(o===undefined||s===undefined){return}class n{constructor(e,t,o){this.quality=e;this.internalName=t;this.displayName=o}async downloadInfo(){const e=new i(this);await e.fetchVideoInfo();return e}static get availableFormats(){return new Promise((e,t)=>{const a=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const t=JSON.parse(i.responseText).data;const o=t.accept_quality;const s=t.accept_format.split(",");const a=t.accept_description;const r=[];while(o.length>0){const e=new n(o.pop(),s.pop(),a.pop());r.push(e)}e(r)});i.addEventListener("error",()=>t(`获取清晰度信息失败.`));i.withCredentials=true;i.open("GET",a);i.send()})}}class a{constructor(e,t,o,s){this.length=e;this.size=t;this.url=o;this.backupUrls=s}}class i{constructor(e,t){this.format=e;this.fragments=t||[];this.progress=null;this.loaded=0;this.totalSize=null}fetchVideoInfo(){return new Promise((e,t)=>{const n=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&qn=${this.format.quality}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const o=JSON.parse(i.responseText.replace(/http:/g,"https:")).data;if(o.quality!==this.format.quality){t("获取下载链接失败, 请确认当前账号有下载权限后重试.")}const s=o.durl;this.fragments=s.map(e=>new a(e.length,e.size,e.url,e.backup_url));e(this.fragments)});i.withCredentials=true;i.open("GET",n);i.send()})}downloadUrl(e){return new Promise((t,o)=>{const s=new XMLHttpRequest;s.open("GET",e);s.responseType="arraybuffer";s.withCredentials=false;s.addEventListener("progress",e=>{this.progress&&this.progress((this.loaded+e.loaded)/this.totalSize)});s.addEventListener("load",()=>{if(s.status===200){t(s.response)}else{o(`请求失败.`)}});s.addEventListener("error",()=>{o(`下载失败.`)});s.send()})}copyUrl(){const e=this.fragments.map(e=>e.url).reduce((e,t)=>e+"\r\n"+t);GM_setClipboard(e,"text")}async download(){const e=[];this.loaded=0;this.totalSize=this.fragments.map(e=>e.size).reduce((e,t)=>e+t);for(const t of this.fragments){const o=await this.downloadUrl(t.url);this.loaded+=t.size;e.push(o)}if(e.length<1){throw new Error("下载失败.")}let t=null;let o=null;const s=e=>(e||this.fragments[0]).url.indexOf(".flv")!==-1?".flv":".mp4";if(e.length===1){const[n]=e;t=new Blob([n],{type:s()===".flv"?"video/x-flv":"video/mp4"});o=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","")+s()}else{const n=new JSZip;const a=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","");e.forEach((e,t)=>{n.file(`${a} - ${t+1}${s(this.fragments[t])}`,e)});t=await n.generateAsync({type:"blob"});o=a+".zip"}const n=URL.createObjectURL(t);const a=$("a#video-complete").attr("href");if(a){URL.revokeObjectURL(a)}this.progress&&this.progress(0);return{url:n,filename:o}}}return{settingsWidget:{category:"视频与直播",content:t.data.downloadVideoDom.text,success:()=>{n.availableFormats.then(e=>{let[o]=e;const s=()=>o.downloadInfo().catch(e=>{$(".download-video-panel").addClass("error");$(".video-error").text(e)});async function n(){if(!o){return}$(".download-video-panel").removeClass("action").addClass("progress");const e=await s();e.progress=(e=>{$(".download-progress-value").text(`${fixed(e*100)}`);$(".download-progress-foreground").css("transform",`scaleX(${e})`)});const t=await e.download();const n=document.getElementById("video-complete");n.setAttribute("href",t.url);n.setAttribute("download",t.filename);n.click();$(".download-video-panel").removeClass("progress").addClass("quality")}async function a(){if(!o){return}const e=await s();e.copyUrl();$(".download-video-panel").removeClass("action").addClass("quality")}$(".video-action>#video-action-download").on("click",n);$(".video-action>#video-action-copy").on("click",a);e.forEach(e=>{$(`
  • ${e.displayName}
  • `).on("click",()=>{o=e;$(".download-video-panel").removeClass("quality").addClass("action")}).prependTo("ol.video-quality")});t.applyStyle("downloadVideoStyle");$("#download-video").on("click",()=>{$(".download-video-panel").toggleClass("opened")}).parent().removeClass("hidden")});$(".video-error").on("click",()=>{$(".video-error").text("");$(".download-video-panel").removeClass("error").removeClass("progress").addClass("quality")})}}}}})(); class ResourceType { diff --git a/bilibili-evolved.preview-offline.user.js b/bilibili-evolved.preview-offline.user.js index 27bd2af4b..b86da2902 100644 --- a/bilibili-evolved.preview-offline.user.js +++ b/bilibili-evolved.preview-offline.user.js @@ -542,12 +542,12 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/toast.min.scss"] = `.toast-card-container{position:fixed;left:16px;bottom:16px;display:flex;flex-direction:column;align-items:start;z-index:100001;}.toast-card{background:#444;min-width:240px;border-radius:8px;box-shadow:0 1px 20px rgba(0,0,0,.1);height:0;transition:all 0.3s cubic-bezier(0.18,0.89,0.32,1.28);transform:translateY(16px);transform-origin:bottom;opacity:0;overflow:hidden;display:flex;flex-direction:column;}.toast-card.visible{height:96px;transform:scale(1) translateY(0);opacity:0.95;margin-top:16px;}.toast-card-header{display:flex;align-items:center;}.toast-card-title{font-size:18px;color:#fff6;margin:16px;font-weight:bold;flex:1 1 auto;}svg.toast-card-dismiss{height:24px;width:24px;flex:0 0 auto;padding:16px;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:all .2s ease-out;transform-origin:center;}svg.toast-card-dismiss:hover{transform:scale(1.2);}svg.toast-card-dismiss:active{transform:scale(1.1);}svg.toast-card-dismiss path{fill:#fff6;}.toast-card-message{color:#eeed;font-size:14px;margin:16px;margin-top:0;}.toast-card.toast-default{background:#444;}.toast-card.toast-error{background:#652020;}.toast-card.toast-info{background:#303d61;}.toast-card.toast-success{background:#274227;}.toast-card span,.toast-card .link{display:inline-block;padding:4px 8px;background-color:rgba(0,0,0,.1);border-radius:4px;text-decoration:none;color:#eeed;transition:all .2s ease-out;}.toast-card .link:hover{background-color:rgba(0,0,0,.2);}.toast-card .link:active{background-color:rgba(0,0,0,.1);}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/blur-video-control.min.css"] = `@supports (backdrop-filter: blur(48px)) or (-webkit-backdrop-filter: blur(48px)){.video-control-blur-layer{width:100%;height:100%;position:absolute;-webkit-backdrop-filter:blur(48px);backdrop-filter:blur(48px);z-index:-1;}.bui-slider .bui-track.bui-track-video-progress .bui-bar-wrap{background-color:transparent!important;}.bilibili-player-area .bilibili-player-video-control-wrap{transition:none!important;}}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/force-wide.min.scss"] = `@media screen and (min-width: $forceWideMinWidth){.bili-wrapper{width:1160px;}.bili-wrapper .l-con{width:900px;}.bili-header-m .bili-wrapper{width:1160px;}.bili-header-m .bili-wrapper .l-con{width:900px;}.gg-floor-module{width:1160px;max-height:96px;}.bangumi-timing-module .headline .bili-tab{width:650px;}.bangumi-timing-module .headline .bili-tab .bili-tab-item{width:70px;}.bangumi-timing-module .card-timing:first-child:nth-child(4),.bangumi-timing-module .card-timing:nth-child(2):nth-child(4),.bangumi-timing-module .card-timing:nth-child(3):nth-child(4),.bangumi-timing-module .card-timing:nth-child(4):nth-child(4){padding-top:0;}.bangumi-timing-module .card-timing{padding:36px 34px 0 0;}.audio-list .song-list .song-li:nth-child(5n) .content .text{margin-right:0;}.audiolist-list .song-list .song-li:nth-child(5n) .content .text{margin-right:0;}.elevator-module{margin-left:590px;}#primary_menu,#primary_menu>ul.nav-menu,.uns_box li.u-i.b-post{display:flex;align-items:center;justify-content:space-between;}.primary-menu{width:100%;}.primary-menu .nav-menu{flex-grow:1;}.primary-menu .nav-gif{position:static;margin-left:2%;}.primary-menu .nav-menu>li{margin-right:0!important;}.primary-menu .nav-menu>li.home{padding-right:1%;}}`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.scss"] = `.download-video-panel.opened{transform:scaleY(1);}.download-video-panel{position:absolute;top:calc(100% + 8px);transition:all .16s ease-out;transform-origin:top;transform:scaleY(0);background:white;border-radius:4px;box-shadow:0px 3px 20px 2px #0004;z-index:100;}.gui-settings-content ol.video-quality li,.video-action>div{cursor:pointer;align-items:center;margin:0;padding:8px 16px;border-radius:4px;transition:all .2s ease-out;}.gui-settings-content ol.video-quality li:hover{background:rgba(0,0,0,0.16);}.video-quality,.video-progress,.video-action,.video-error{display:none;}.download-video-panel.quality:not(.error) .video-quality,.download-video-panel.progress:not(.error) .video-progress,.download-video-panel.action:not(.error) .video-action,.download-video-panel.error .video-error{display:block;}.download-progress-text{display:flex;}.download-progress-title{flex:1 0 0;}.download-progress-background{background-color:#8884;height:4px;width:100%;margin-top:4px;}.download-progress-foreground{background-color:$customStyleColor;transform-origin:left;transition:all .2s ease-out;transform:scaleX(0);height:100%;width:100%;}.video-error,.video-progress{padding:12px;}.video-progress{min-width:160px;}#video-complete{display:none;}`; +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.scss"] = `.download-video-panel.opened{transform:scaleY(1);}.download-video-panel{position:absolute;top:calc(100% + 8px);transition:all .16s ease-out;transform-origin:top;transform:scaleY(0);background:white;border-radius:4px;box-shadow:0px 3px 20px 2px #0004;z-index:100;}.gui-settings-content ol.video-quality li,.video-action>div{cursor:pointer;align-items:center;margin:0;padding:8px 16px;border-radius:4px;transition:all .2s ease-out;}.video-action>div{padding:12px 24px;}.gui-settings-content ol.video-quality li:hover,.video-action>div:hover{background:rgba(0,0,0,0.16);}.video-quality,.video-progress,.video-action,.video-error{display:none;}.download-video-panel.quality:not(.error) .video-quality,.download-video-panel.progress:not(.error) .video-progress,.download-video-panel.action:not(.error) .video-action,.download-video-panel.error .video-error{display:block;}.download-progress-text{display:flex;}.download-progress-title{flex:1 0 0;}.download-progress-background{background-color:#8884;height:4px;width:100%;margin-top:4px;}.download-progress-foreground{background-color:$customStyleColor;transform-origin:left;transition:all .2s ease-out;transform:scaleX(0);height:100%;width:100%;}.video-error,.video-progress{padding:12px;}.video-progress{min-width:160px;}#video-complete{display:none;}`; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.html"] = `
    设置
      样式
    • 顶栏(对横幅)不透明度起始时间结束时间显示顶部横幅触发宽度工具视频与直播触摸优化启用实验性动画效果启用双击控制其他模糊设置面板背景启用缓存
    `; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/image-viewer.min.html"] = `
    `; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.html"] = ``; offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/version.txt"] = `1.5.17`; -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(e,t)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={settings:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",close:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",ok:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"};const o={forceWideMinWidth:e=>e,customStyleColor:t=>{const n=t.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(t.length<7){return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`}else{return t}}else{return e.customStyleColor}},blurBackgroundOpacity:t=>{const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e.blurBackgroundOpacity}};function s(e,t){const n=e.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const e={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(e);return`${e.hour}:${e.minute<10?"0"+e.minute:e.minute}`}else{return t}}o.darkScheduleStart=(t=>s(t,e.darkScheduleStart));o.darkScheduleEnd=(t=>s(t,e.darkScheduleEnd));function c(e,t,n){$(`input[type='checkbox'][key='${e}']`).prop("checked",n);$(`input[type='text'][key='${e}']`).val(n)}function r(){for(const t in e){c(t,undefined,e[t])}}function a(){$(".gui-settings-header .gui-settings-close").on("click",()=>{$(".gui-settings-panel").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const e=o.customStyleColor($("input[key='customStyleColor']").val());$("div.custom-color-preview").css("background",e)});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")});onSettingsChange(c)}function u(){const t=()=>{$("input[type='checkbox'][key]").each((t,n)=>{e[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((t,n)=>{const i=$(n).attr("key");const s=$(n).val();e[i]=o[i](s)});saveSettings(e)};$("input[type='checkbox'][key]").on("change",()=>t());$("input[type='text'][key]").on("change",()=>t())}function l(){$(".gui-settings-close path").attr("d",i.close);$(".gui-settings-ok path").attr("d",i.ok);$(".gui-settings svg path").attr("d",i.settings)}function d(){const e={};$(`input[dependencies]`).each((t,n)=>{const i=$(n).attr("dependencies");if(i){e[$(n).attr("key")]=i}});const t=t=>{const n=t.prop("checked");for(const i in e){const o=e[i].split(" ");if(o.indexOf(t.attr("key"))!==-1){let e=true;if(n&&o.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}$(`input[key='${i}']`).prop("disabled",e);if(e){$(`input[key='${i}'][type='text']`).parent().addClass("disabled")}else{$(`input[key='${i}'][type='text']`).parent().removeClass("disabled")}}}const i=$(".predefined-colors");if(i.hasClass("opened")){i.removeClass("opened")}};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function p(e){if($(".gui-settings").length===0){e.append(`
    \n \n \n \n
    `);$(".gui-settings").on("click",()=>{$(".gui-settings-panel").addClass("opened")})}t.applyStyle("guiSettingsStyle")}function g(){const e=$(".predefined-colors-grid");for(const t of Object.values(n)){$(`
    `).appendTo(e).css("background",t).attr("data-color",t).on("click",e=>{$(`input[key='customStyleColor']`).val($(e.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}p($("body"));const h=t.data.guiSettingsDom.text;if(h){$("body").append(h);a();l();r();d();g();u();if(e.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}else{$(".gui-settings-panel").addClass("animation")}if(typeof offlineData!=="undefined"){$("input[key=useCache]").prop("disabled",true)}}new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/gui-settings.min.js"] = (()=>{return(e,t)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={settings:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",close:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",ok:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"};const o={forceWideMinWidth:e=>e,customStyleColor:t=>{const n=t.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(t.length<7){return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`}else{return t}}else{return e.customStyleColor}},blurBackgroundOpacity:t=>{const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e.blurBackgroundOpacity}};function s(e,t){const n=e.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const e={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(e);return`${e.hour}:${e.minute<10?"0"+e.minute:e.minute}`}else{return t}}o.darkScheduleStart=(t=>s(t,e.darkScheduleStart));o.darkScheduleEnd=(t=>s(t,e.darkScheduleEnd));function c(e,t,n){$(`input[type='checkbox'][key='${e}']`).prop("checked",n);$(`input[type='text'][key='${e}']`).val(n)}function r(){for(const t in e){c(t,undefined,e[t])}}function a(){$(".gui-settings-header .gui-settings-close").on("click",()=>{$(".gui-settings-panel").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const e=o.customStyleColor($("input[key='customStyleColor']").val());$("div.custom-color-preview").css("background",e)});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")});onSettingsChange(c)}function u(){const t=()=>{$("input[type='checkbox'][key]").each((t,n)=>{e[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((t,n)=>{const i=$(n).attr("key");const s=$(n).val();e[i]=o[i](s)});saveSettings(e)};$("input[type='checkbox'][key]").on("change",()=>t());$("input[type='text'][key]").on("change",()=>t())}function l(){$(".gui-settings-close path").attr("d",i.close);$(".gui-settings-ok path").attr("d",i.ok);$(".gui-settings svg path").attr("d",i.settings)}function d(){const e={};$(`input[dependencies]`).each((t,n)=>{const i=$(n).attr("dependencies");if(i){e[$(n).attr("key")]=i}});const t=t=>{const n=t.prop("checked");for(const i in e){const o=e[i].split(" ");if(o.indexOf(t.attr("key"))!==-1){let e=true;if(n&&o.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}$(`input[key='${i}']`).prop("disabled",e);if(e){$(`input[key='${i}'][type='text']`).parent().addClass("disabled")}else{$(`input[key='${i}'][type='text']`).parent().removeClass("disabled")}}}$(".download-video-panel,.predefined-colors").removeClass("opened")};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function p(e){if($(".gui-settings").length===0){e.append(`
    \n \n \n \n
    `);$(".gui-settings").on("click",()=>{$(".gui-settings-panel").addClass("opened")})}t.applyStyle("guiSettingsStyle")}function g(){const e=$(".predefined-colors-grid");for(const t of Object.values(n)){$(`
    `).appendTo(e).css("background",t).attr("data-color",t).on("click",e=>{$(`input[key='customStyleColor']`).val($(e.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}p($("body"));const h=t.data.guiSettingsDom.text;if(h){$("body").append(h);a();l();r();d();g();u();if(e.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}else{$(".gui-settings-panel").addClass("animation")}if(typeof offlineData!=="undefined"){$("input[key=useCache]").prop("disabled",true)}}new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/dark-styles.min.js"] = (()=>{return(l,e)=>{if(l.useDarkStyle){e.applyStyle("scrollbarStyle");SpinQuery.any(()=>$(".custom-scrollbar"),l=>l.removeClass("custom-scrollbar"));if($("#banner_link").length===0||$("#banner_link").length>0&&l.overrideNavBar&&!l.showBanner){e.applyImportantStyle("darkStyleNavBar")}e.applyStyle("darkStyle");e.applyImportantStyle("darkStyleImportant")}else{$("#bilibili-scrollbar-style,#bilibili-new-style-dark-nav-bar,#bilibili-new-style-dark,#bilibili-new-style-dark-important").remove()}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/new-styles.min.js"] = (()=>{return(e,t)=>{if(document.URL===`https://h.bilibili.com/`){return}t.applyStyle("scrollbarStyle");SpinQuery.any(()=>$(".custom-scrollbar"),e=>e.removeClass("custom-scrollbar"));const l={selectors:["div.nav-con.fl","#link-navbar-vm",".link-navbar",".nav-header-wrapper",".z_top .z_header"],get allSelectors(){return this.selectors.reduce((e,t)=>e+","+t)},get navbar(){let e=null;for(const t of this.selectors){e=e||document.querySelector(t)}return e},supports(e){if(e instanceof Element){const t=parseInt(window.getComputedStyle(e).height);const l=[60,50,0,56];return l.indexOf(t)!==-1}return false}};SpinQuery.any(()=>$(l.allSelectors),()=>{const e=l.navbar;if(l.supports(e)){t.applyStyle("style","bilibili-style-optimization")}else{t.applyStyle("oldStyle","bilibili-style-optimization")}})}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/override-navbar.min.js"] = (()=>{return(e,n)=>{new SpinQuery(()=>$(".head-content.bili-wrapper>div.search").not(".filter-item"),e=>e.length>0&&$(".nav-con.fr").length>0,e=>{e.detach().insertAfter(".nav-con.fr")}).start();n.applyStyle("navbarOverrideStyle");if(!e.showBanner){n.applyStyle("noBannerStyle")}}})(); @@ -568,7 +568,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/dark-schedule.min.js"] = (()=>{return(e,t)=>{class s{constructor(e){if(arguments.length===0){const e=new Date;this.hour=e.getHours();this.minute=e.getMinutes()}else if(arguments.length===1){[this.hour,this.minute]=e.split(":").slice(0,2).map(e=>this.validatePart(e));this.normalize()}else if(arguments.length===2){[this.hour,this.minute]=arguments}}validatePart(e){const t=parseInt(e);if(!isNaN(t)&&0<=t&&t<=59){return t}else{return null}}normalize(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}lessThan(e){if(this.houre.hour||this.hour===e.hour&&this.minute>e.minute){return true}return false}equals(e){return this.hour===e.hour&&this.minute===e.minute}isInRange(e,t){if(e.equals(t)){return false}let s=this.greaterThan(e)&&this.lessThan(t);if(e.greaterThan(t)){s=this.greaterThan(e)||this.lessThan(t)}const i=s||this.equals(e);return i}static millisecondsBefore(e){const t=new s;const i=(new Date).getSeconds();const r=1e3*(t.hour*3600+t.minute*60+i);const n=1e3*(e.hour*3600+e.minute*60);let h=n-r;if(t.greaterThan(e)||t.equals(e)&&i!==0){h+=24*3600*1e3}return h}}function i(){if(e.darkSchedule){const r=new s(e.darkScheduleStart);const n=new s(e.darkScheduleEnd);const h=new s;const u=h.isInRange(r,n);if(e.useDarkStyle!==u){e.useDarkStyle=u;saveSettings(e);t.fetchByKey("useDarkStyle")}let o=0;if(u){o=s.millisecondsBefore(n)}else{o=s.millisecondsBefore(r)}if(o!==0){setTimeout(()=>i(),o)}}}i();return{export:s}}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/force-wide.min.js"] = (()=>{return(e,t)=>{t.applyImportantStyle("forceWideStyle")}})(); offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/clear-cache.min.js"] = (()=>{return(e,n)=>{return{settingsWidget:{category:"其他",content:`
  • \n \n 清除缓存\n \n
  • `,success:()=>{$("#clear-cache").on("click",()=>{e.cache={};Toast.show("已删除全部缓存.","清除缓存",5e3)});if(typeof offlineData!=="undefined"){$("button#clear-cache").parent().addClass("hidden")}}}}}})(); -offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.js"] = (()=>{return(e,t)=>{const o=(unsafeWindow||window).aid;const s=(unsafeWindow||window).cid;if(o===undefined||s===undefined){return}class n{constructor(e,t,o){this.quality=e;this.internalName=t;this.displayName=o}async downloadInfo(){const e=new i(this);await e.fetchVideoInfo();return e}static get availableFormats(){return new Promise((e,t)=>{const a=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const t=JSON.parse(i.responseText).data;const o=t.accept_quality;const s=t.accept_format.split(",");const a=t.accept_description;const r=[];while(o.length>0){const e=new n(o.pop(),s.pop(),a.pop());r.push(e)}e(r)});i.addEventListener("error",()=>t(`获取清晰度信息失败.`));i.withCredentials=true;i.open("GET",a);i.send()})}}class a{constructor(e,t,o,s){this.length=e;this.size=t;this.url=o;this.backupUrls=s}}class i{constructor(e,t){this.format=e;this.fragments=t||[];this.progress=null;this.loaded=0;this.totalSize=null}fetchVideoInfo(){return new Promise((e,t)=>{const n=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&qn=${this.format.quality}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const o=JSON.parse(i.responseText.replace(/http:/g,"https:")).data;if(o.quality!==this.format.quality){t("获取下载链接失败, 请确认当前账号有下载权限后重试.")}const s=o.durl;this.fragments=s.map(e=>new a(e.length,e.size,e.url,e.backup_url));e(this.fragments)});i.withCredentials=true;i.open("GET",n);i.send()})}downloadUrl(e){return new Promise((t,o)=>{const s=new XMLHttpRequest;s.open("GET",e);s.responseType="arraybuffer";s.withCredentials=false;s.addEventListener("progress",e=>{this.progress&&this.progress((this.loaded+e.loaded)/this.totalSize)});s.addEventListener("load",()=>{if(s.status===200){t(s.response)}else{o(`请求失败.`)}});s.addEventListener("error",()=>{o(`下载失败.`)});s.send()})}copyUrl(){const e=this.fragments.map(e=>e.url).reduce((e,t)=>e+"\r\n"+t);GM_setClipboard(e,"text")}async download(){const e=[];this.loaded=0;this.totalSize=this.fragments.map(e=>e.size).reduce((e,t)=>e+t);for(const t of this.fragments){const o=await this.downloadUrl(t.url);this.loaded+=t.size;e.push(o)}if(e.length<1){throw new Error("下载失败.")}let t=null;let o=null;const s=e=>(e||this.fragments[0]).url.indexOf(".flv")!==-1?".flv":".mp4";if(e.length===1){const[n]=e;t=new Blob([n],{type:s()===".flv"?"video/x-flv":"video/mp4"});o=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","")+s()}else{const n=new JSZip;const a=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","");e.forEach((e,t)=>{n.file(`${a} - ${t+1}${s(this.fragments[t])}`,e)});t=await n.generateAsync({type:"blob"});o=a+".zip"}const n=URL.createObjectURL(t);const a=$("a#video-complete").attr("href");if(a){URL.revokeObjectURL(a)}this.progress&&this.progress(0);return{url:n,filename:o}}}return{settingsWidget:{category:"视频与直播",content:t.data.downloadVideoDom.text,success:()=>{n.availableFormats.then(e=>{let[o]=e;const s=()=>o.downloadInfo().catch(e=>{$(".download-video-panel").addClass("error");$(".video-error").text(e)});async function n(){if(!o){return}$(".download-video-panel").removeClass("action").addClass("progress");const e=await s();e.progress=(e=>{$(".download-progress-value").text(`${fixed(e*100)}`);$(".download-progress-foreground").css("transform",`scaleX(${e})`)});const t=await e.download();const n=document.getElementById("video-complete");n.setAttribute("href",t.url);n.setAttribute("download",t.filename);n.click();$(".download-video-panel").removeClass("opened").removeClass("progress").addClass("quality")}async function a(){if(!o){return}const e=await s();e.copyUrl();$(".download-video-panel").removeClass("opened").removeClass("action").addClass("quality")}$(".video-action>#video-action-download").on("click",n);$(".video-action>#video-action-copy").on("click",a);e.forEach(e=>{$(`
  • ${e.displayName}
  • `).on("click",()=>{o=e;$(".download-video-panel").removeClass("quality").addClass("action")}).prependTo("ol.video-quality")});t.applyStyle("downloadVideoStyle");$("#download-video").on("click",()=>{$(".download-video-panel").toggleClass("opened")}).parent().removeClass("hidden")});$(".video-error").on("click",()=>{$(".video-error").text("");$(".download-video-panel").removeClass("error").removeClass("progress").addClass("quality")})}}}}})(); +offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/download-video.min.js"] = (()=>{return(e,t)=>{const o=(unsafeWindow||window).aid;const s=(unsafeWindow||window).cid;if(o===undefined||s===undefined){return}class n{constructor(e,t,o){this.quality=e;this.internalName=t;this.displayName=o}async downloadInfo(){const e=new i(this);await e.fetchVideoInfo();return e}static get availableFormats(){return new Promise((e,t)=>{const a=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const t=JSON.parse(i.responseText).data;const o=t.accept_quality;const s=t.accept_format.split(",");const a=t.accept_description;const r=[];while(o.length>0){const e=new n(o.pop(),s.pop(),a.pop());r.push(e)}e(r)});i.addEventListener("error",()=>t(`获取清晰度信息失败.`));i.withCredentials=true;i.open("GET",a);i.send()})}}class a{constructor(e,t,o,s){this.length=e;this.size=t;this.url=o;this.backupUrls=s}}class i{constructor(e,t){this.format=e;this.fragments=t||[];this.progress=null;this.loaded=0;this.totalSize=null}fetchVideoInfo(){return new Promise((e,t)=>{const n=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&qn=${this.format.quality}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const o=JSON.parse(i.responseText.replace(/http:/g,"https:")).data;if(o.quality!==this.format.quality){t("获取下载链接失败, 请确认当前账号有下载权限后重试.")}const s=o.durl;this.fragments=s.map(e=>new a(e.length,e.size,e.url,e.backup_url));e(this.fragments)});i.withCredentials=true;i.open("GET",n);i.send()})}downloadUrl(e){return new Promise((t,o)=>{const s=new XMLHttpRequest;s.open("GET",e);s.responseType="arraybuffer";s.withCredentials=false;s.addEventListener("progress",e=>{this.progress&&this.progress((this.loaded+e.loaded)/this.totalSize)});s.addEventListener("load",()=>{if(s.status===200){t(s.response)}else{o(`请求失败.`)}});s.addEventListener("error",()=>{o(`下载失败.`)});s.send()})}copyUrl(){const e=this.fragments.map(e=>e.url).reduce((e,t)=>e+"\r\n"+t);GM_setClipboard(e,"text")}async download(){const e=[];this.loaded=0;this.totalSize=this.fragments.map(e=>e.size).reduce((e,t)=>e+t);for(const t of this.fragments){const o=await this.downloadUrl(t.url);this.loaded+=t.size;e.push(o)}if(e.length<1){throw new Error("下载失败.")}let t=null;let o=null;const s=e=>(e||this.fragments[0]).url.indexOf(".flv")!==-1?".flv":".mp4";if(e.length===1){const[n]=e;t=new Blob([n],{type:s()===".flv"?"video/x-flv":"video/mp4"});o=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","")+s()}else{const n=new JSZip;const a=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","");e.forEach((e,t)=>{n.file(`${a} - ${t+1}${s(this.fragments[t])}`,e)});t=await n.generateAsync({type:"blob"});o=a+".zip"}const n=URL.createObjectURL(t);const a=$("a#video-complete").attr("href");if(a){URL.revokeObjectURL(a)}this.progress&&this.progress(0);return{url:n,filename:o}}}return{settingsWidget:{category:"视频与直播",content:t.data.downloadVideoDom.text,success:()=>{n.availableFormats.then(e=>{let[o]=e;const s=()=>o.downloadInfo().catch(e=>{$(".download-video-panel").addClass("error");$(".video-error").text(e)});async function n(){if(!o){return}$(".download-video-panel").removeClass("action").addClass("progress");const e=await s();e.progress=(e=>{$(".download-progress-value").text(`${fixed(e*100)}`);$(".download-progress-foreground").css("transform",`scaleX(${e})`)});const t=await e.download();const n=document.getElementById("video-complete");n.setAttribute("href",t.url);n.setAttribute("download",t.filename);n.click();$(".download-video-panel").removeClass("progress").addClass("quality")}async function a(){if(!o){return}const e=await s();e.copyUrl();$(".download-video-panel").removeClass("action").addClass("quality")}$(".video-action>#video-action-download").on("click",n);$(".video-action>#video-action-copy").on("click",a);e.forEach(e=>{$(`
  • ${e.displayName}
  • `).on("click",()=>{o=e;$(".download-video-panel").removeClass("quality").addClass("action")}).prependTo("ol.video-quality")});t.applyStyle("downloadVideoStyle");$("#download-video").on("click",()=>{$(".download-video-panel").toggleClass("opened")}).parent().removeClass("hidden")});$(".video-error").on("click",()=>{$(".video-error").text("");$(".download-video-panel").removeClass("error").removeClass("progress").addClass("quality")})}}}}})(); class ResourceType { diff --git a/min/download-video.min.js b/min/download-video.min.js index 5d6a8a651..4b45b0787 100644 --- a/min/download-video.min.js +++ b/min/download-video.min.js @@ -1 +1 @@ -(()=>{return(e,t)=>{const o=(unsafeWindow||window).aid;const s=(unsafeWindow||window).cid;if(o===undefined||s===undefined){return}class n{constructor(e,t,o){this.quality=e;this.internalName=t;this.displayName=o}async downloadInfo(){const e=new i(this);await e.fetchVideoInfo();return e}static get availableFormats(){return new Promise((e,t)=>{const a=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const t=JSON.parse(i.responseText).data;const o=t.accept_quality;const s=t.accept_format.split(",");const a=t.accept_description;const r=[];while(o.length>0){const e=new n(o.pop(),s.pop(),a.pop());r.push(e)}e(r)});i.addEventListener("error",()=>t(`获取清晰度信息失败.`));i.withCredentials=true;i.open("GET",a);i.send()})}}class a{constructor(e,t,o,s){this.length=e;this.size=t;this.url=o;this.backupUrls=s}}class i{constructor(e,t){this.format=e;this.fragments=t||[];this.progress=null;this.loaded=0;this.totalSize=null}fetchVideoInfo(){return new Promise((e,t)=>{const n=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&qn=${this.format.quality}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const o=JSON.parse(i.responseText.replace(/http:/g,"https:")).data;if(o.quality!==this.format.quality){t("获取下载链接失败, 请确认当前账号有下载权限后重试.")}const s=o.durl;this.fragments=s.map(e=>new a(e.length,e.size,e.url,e.backup_url));e(this.fragments)});i.withCredentials=true;i.open("GET",n);i.send()})}downloadUrl(e){return new Promise((t,o)=>{const s=new XMLHttpRequest;s.open("GET",e);s.responseType="arraybuffer";s.withCredentials=false;s.addEventListener("progress",e=>{this.progress&&this.progress((this.loaded+e.loaded)/this.totalSize)});s.addEventListener("load",()=>{if(s.status===200){t(s.response)}else{o(`请求失败.`)}});s.addEventListener("error",()=>{o(`下载失败.`)});s.send()})}copyUrl(){const e=this.fragments.map(e=>e.url).reduce((e,t)=>e+"\r\n"+t);GM_setClipboard(e,"text")}async download(){const e=[];this.loaded=0;this.totalSize=this.fragments.map(e=>e.size).reduce((e,t)=>e+t);for(const t of this.fragments){const o=await this.downloadUrl(t.url);this.loaded+=t.size;e.push(o)}if(e.length<1){throw new Error("下载失败.")}let t=null;let o=null;const s=e=>(e||this.fragments[0]).url.indexOf(".flv")!==-1?".flv":".mp4";if(e.length===1){const[n]=e;t=new Blob([n],{type:s()===".flv"?"video/x-flv":"video/mp4"});o=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","")+s()}else{const n=new JSZip;const a=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","");e.forEach((e,t)=>{n.file(`${a} - ${t+1}${s(this.fragments[t])}`,e)});t=await n.generateAsync({type:"blob"});o=a+".zip"}const n=URL.createObjectURL(t);const a=$("a#video-complete").attr("href");if(a){URL.revokeObjectURL(a)}this.progress&&this.progress(0);return{url:n,filename:o}}}return{settingsWidget:{category:"视频与直播",content:t.data.downloadVideoDom.text,success:()=>{n.availableFormats.then(e=>{let[o]=e;const s=()=>o.downloadInfo().catch(e=>{$(".download-video-panel").addClass("error");$(".video-error").text(e)});async function n(){if(!o){return}$(".download-video-panel").removeClass("action").addClass("progress");const e=await s();e.progress=(e=>{$(".download-progress-value").text(`${fixed(e*100)}`);$(".download-progress-foreground").css("transform",`scaleX(${e})`)});const t=await e.download();const n=document.getElementById("video-complete");n.setAttribute("href",t.url);n.setAttribute("download",t.filename);n.click();$(".download-video-panel").removeClass("opened").removeClass("progress").addClass("quality")}async function a(){if(!o){return}const e=await s();e.copyUrl();$(".download-video-panel").removeClass("opened").removeClass("action").addClass("quality")}$(".video-action>#video-action-download").on("click",n);$(".video-action>#video-action-copy").on("click",a);e.forEach(e=>{$(`
  • ${e.displayName}
  • `).on("click",()=>{o=e;$(".download-video-panel").removeClass("quality").addClass("action")}).prependTo("ol.video-quality")});t.applyStyle("downloadVideoStyle");$("#download-video").on("click",()=>{$(".download-video-panel").toggleClass("opened")}).parent().removeClass("hidden")});$(".video-error").on("click",()=>{$(".video-error").text("");$(".download-video-panel").removeClass("error").removeClass("progress").addClass("quality")})}}}}})(); \ No newline at end of file +(()=>{return(e,t)=>{const o=(unsafeWindow||window).aid;const s=(unsafeWindow||window).cid;if(o===undefined||s===undefined){return}class n{constructor(e,t,o){this.quality=e;this.internalName=t;this.displayName=o}async downloadInfo(){const e=new i(this);await e.fetchVideoInfo();return e}static get availableFormats(){return new Promise((e,t)=>{const a=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const t=JSON.parse(i.responseText).data;const o=t.accept_quality;const s=t.accept_format.split(",");const a=t.accept_description;const r=[];while(o.length>0){const e=new n(o.pop(),s.pop(),a.pop());r.push(e)}e(r)});i.addEventListener("error",()=>t(`获取清晰度信息失败.`));i.withCredentials=true;i.open("GET",a);i.send()})}}class a{constructor(e,t,o,s){this.length=e;this.size=t;this.url=o;this.backupUrls=s}}class i{constructor(e,t){this.format=e;this.fragments=t||[];this.progress=null;this.loaded=0;this.totalSize=null}fetchVideoInfo(){return new Promise((e,t)=>{const n=`https://api.bilibili.com/x/player/playurl?avid=${o}&cid=${s}&qn=${this.format.quality}&otype=json`;const i=new XMLHttpRequest;i.addEventListener("load",()=>{const o=JSON.parse(i.responseText.replace(/http:/g,"https:")).data;if(o.quality!==this.format.quality){t("获取下载链接失败, 请确认当前账号有下载权限后重试.")}const s=o.durl;this.fragments=s.map(e=>new a(e.length,e.size,e.url,e.backup_url));e(this.fragments)});i.withCredentials=true;i.open("GET",n);i.send()})}downloadUrl(e){return new Promise((t,o)=>{const s=new XMLHttpRequest;s.open("GET",e);s.responseType="arraybuffer";s.withCredentials=false;s.addEventListener("progress",e=>{this.progress&&this.progress((this.loaded+e.loaded)/this.totalSize)});s.addEventListener("load",()=>{if(s.status===200){t(s.response)}else{o(`请求失败.`)}});s.addEventListener("error",()=>{o(`下载失败.`)});s.send()})}copyUrl(){const e=this.fragments.map(e=>e.url).reduce((e,t)=>e+"\r\n"+t);GM_setClipboard(e,"text")}async download(){const e=[];this.loaded=0;this.totalSize=this.fragments.map(e=>e.size).reduce((e,t)=>e+t);for(const t of this.fragments){const o=await this.downloadUrl(t.url);this.loaded+=t.size;e.push(o)}if(e.length<1){throw new Error("下载失败.")}let t=null;let o=null;const s=e=>(e||this.fragments[0]).url.indexOf(".flv")!==-1?".flv":".mp4";if(e.length===1){const[n]=e;t=new Blob([n],{type:s()===".flv"?"video/x-flv":"video/mp4"});o=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","")+s()}else{const n=new JSZip;const a=document.title.replace("_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili","");e.forEach((e,t)=>{n.file(`${a} - ${t+1}${s(this.fragments[t])}`,e)});t=await n.generateAsync({type:"blob"});o=a+".zip"}const n=URL.createObjectURL(t);const a=$("a#video-complete").attr("href");if(a){URL.revokeObjectURL(a)}this.progress&&this.progress(0);return{url:n,filename:o}}}return{settingsWidget:{category:"视频与直播",content:t.data.downloadVideoDom.text,success:()=>{n.availableFormats.then(e=>{let[o]=e;const s=()=>o.downloadInfo().catch(e=>{$(".download-video-panel").addClass("error");$(".video-error").text(e)});async function n(){if(!o){return}$(".download-video-panel").removeClass("action").addClass("progress");const e=await s();e.progress=(e=>{$(".download-progress-value").text(`${fixed(e*100)}`);$(".download-progress-foreground").css("transform",`scaleX(${e})`)});const t=await e.download();const n=document.getElementById("video-complete");n.setAttribute("href",t.url);n.setAttribute("download",t.filename);n.click();$(".download-video-panel").removeClass("progress").addClass("quality")}async function a(){if(!o){return}const e=await s();e.copyUrl();$(".download-video-panel").removeClass("action").addClass("quality")}$(".video-action>#video-action-download").on("click",n);$(".video-action>#video-action-copy").on("click",a);e.forEach(e=>{$(`
  • ${e.displayName}
  • `).on("click",()=>{o=e;$(".download-video-panel").removeClass("quality").addClass("action")}).prependTo("ol.video-quality")});t.applyStyle("downloadVideoStyle");$("#download-video").on("click",()=>{$(".download-video-panel").toggleClass("opened")}).parent().removeClass("hidden")});$(".video-error").on("click",()=>{$(".video-error").text("");$(".download-video-panel").removeClass("error").removeClass("progress").addClass("quality")})}}}}})(); \ No newline at end of file diff --git a/min/download-video.min.scss b/min/download-video.min.scss index 9c173ac51..c4140d5d0 100644 --- a/min/download-video.min.scss +++ b/min/download-video.min.scss @@ -1 +1 @@ -.download-video-panel.opened{transform:scaleY(1);}.download-video-panel{position:absolute;top:calc(100% + 8px);transition:all .16s ease-out;transform-origin:top;transform:scaleY(0);background:white;border-radius:4px;box-shadow:0px 3px 20px 2px #0004;z-index:100;}.gui-settings-content ol.video-quality li,.video-action>div{cursor:pointer;align-items:center;margin:0;padding:8px 16px;border-radius:4px;transition:all .2s ease-out;}.gui-settings-content ol.video-quality li:hover{background:rgba(0,0,0,0.16);}.video-quality,.video-progress,.video-action,.video-error{display:none;}.download-video-panel.quality:not(.error) .video-quality,.download-video-panel.progress:not(.error) .video-progress,.download-video-panel.action:not(.error) .video-action,.download-video-panel.error .video-error{display:block;}.download-progress-text{display:flex;}.download-progress-title{flex:1 0 0;}.download-progress-background{background-color:#8884;height:4px;width:100%;margin-top:4px;}.download-progress-foreground{background-color:$customStyleColor;transform-origin:left;transition:all .2s ease-out;transform:scaleX(0);height:100%;width:100%;}.video-error,.video-progress{padding:12px;}.video-progress{min-width:160px;}#video-complete{display:none;} \ No newline at end of file +.download-video-panel.opened{transform:scaleY(1);}.download-video-panel{position:absolute;top:calc(100% + 8px);transition:all .16s ease-out;transform-origin:top;transform:scaleY(0);background:white;border-radius:4px;box-shadow:0px 3px 20px 2px #0004;z-index:100;}.gui-settings-content ol.video-quality li,.video-action>div{cursor:pointer;align-items:center;margin:0;padding:8px 16px;border-radius:4px;transition:all .2s ease-out;}.video-action>div{padding:12px 24px;}.gui-settings-content ol.video-quality li:hover,.video-action>div:hover{background:rgba(0,0,0,0.16);}.video-quality,.video-progress,.video-action,.video-error{display:none;}.download-video-panel.quality:not(.error) .video-quality,.download-video-panel.progress:not(.error) .video-progress,.download-video-panel.action:not(.error) .video-action,.download-video-panel.error .video-error{display:block;}.download-progress-text{display:flex;}.download-progress-title{flex:1 0 0;}.download-progress-background{background-color:#8884;height:4px;width:100%;margin-top:4px;}.download-progress-foreground{background-color:$customStyleColor;transform-origin:left;transition:all .2s ease-out;transform:scaleX(0);height:100%;width:100%;}.video-error,.video-progress{padding:12px;}.video-progress{min-width:160px;}#video-complete{display:none;} \ No newline at end of file diff --git a/min/gui-settings.min.js b/min/gui-settings.min.js index 8ffd82e79..6777bcd94 100644 --- a/min/gui-settings.min.js +++ b/min/gui-settings.min.js @@ -1 +1 @@ -(()=>{return(e,t)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={settings:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",close:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",ok:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"};const o={forceWideMinWidth:e=>e,customStyleColor:t=>{const n=t.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(t.length<7){return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`}else{return t}}else{return e.customStyleColor}},blurBackgroundOpacity:t=>{const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e.blurBackgroundOpacity}};function s(e,t){const n=e.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const e={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(e);return`${e.hour}:${e.minute<10?"0"+e.minute:e.minute}`}else{return t}}o.darkScheduleStart=(t=>s(t,e.darkScheduleStart));o.darkScheduleEnd=(t=>s(t,e.darkScheduleEnd));function c(e,t,n){$(`input[type='checkbox'][key='${e}']`).prop("checked",n);$(`input[type='text'][key='${e}']`).val(n)}function r(){for(const t in e){c(t,undefined,e[t])}}function a(){$(".gui-settings-header .gui-settings-close").on("click",()=>{$(".gui-settings-panel").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const e=o.customStyleColor($("input[key='customStyleColor']").val());$("div.custom-color-preview").css("background",e)});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")});onSettingsChange(c)}function u(){const t=()=>{$("input[type='checkbox'][key]").each((t,n)=>{e[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((t,n)=>{const i=$(n).attr("key");const s=$(n).val();e[i]=o[i](s)});saveSettings(e)};$("input[type='checkbox'][key]").on("change",()=>t());$("input[type='text'][key]").on("change",()=>t())}function l(){$(".gui-settings-close path").attr("d",i.close);$(".gui-settings-ok path").attr("d",i.ok);$(".gui-settings svg path").attr("d",i.settings)}function d(){const e={};$(`input[dependencies]`).each((t,n)=>{const i=$(n).attr("dependencies");if(i){e[$(n).attr("key")]=i}});const t=t=>{const n=t.prop("checked");for(const i in e){const o=e[i].split(" ");if(o.indexOf(t.attr("key"))!==-1){let e=true;if(n&&o.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}$(`input[key='${i}']`).prop("disabled",e);if(e){$(`input[key='${i}'][type='text']`).parent().addClass("disabled")}else{$(`input[key='${i}'][type='text']`).parent().removeClass("disabled")}}}const i=$(".predefined-colors");if(i.hasClass("opened")){i.removeClass("opened")}};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function p(e){if($(".gui-settings").length===0){e.append(`
    \n \n \n \n
    `);$(".gui-settings").on("click",()=>{$(".gui-settings-panel").addClass("opened")})}t.applyStyle("guiSettingsStyle")}function g(){const e=$(".predefined-colors-grid");for(const t of Object.values(n)){$(`
    `).appendTo(e).css("background",t).attr("data-color",t).on("click",e=>{$(`input[key='customStyleColor']`).val($(e.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}p($("body"));const h=t.data.guiSettingsDom.text;if(h){$("body").append(h);a();l();r();d();g();u();if(e.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}else{$(".gui-settings-panel").addClass("animation")}if(typeof offlineData!=="undefined"){$("input[key=useCache]").prop("disabled",true)}}new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); \ No newline at end of file +(()=>{return(e,t)=>{const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i={settings:"M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",close:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",ok:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"};const o={forceWideMinWidth:e=>e,customStyleColor:t=>{const n=t.match(/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/);if(n){if(t.length<7){return`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`}else{return t}}else{return e.customStyleColor}},blurBackgroundOpacity:t=>{const n=t.match(/^([-\+]?\d+)(\.\d+)?$/);if(n){const e=parseFloat(t);if(e>=0&&e<=1){return t}}return e.blurBackgroundOpacity}};function s(e,t){const n=e.match(/^([\d]{1,2}):([\d]{1,2})$/);if(n&&n.length>=3){const e={hour:parseInt(n[1]),minute:parseInt(n[2])};(function(){while(this.minute<0){this.minute+=60;this.hour-=1}while(this.minute>=60){this.minute-=60;this.hour+=1}while(this.hour<0){this.hour+=24}while(this.hour>=24){this.hour-=24}}).call(e);return`${e.hour}:${e.minute<10?"0"+e.minute:e.minute}`}else{return t}}o.darkScheduleStart=(t=>s(t,e.darkScheduleStart));o.darkScheduleEnd=(t=>s(t,e.darkScheduleEnd));function c(e,t,n){$(`input[type='checkbox'][key='${e}']`).prop("checked",n);$(`input[type='text'][key='${e}']`).val(n)}function r(){for(const t in e){c(t,undefined,e[t])}}function a(){$(".gui-settings-header .gui-settings-close").on("click",()=>{$(".gui-settings-panel").removeClass("opened")});$("input[key='customStyleColor']").on("input",()=>{const e=o.customStyleColor($("input[key='customStyleColor']").val());$("div.custom-color-preview").css("background",e)});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")});onSettingsChange(c)}function u(){const t=()=>{$("input[type='checkbox'][key]").each((t,n)=>{e[$(n).attr("key")]=$(n).prop("checked")});$("input[type='text'][key]").each((t,n)=>{const i=$(n).attr("key");const s=$(n).val();e[i]=o[i](s)});saveSettings(e)};$("input[type='checkbox'][key]").on("change",()=>t());$("input[type='text'][key]").on("change",()=>t())}function l(){$(".gui-settings-close path").attr("d",i.close);$(".gui-settings-ok path").attr("d",i.ok);$(".gui-settings svg path").attr("d",i.settings)}function d(){const e={};$(`input[dependencies]`).each((t,n)=>{const i=$(n).attr("dependencies");if(i){e[$(n).attr("key")]=i}});const t=t=>{const n=t.prop("checked");for(const i in e){const o=e[i].split(" ");if(o.indexOf(t.attr("key"))!==-1){let e=true;if(n&&o.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}$(`input[key='${i}']`).prop("disabled",e);if(e){$(`input[key='${i}'][type='text']`).parent().addClass("disabled")}else{$(`input[key='${i}'][type='text']`).parent().removeClass("disabled")}}}$(".download-video-panel,.predefined-colors").removeClass("opened")};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function p(e){if($(".gui-settings").length===0){e.append(`
    \n \n \n \n
    `);$(".gui-settings").on("click",()=>{$(".gui-settings-panel").addClass("opened")})}t.applyStyle("guiSettingsStyle")}function g(){const e=$(".predefined-colors-grid");for(const t of Object.values(n)){$(`
    `).appendTo(e).css("background",t).attr("data-color",t).on("click",e=>{$(`input[key='customStyleColor']`).val($(e.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}p($("body"));const h=t.data.guiSettingsDom.text;if(h){$("body").append(h);a();l();r();d();g();u();if(e.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}else{$(".gui-settings-panel").addClass("animation")}if(typeof offlineData!=="undefined"){$("input[key=useCache]").prop("disabled",true)}}new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start()}})(); \ No newline at end of file diff --git a/utils/gui-settings/gui-settings.js b/utils/gui-settings/gui-settings.js index 4a40d3058..9bc1142f7 100644 --- a/utils/gui-settings/gui-settings.js +++ b/utils/gui-settings/gui-settings.js @@ -196,11 +196,7 @@ } } } - const box = $(".predefined-colors"); - if (box.hasClass("opened")) - { - box.removeClass("opened"); - } + $(".download-video-panel,.predefined-colors").removeClass("opened"); }; $(`input[type='checkbox'][key]`) .on("change", e => checkBoxChange($(e.target))) diff --git a/video/download-video/download-video.js b/video/download-video/download-video.js index 70afac7dc..061d97dff 100644 --- a/video/download-video/download-video.js +++ b/video/download-video/download-video.js @@ -225,7 +225,6 @@ completeLink.setAttribute("download", result.filename); completeLink.click(); $(".download-video-panel") - .removeClass("opened") .removeClass("progress") .addClass("quality"); } @@ -238,7 +237,6 @@ const info = await getVideoInfo(); info.copyUrl(); $(".download-video-panel") - .removeClass("opened") .removeClass("action") .addClass("quality"); } diff --git a/video/download-video/download-video.scss b/video/download-video/download-video.scss index 724ece824..3c98adaed 100644 --- a/video/download-video/download-video.scss +++ b/video/download-video/download-video.scss @@ -24,7 +24,12 @@ border-radius: 4px; transition: all .2s ease-out; } -.gui-settings-content ol.video-quality li:hover +.video-action>div +{ + padding: 12px 24px; +} +.gui-settings-content ol.video-quality li:hover, +.video-action>div:hover { background: rgba(0,0,0,0.16); }