Fix vaft ad leakage ("Preparing your stream..." screen will be displayed)

This commit is contained in:
pixeltris
2025-10-08 22:23:25 +01:00
parent 2796f5979e
commit 53c18325bc
2 changed files with 12 additions and 5 deletions
+6 -2
View File
@@ -1,7 +1,8 @@
twitch-videoad.js text/javascript
(function() {
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
var ourTwitchAdSolutionsVersion = 9;// Used to prevent conflicts with outdated versions of the scripts
'use strict';
var ourTwitchAdSolutionsVersion = 10;// Used to prevent conflicts with outdated versions of the scripts
if (typeof unsafeWindow === 'undefined') {
unsafeWindow = window;
}
@@ -327,13 +328,16 @@ twitch-videoad.js text/javascript
//Here we check the m3u8 for any ads and also try fallback player types if needed.
var responseText = await response.text();
var weaverText = null;
weaverText = await processM3U8(url, responseText, realFetch, PlayerType2);
var fallbackWeaverText = weaverText = await processM3U8(url, responseText, realFetch, PlayerType2);
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
}
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType4);
}
if (weaverText.includes(AdSignifier)) {
weaverText = fallbackWeaverText;
}
resolve(new Response(weaverText));
} else {
resolve(response);