mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-05-11 13:15:13 +02:00
Use more reliable streamtape match function
This commit is contained in:
parent
6e7410b088
commit
1fb85313dd
@ -156,11 +156,19 @@ export const Newgrounds: Match = {
|
|||||||
export const Streamtape: Match = {
|
export const Streamtape: Match = {
|
||||||
name: 'Streamtape',
|
name: 'Streamtape',
|
||||||
id: 'streamtape',
|
id: 'streamtape',
|
||||||
reliability: Reliability.NORMAL,
|
reliability: Reliability.HIGH,
|
||||||
domains: ['streamtape.com', 'streamtape.net', 'shavetape.cash'],
|
domains: ['streamtape.com', 'streamtape.net', 'shavetape.cash'],
|
||||||
regex: /id=.*(?=')/gm,
|
regex: /id=.*(?=')/gm,
|
||||||
|
|
||||||
match: async (match: RegExpMatchArray) => {
|
match: async (match: RegExpMatchArray) => {
|
||||||
|
let i = 0;
|
||||||
|
while (i < match.length) {
|
||||||
|
if (match[++i - 1] == match[i]) {
|
||||||
|
return `https://streamtape.com/get_video?${match[i]}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// use the old method as fallback
|
||||||
return `https://streamtape.com/get_video?${match.reverse()[0]}`;
|
return `https://streamtape.com/get_video?${match.reverse()[0]}`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user