Hls player works now; fixed vupload.com regex

This commit is contained in:
bytedream 2022-01-06 17:32:30 +01:00
parent 2db8381df7
commit e5552910b2
4 changed files with 12 additions and 6 deletions

View File

@ -98,7 +98,8 @@ class Vivo implements Match {
class Vupload implements Match {
async match(match: RegExpMatchArray): Promise<string> {
return `https://www3.megaupload.to/${match[0]}/v.mp4`
// the best quality is the last match so the array is reversed here to have the last element at the first position
return match.reverse()[0]
}
}
@ -127,5 +128,5 @@ const matches = [
['vivo.st', new RegExp(/(?<=source:\s')(\S+)(?=')/gm), new Vivo(), Reliability.HIGH],
['vivo.sx', new RegExp(/(?<=source:\s')(\S+)(?=')/gm), new Vivo(), Reliability.HIGH],
['voe.sx', new RegExp(/https?:\/\/\S*m3u8(?=")/gm), null, Reliability.HIGH],
['vupload.com', new RegExp(/(?<=class\|)\w*/gm), new Vupload(), Reliability.NORMAL]
['vupload.com', new RegExp(/(?<=src:\s?")\S+mp4/gm), new Vupload(), Reliability.NORMAL]
]

View File

@ -8,6 +8,6 @@
<body>
<video id="video"></video>
<p id="message" hidden></p>
<script src="/res/hls.light.min.js"></script>
<script src="/res/hls.js"></script>
</body>
</html>

View File

@ -1,3 +1,6 @@
body
background-color: #131313
html, body, video
width: 100%
height: 100%

View File

@ -35,7 +35,7 @@ function loadHls() {
break
case 3: // high
message = `The reliability for this domains is high, errors like this are very unlikely to happen.
Try to refresh the page and if the error still exists you might want to open a new issue <a href="https://github.com/ByteDream/stream-bypass/issues">here</a>.
Try to refresh the page and if the error still exists you might want to open a new issue <a href="https://github.com/ByteDream/stream-bypass/issues/new">here</a>.
When your using <a href="https://www.torproject.org/">Tor</a> such errors have a slight chance to occur more often,
so if this is the case just try to reload the page and see if you it's working then`
break
@ -45,6 +45,8 @@ function loadHls() {
showMessage(`Could not load hls video. ${message}`)
}, rawReliability * 3000)
document.title = searchParams.get('domain')
// @ts-ignore
hls.on(Hls.Events.MANIFEST_PARSED, () => {
clearTimeout(thirdPartyFallback)
@ -53,7 +55,7 @@ function loadHls() {
})
} else {
// shows a message if hls is not supported
showMessage(`Failed to play m3u8 video (hls is not supported). Try again or create a new issue <a href="https://github.com/ByteDream/stream-bypass/issues">here</a>`)
showMessage(`Failed to play m3u8 video (hls is not supported). Try again or create a new issue <a href="https://github.com/ByteDream/stream-bypass/issues/new">here</a>`)
}
}