1
0
mirror of https://github.com/pixeltris/TwitchAdSolutions.git synced 2024-11-22 02:12:45 +01:00

Fix player error 1000/3000 on vaft #271

This commit is contained in:
pixeltris 2024-09-24 14:14:20 +01:00
parent 8598024100
commit 055e1ad981
2 changed files with 28 additions and 20 deletions

View File

@ -217,17 +217,21 @@ twitch-videoad.js text/javascript
if (url.endsWith('m3u8')) {
return new Promise(function(resolve, reject) {
var processAfter = async function(response) {
//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);
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
if (response.status === 200) {
//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);
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
}
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType4);
}
resolve(new Response(weaverText));
} else {
resolve(response);
}
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType4);
}
resolve(new Response(weaverText));
};
var send = function() {
return realFetch(url, options).then(function(response) {

View File

@ -229,17 +229,21 @@
if (url.endsWith('m3u8')) {
return new Promise(function(resolve, reject) {
var processAfter = async function(response) {
//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);
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
if (response.status === 200) {
//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);
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType3);
}
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType4);
}
resolve(new Response(weaverText));
} else {
resolve(response);
}
if (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType4);
}
resolve(new Response(weaverText));
};
var send = function() {
return realFetch(url, options).then(function(response) {