您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add buttons for all resolutions when retrieving YouTube thumbnail images
// ==UserScript== // @name YoutTube Thumbnail Image Resolution Selector with Buttons // @namespace http://tampermonkey.net/ // @version 0.1.1 // @description Add buttons for all resolutions when retrieving YouTube thumbnail images // @author satandidnowrong // @match https://i.ytimg.com/* // @grant none // @license Creative Commons Attribution-NonCommercial 4.0 International License // ==/UserScript== (function() { 'use strict'; const parts = window.location.pathname.split('/'); const newX = 'vi'; const newY = parts[2]; const resolutions = [ "maxresdefault.jpg", "sddefault.jpg", "hqdefault.jpg", "mqdefault.jpg", "default.jpg", "hq720.jpg" ]; const buttonsContainer = document.createElement('div'); buttonsContainer.style.position = 'fixed'; buttonsContainer.style.top = '10px'; buttonsContainer.style.left = '10px'; document.body.appendChild(buttonsContainer); resolutions.forEach(resolution => { const button = document.createElement('button'); button.textContent = resolution.split('.')[0].toUpperCase(); button.onclick = () => { const newUrl = `https://i.ytimg.com/${newX}/${newY}/${resolution}`; window.location.href = newUrl; }; buttonsContainer.appendChild(button); }); })();