Skip to content

Commit

Permalink
Fix player error 1000/3000 on vaft #271
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltris committed Sep 24, 2024
1 parent 8598024 commit 055e1ad
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
24 changes: 14 additions & 10 deletions vaft/vaft-ublock-origin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType4);
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);
}
resolve(new Response(weaverText));
};
var send = function() {
return realFetch(url, options).then(function(response) {
Expand Down
24 changes: 14 additions & 10 deletions vaft/vaft.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (weaverText.includes(AdSignifier)) {
weaverText = await processM3U8(url, responseText, realFetch, PlayerType4);
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);
}
resolve(new Response(weaverText));
};
var send = function() {
return realFetch(url, options).then(function(response) {
Expand Down

0 comments on commit 055e1ad

Please sign in to comment.