mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
924 B
JavaScript
1 line
924 B
JavaScript
(()=>{return(e,a)=>{(async()=>{const a=[{name:"1080P60",value:116},{name:"1080P+",value:112},{name:"1080P",value:80},{name:"720P",value:64},{name:"480P",value:32},{name:"360P",value:15},{name:"自动",value:0}];const t=await SpinQuery.any(()=>$(".gui-settings-dropdown:has(input[key=defaultVideoQuality])"));const i=t.find("ul");const n=t.find("input");a.forEach(e=>{$(`<li>${e.name}</li>`).appendTo(i).on("click",()=>{n.val(e.name).trigger("input").change()})});const l=await SpinQuery.condition(()=>$(".bilibili-player-video-quality-menu .bui-select-list>li.bui-select-item"),e=>e.length>0&&$("li.profile-info").length>0);const[u]=l.toArray().map(e=>e.getAttribute("data-value")).sort().reverse();const[o]=a.filter(a=>a.name===e.defaultVideoQuality).map(e=>e.value);const[r]=a.map(e=>e.value).filter(e=>e<=Math.min(o,u)).sort().reverse();l.each((e,a)=>{if(parseInt(a.getAttribute("data-value"))===r){a.click()}})})()}})(); |