你正在訪問的內容是外部程式的映像位址,僅用於使用者加速訪問,本站無法保證其可靠性。當前的連結位址(單點即可複製)為 https://greasyfork.org.cn/zh-CN/scripts/483406-youtube-quality-auto-max/discussions/237025,源站連結 點此以跳轉。
To make Quality Auto Max
< 脚本 YouTube: Quality Auto Max 的反馈
yh
yh
Did it and nothing changes
Fixed.
This is because YouTube now uses multiple tracks for the same video.
Currently this is not working for embedded videos. As I don't really watch YouTube in embedded mode.
(no ytd-player#ytd-player in embedded mode; the logs are for the youtube APIs which are functional ready. You should get the same log in normal YouTube)
In future might add the support for embedded videos.
(I think just switch from ytd-player#ytd-player to #movie_player should be fine. but no time to amend and test)
Just need to change the following part:
const target = (evt || 0).target
if (!(target instanceof HTMLMediaElement)) return;
pm2.resolve();
const pm1 = pm2 = new PromiseExternal();
const mainMedia = await observablePromise(() => {
return document.querySelector('ytd-player#ytd-player #movie_player .html5-main-video')
}, pm2.then()).obtain();
if (!mainMedia) return;
if (pm1 !== pm2) return;
const ytdPlayerElm = mainMedia.closest('ytd-player#ytd-player');
if (!ytdPlayerElm) return;
let _url = lastURL;
let url = mainMedia.src;
if (url === _url) return;
lastURL = url;
let player_
for (let i = 10; --i;) {
player_ = await ((insp(ytdPlayerElm) || 0).player_ || 0);
if (player_) break;
await new Promise(r => setTimeout(r));
}
Guess just need to change these. Test by yourself.
document.querySelector('#movie_player .html5-main-video'), mainMedia.closest('#movie_player')
let player_
for (let i = 10; --i;) {
let tmpCnt = insp(ytdPlayerElm);
player_ = await (tmpCnt._player || (tmpCnt.setPlaybackQualityRange ? tmpCnt : 0));
if (player_) break;
await new Promise(r => setTimeout(r));
}
typo.
let player_
for (let i = 10; --i;) {
let tmpCnt = insp(ytdPlayerElm);
player_ = await (tmpCnt.player_ || (tmpCnt.setPlaybackQualityRange ? tmpCnt : 0));
if (player_) break;
await new Promise(r => setTimeout(r));
}
that didn't work
Now it just keeps printing
userscript.html?name…24-bbff8d5097d3:349
Uncaught ReferenceError: Cannot access 'mainMedia' before initialization
at userscript.html?name…bbff8d5097d3:349:89
at MutationObserver.f (userscript.html?name…-bbff8d5097d3:53:23)
(anonymous) @ userscript.html?name…24-bbff8d5097d3:349
f @ userscript.html?name…824-bbff8d5097d3:53
Updated
We both have the same issues in the same websites
https://greasyfork.org.cn/en/discussions/development/237007-is-it-possible-to-change-embedded-yt-video-quality