Youtube HD

Select a youtube resolution and resize the player.

< 脚本Youtube HD的反馈

提问/评论

§
发表于:2024-09-01

ytPlayer.getPlaybackQuality would be "unknown" if you get it too early, in this case targetRes would be set even if it is actually unavailable.

§
发表于:2024-09-03

If you are just looking to set quality just use my script https://greasyfork.org/en/scripts/498145-youtube-hd-premium/code. Everything should be fixed there. getPlaybackQuality loads way too late almost all of the time so that has been changed to something else. adisib's script is much too outdated and too many things are broken.

adisib作者
§
发表于:2025-04-12

I didn't experience any issues with resolution changes myself, but I added a check for unknown anyway in an update today. Things work as expected for me at the moment, but it is certainly possible there are other issues going on. If you can report specific issues and how you reproduced them I can try to take a look as time permits, but I don't have the time at the moment to dig around and modernize everything.

§
发表于:2025-04-13

From messing around with a bunch of YouTube API, I would guess the issue stems from an availability mismatch between getPlaybackQuality and the data it tries to fetch. Since neither the video player nor the webpage unloads when navigating between videos on YouTube (soft navigation is always used), getPlaybackQuality will always be available and (ytPlayer.getPlaybackQuality === undefined) will never be true, but the data that getPlaybackQuality fetches relies on haing video data already loaded into the player. This essentially causes a race condition where you need your browser to call getPlaybackQuality slower than YouTube can load a new video into the video player.

发表回复

登录以发表回复。