mirror of
https://github.com/p-stream/providers.git
synced 2026-03-11 17:55:36 +00:00
return thumbnailTracks and add ip-locked flag to mixdrop
This commit is contained in:
parent
c91974a584
commit
03874e8e24
3 changed files with 24 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ export const doodScraper = makeEmbed({
|
|||
|
||||
const dataForLater = doodData.match(/\?token=([^&]+)&expiry=/)?.[1];
|
||||
const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1];
|
||||
const thumbnailTrack = doodData.match(/thumbnails:\s\{\s*vtt:\s'([^']*)'/);
|
||||
|
||||
const doodPage = await ctx.proxiedFetcher<string>(`/pass_md5${path}`, {
|
||||
headers: {
|
||||
|
|
@ -53,6 +54,14 @@ export const doodScraper = makeEmbed({
|
|||
headers: {
|
||||
Referer: baseUrl,
|
||||
},
|
||||
...(thumbnailTrack
|
||||
? {
|
||||
thumbnailTrack: {
|
||||
type: 'vtt',
|
||||
url: `https:${thumbnailTrack[1]}`,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import * as unpacker from 'unpacker';
|
||||
|
||||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
const mixdropBase = 'https://mixdrop.ag';
|
||||
|
|
@ -47,7 +48,7 @@ export const mixdropScraper = makeEmbed({
|
|||
{
|
||||
id: 'primary',
|
||||
type: 'file',
|
||||
flags: [],
|
||||
flags: [flags.IP_LOCKED],
|
||||
captions: [],
|
||||
qualities: {
|
||||
unknown: {
|
||||
|
|
|
|||
|
|
@ -2,15 +2,18 @@ import { flags } from '@/entrypoint/utils/targets';
|
|||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
const linkRegex = /'hls': ?'(http.*?)',/;
|
||||
const tracksRegex = /previewThumbnails:\s{.*src:\["([^"]+)"]/;
|
||||
|
||||
export const voeScraper = makeEmbed({
|
||||
id: 'voe',
|
||||
name: 'voe.sx',
|
||||
rank: 180,
|
||||
async scrape(ctx) {
|
||||
const embed = await ctx.proxiedFetcher<string>(ctx.url);
|
||||
const embedRes = await ctx.proxiedFetcher.full<string>(ctx.url);
|
||||
const embed = embedRes.body;
|
||||
|
||||
const playerSrc = embed.match(linkRegex) ?? [];
|
||||
const thumbnailTrack = embed.match(tracksRegex);
|
||||
|
||||
const streamUrl = playerSrc[1];
|
||||
if (!streamUrl) throw new Error('Stream url not found in embed code');
|
||||
|
|
@ -21,11 +24,19 @@ export const voeScraper = makeEmbed({
|
|||
type: 'hls',
|
||||
id: 'primary',
|
||||
playlist: streamUrl,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
flags: [flags.CORS_ALLOWED, flags.IP_LOCKED],
|
||||
captions: [],
|
||||
headers: {
|
||||
Referer: 'https://voe.sx',
|
||||
},
|
||||
...(thumbnailTrack
|
||||
? {
|
||||
thumbnailTrack: {
|
||||
type: 'vtt',
|
||||
url: new URL(embedRes.finalUrl).origin + thumbnailTrack[1],
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue