Add streamvid + voe

This commit is contained in:
2024-03-27 14:40:17 -05:00
parent ca70828efd
commit b505336882
3 changed files with 70 additions and 0 deletions

View File

@@ -23,8 +23,10 @@ import { fileMoonScraper } from './embeds/filemoon';
import { ridooScraper } from './embeds/ridoo';
import { smashyStreamDScraper } from './embeds/smashystream/dued';
import { smashyStreamFScraper } from './embeds/smashystream/video1';
import { streamvidScraper } from './embeds/streamvid';
import { vidCloudScraper } from './embeds/vidcloud';
import { vidplayScraper } from './embeds/vidplay';
import { voeScraper } from './embeds/voe';
import { wootlyScraper } from './embeds/wootly';
import { goojaraScraper } from './sources/goojara';
import { hdRezkaScraper } from './sources/hdrezka';
@@ -76,5 +78,7 @@ export function gatherAllEmbeds(): Array<Embed> {
vidplayScraper,
wootlyScraper,
doodScraper,
streamvidScraper,
voeScraper,
];
}

View File

@@ -0,0 +1,36 @@
import * as unpacker from 'unpacker';
import { flags } from '@/entrypoint/utils/targets';
import { makeEmbed } from '@/providers/base';
const packedRegex = /(eval\(function\(p,a,c,k,e,d\).*\)\)\))/;
const linkRegex = /src:"(https:\/\/[^"]+)"/;
export const streamvidScraper = makeEmbed({
id: 'streamvid',
name: 'Streamvid',
rank: 215,
async scrape(ctx) {
// Example url: https://streamvid.net/fu1jaf96vofx
const streamRes = await ctx.proxiedFetcher<string>(ctx.url);
const packed = streamRes.match(packedRegex);
if (!packed) throw new Error('streamvid packed not found');
const unpacked = unpacker.unpack(packed[1]);
const link = unpacked.match(linkRegex);
if (!link) throw new Error('streamvid link not found');
return {
stream: [
{
type: 'hls',
id: 'primary',
playlist: link[1],
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});

View File

@@ -0,0 +1,30 @@
import { flags } from '@/entrypoint/utils/targets';
import { makeEmbed } from '@/providers/base';
const linkRegex = /'hls': ?'(http.*?)',/;
export const voeScraper = makeEmbed({
id: 'voe',
name: 'voe.sx',
rank: 180,
async scrape(ctx) {
const embed = await ctx.proxiedFetcher<string>(ctx.url);
const playerSrc = embed.match(linkRegex) ?? [];
const streamUrl = playerSrc[1];
if (!streamUrl) throw new Error('Stream url not found in embed code');
return {
stream: [
{
type: 'hls',
id: 'primary',
playlist: streamUrl,
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});