Bilibili Auto Quality (Ordered)

根据配置的清晰度顺序,自动选择并设置B站播放器清晰度

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

Yazar
Jingwei Zhang
Günlük kurulumlar
0
Toplam kurulumlar
16
Değerlendirmeler
0 0 0
Versiyon
1.0
Oluşturulma
08.02.2026
Güncellenme
08.02.2026
Boyut
4,15 KB
Lisans
MIT
Geçerli

Bilibili Auto Quality (Ordered)

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.

Usage

  1. In Tampermonkey, create a new script → paste all of setBiliQuality.js → Save (Ctrl+S).
  2. Open any Bilibili video page, and the script will automatically try to set clarity in this order:
    • 4K (120) → 1080P60 (116) → 1080P (80) → 720P (64) → 480P (32) → 360P (16)
    • The first clarity in the video's available list will be selected.
  3. To change the order or only select specific clarity, edit RESOLUTION_ORDER at the top of the script.

Principle

  • Read the clarity list from the page's initial data: window.__playinfo__.data.accept_quality.
  • Call the internal player method to switch clarity. The new player usually has requestQuality(q, audioQuality), while the old player may have setQuality / setPlaybackQuality. The script prioritizes using requestQuality, and automatically tries old interfaces if it fails.
  • If the player is not yet mounted, the script will retry at 500ms intervals within 20 seconds until it succeeds or times out.

Configuration Instructions

  • RESOLUTION_ORDER: Array of clarity codes (from high to low). Example: [80, 64] means first choice is 1080P, if unavailable then 720P.
  • Clarity code correspondence (common):
    • 120 = Ultra-clear 4K
    • 116 = HD 1080P60
    • 80 = HD 1080P
    • 64 = HD 720P
    • 32 = Clear 480P
    • 16 = Smooth 360P

Quick Verification

Open 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.

Manual Example (Console)

(async () => {
  const q = 64; // 720P
  await window.player?.requestQuality(q, null);
  console.log('Attempted to switch to', q);
})();

Compatibility

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.