Greasy Fork is available in English.
根据配置的清晰度顺序,自动选择并设置B站播放器清晰度
In the PC web player, automatically set clarity according to the preset order after loading is complete. The entire script is generated by codex + Kimi K2.5.
setBiliQuality.js → Save (Ctrl+S).RESOLUTION_ORDER at the top of the script.window.__playinfo__.data.accept_quality.requestQuality(q, audioQuality), while the old player may have setQuality / setPlaybackQuality.
The script prioritizes using requestQuality, and automatically tries old interfaces if it fails.RESOLUTION_ORDER: Array of clarity codes (from high to low). Example: [80, 64] means first choice is 1080P, if unavailable then 720P.120 = Ultra-clear 4K116 = HD 1080P6080 = HD 1080P64 = HD 720P32 = Clear 480P16 = Smooth 360POpen any video page and run in the Console:
const info = window.__playinfo__;
if (info?.data) {
console.log('Supported clarity codes:', info.data.accept_quality);
console.log('Clarity descriptions:', info.data.accept_description);
}
const player = window.player;
if (player) {
const supported = player.getSupportedQualityList?.() ?? [];
console.log('Player supports:', supported);
}
If player is not defined, wait a moment and try again, or check for "[BiliAutoQuality] Waiting for player to mount..." logs.
(async () => {
const q = 64; // 720P
await window.player?.requestQuality(q, null);
console.log('Attempted to switch to', q);
})();
Compatible with the new Bilibili PC player (site-wide). If the player is significantly redesigned later, it may need to sync updates to the method name or mounting point.