|
2 | 2 | // @name YouTube: Audio Only
|
3 | 3 | // @description No Video Streaming
|
4 | 4 | // @namespace UserScript
|
5 |
| -// @version 1.6.6 |
| 5 | +// @version 1.6.7 |
6 | 6 | // @author CY Fung
|
7 | 7 | // @match https://www.youtube.com/*
|
8 | 8 | // @match https://www.youtube.com/embed/*
|
|
300 | 300 | let configs = config_.WEB_PLAYER_CONTEXT_CONFIGS || {};
|
301 | 301 | for (const [key, entry] of Object.entries(configs)) {
|
302 | 302 |
|
303 |
| - if (entry && typeof entry.serializedExperimentFlags === 'string') { |
| 303 | + if (entry && typeof entry.serializedExperimentFlags === 'string' && entry.serializedExperimentFlags.length > 16) { |
304 | 304 | // prevent idle playback failure
|
305 | 305 | entry.serializedExperimentFlags = entry.serializedExperimentFlags.replace(/\b(html5_check_for_idle_network_interval_ms|html5_trigger_loader_when_idle_network|html5_sabr_fetch_on_idle_network_preloaded_players|html5_autonav_cap_idle_secs|html5_autonav_quality_cap|html5_disable_client_autonav_cap_for_onesie|html5_idle_rate_limit_ms|html5_sabr_fetch_on_idle_network_preloaded_players|html5_webpo_idle_priority_job|html5_server_playback_start_policy|html5_check_video_data_errors_before_playback_start|html5_check_unstarted|html5_check_queue_on_data_loaded)=([-_\w]+)(\&|$)/g, (_, a, b, c) => {
|
306 | 306 | return a + '00' + '=' + b + c;
|
|
1050 | 1050 | const cProto = cnt.constructor.prototype;
|
1051 | 1051 | cProto.createMainAppPlayer932_ = cProto.createMainAppPlayer_;
|
1052 | 1052 | cProto.initPlayer932_ = cProto.initPlayer_;
|
| 1053 | + const configFixBeforeCreate = () => { |
| 1054 | + try { |
| 1055 | + const config_ = typeof yt !== 'undefined' ? (yt || 0).config_ : 0; |
| 1056 | + if (config_) { |
| 1057 | + ytConfigFix(config_); |
| 1058 | + } |
| 1059 | + } catch (e) { } |
| 1060 | + } |
1053 | 1061 | cProto.createMainAppPlayer_ = function (a, b, c) {
|
| 1062 | + configFixBeforeCreate(); |
1054 | 1063 | let r = this.createMainAppPlayer932_(a, b, c);
|
1055 | 1064 | try {
|
1056 | 1065 | this.mainAppPlayer_.api.then(function (e) {
|
|
1061 | 1070 | }
|
1062 | 1071 | }
|
1063 | 1072 | cProto.initPlayer_ = function (a) {
|
| 1073 | + configFixBeforeCreate(); |
1064 | 1074 | let r = this.initPlayer932_(a);
|
1065 | 1075 | try {
|
1066 | 1076 | r.then(() => {
|
|
0 commit comments