Fix regex for backup url

This commit is contained in:
pixeltris 2024-06-15 11:05:38 +01:00
parent 644ac7a821
commit b8fb2c3892
2 changed files with 3 additions and 3 deletions

View File

@ -178,7 +178,7 @@ twitch-videoad.js text/javascript
postMessage({key:'UboHideAdBanner'});
}
if (haveAdTags && streamInfo.BackupEncodings != null) {
var streamM3u8Url = streamInfo.BackupEncodings.match(/^https:.*\.m3u8$/m)[0];
var streamM3u8Url = streamInfo.BackupEncodings.match(/^https:.*\.m3u8.*$/m)[0];
var streamM3u8Response = await realFetch(streamM3u8Url);
if (streamM3u8Response.status == 200) {
textStr = await streamM3u8Response.text();

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name TwitchAdSolutions (video-swap-new)
// @namespace https://github.com/pixeltris/TwitchAdSolutions
// @version 1.25
// @version 1.26
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/video-swap-new/video-swap-new.user.js
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/video-swap-new/video-swap-new.user.js
// @description Multiple solutions for blocking Twitch ads (video-swap-new)
@ -190,7 +190,7 @@
postMessage({key:'UboHideAdBanner'});
}
if (haveAdTags && streamInfo.BackupEncodings != null) {
var streamM3u8Url = streamInfo.BackupEncodings.match(/^https:.*\.m3u8$/m)[0];
var streamM3u8Url = streamInfo.BackupEncodings.match(/^https:.*\.m3u8.*$/m)[0];
var streamM3u8Response = await realFetch(streamM3u8Url);
if (streamM3u8Response.status == 200) {
textStr = await streamM3u8Response.text();