improve regex

This commit is contained in:
Jorrin
2024-01-19 20:13:44 +01:00
parent f3e4786b72
commit b13578cefa

View File

@@ -15,11 +15,7 @@ export const vidsrcembedScraper = makeEmbed({
}, },
}); });
const match = html const match = html.match(hlsURLRegex)?.[1]?.replace(/(\/\/\S+?=)|#2|=/g, '');
.match(hlsURLRegex)?.[1]
?.replace(/(\/\/\S+?=)/g, '')
.replace('#2', '')
.replace(/=/g, '');
if (!match) throw new Error('Unable to find HLS playlist'); if (!match) throw new Error('Unable to find HLS playlist');
const finalUrl = atob(match); const finalUrl = atob(match);