mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
1 line
670 B
JavaScript
1 line
670 B
JavaScript
(()=>{return(e,a)=>{const t=[{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}];(async()=>{const a=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[l]=a.toArray().map(e=>parseInt(e.getAttribute("data-value"))).sort(e=>e);const[i]=t.filter(a=>a.name===e.defaultVideoQuality).map(e=>e.value);const[n]=t.map(e=>e.value).filter(e=>e<=Math.min(i,l)).sort(e=>e);a.each((e,a)=>{if(parseInt(a.getAttribute("data-value"))===n){a.click()}})})()}})(); |