Youtube Music High Quality Video

Sets the video quality to 1440p on Youtube Music

目前為 2025-05-08 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Youtube Music High Quality Video
// @namespace    https://github.com/Alistair1231/my-userscripts/
// @version      0.1.1
// @description  Sets the video quality to 1440p on Youtube Music
// @author       Alistair1231
// @match        https://music.youtube.com/watch*
// @icon         https://icons.duckduckgo.com/ip2/youtube.com.ico
// @license      MIT
// ==/UserScript==
// https://greasyfork.org/en/scripts/535348-youtube-music-high-quality-video
// https://github.com/Alistair1231/my-userscripts/blob/master/youtube-music-high-quality-video.user.js

(function () {
  "use strict";
  /**
   *
   * @param {string} quality - The quality to set the video to. Can be one of the following:
   * auto / highres / hd2880 / hd2160 / hd1440 / hd1080 / hd720 / large / medium / small / tiny
   * If a quality is unavailable, it will be set to the next best quality.
   * @returns
   */
  const setQuality = (quality) =>
    document.getElementById("movie_player").setPlaybackQualityRange(quality);

  const checkElement = () => {
    const element = document.getElementById("movie_player");
    if (!element) setTimeout(checkElement, 500);
    else {
      setQuality("hd1440");
    }
  };

  checkElement();
})();