Merge pull request #73 from movie-web/vidcloud
Add vidcloud to flixhq and zoechip
This commit is contained in:
commit
28b15e5a36
|
@ -23,6 +23,7 @@ import { fileMoonScraper } from './embeds/filemoon';
|
||||||
import { ridooScraper } from './embeds/ridoo';
|
import { ridooScraper } from './embeds/ridoo';
|
||||||
import { smashyStreamDScraper } from './embeds/smashystream/dued';
|
import { smashyStreamDScraper } from './embeds/smashystream/dued';
|
||||||
import { smashyStreamFScraper } from './embeds/smashystream/video1';
|
import { smashyStreamFScraper } from './embeds/smashystream/video1';
|
||||||
|
import { vidCloudScraper } from './embeds/vidcloud';
|
||||||
import { vidplayScraper } from './embeds/vidplay';
|
import { vidplayScraper } from './embeds/vidplay';
|
||||||
import { wootlyScraper } from './embeds/wootly';
|
import { wootlyScraper } from './embeds/wootly';
|
||||||
import { goojaraScraper } from './sources/goojara';
|
import { goojaraScraper } from './sources/goojara';
|
||||||
|
@ -54,6 +55,7 @@ export function gatherAllEmbeds(): Array<Embed> {
|
||||||
// all embeds are gathered here
|
// all embeds are gathered here
|
||||||
return [
|
return [
|
||||||
upcloudScraper,
|
upcloudScraper,
|
||||||
|
vidCloudScraper,
|
||||||
mp4uploadScraper,
|
mp4uploadScraper,
|
||||||
streamsbScraper,
|
streamsbScraper,
|
||||||
upstreamScraper,
|
upstreamScraper,
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { makeEmbed } from '@/providers/base';
|
||||||
|
|
||||||
|
import { upcloudScraper } from './upcloud';
|
||||||
|
|
||||||
|
export const vidCloudScraper = makeEmbed({
|
||||||
|
id: 'vidcloud',
|
||||||
|
name: 'VidCloud',
|
||||||
|
rank: 201,
|
||||||
|
async scrape(ctx) {
|
||||||
|
// Both vidcloud and upcloud have the same embed domain (rabbitstream.net)
|
||||||
|
const result = await upcloudScraper.scrape(ctx);
|
||||||
|
return {
|
||||||
|
stream: result.stream.map((s) => ({
|
||||||
|
...s,
|
||||||
|
flags: [],
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,6 +1,7 @@
|
||||||
import { flags } from '@/entrypoint/utils/targets';
|
import { flags } from '@/entrypoint/utils/targets';
|
||||||
import { makeSourcerer } from '@/providers/base';
|
import { SourcererEmbed, makeSourcerer } from '@/providers/base';
|
||||||
import { upcloudScraper } from '@/providers/embeds/upcloud';
|
import { upcloudScraper } from '@/providers/embeds/upcloud';
|
||||||
|
import { vidCloudScraper } from '@/providers/embeds/vidcloud';
|
||||||
import { getFlixhqMovieSources, getFlixhqShowSources, getFlixhqSourceDetails } from '@/providers/sources/flixhq/scrape';
|
import { getFlixhqMovieSources, getFlixhqShowSources, getFlixhqSourceDetails } from '@/providers/sources/flixhq/scrape';
|
||||||
import { getFlixhqId } from '@/providers/sources/flixhq/search';
|
import { getFlixhqId } from '@/providers/sources/flixhq/search';
|
||||||
import { NotFoundError } from '@/utils/errors';
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
@ -15,16 +16,25 @@ export const flixhqScraper = makeSourcerer({
|
||||||
if (!id) throw new NotFoundError('no search results match');
|
if (!id) throw new NotFoundError('no search results match');
|
||||||
|
|
||||||
const sources = await getFlixhqMovieSources(ctx, ctx.media, id);
|
const sources = await getFlixhqMovieSources(ctx, ctx.media, id);
|
||||||
const upcloudStream = sources.find((v) => v.embed.toLowerCase() === 'upcloud');
|
|
||||||
if (!upcloudStream) throw new NotFoundError('upcloud stream not found for flixhq');
|
const embeds: SourcererEmbed[] = [];
|
||||||
|
|
||||||
|
for (const source of sources) {
|
||||||
|
if (source.embed.toLowerCase() === 'upcloud') {
|
||||||
|
embeds.push({
|
||||||
|
embedId: upcloudScraper.id,
|
||||||
|
url: await getFlixhqSourceDetails(ctx, source.episodeId),
|
||||||
|
});
|
||||||
|
} else if (source.embed.toLowerCase() === 'vidcloud') {
|
||||||
|
embeds.push({
|
||||||
|
embedId: vidCloudScraper.id,
|
||||||
|
url: await getFlixhqSourceDetails(ctx, source.episodeId),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
embeds: [
|
embeds,
|
||||||
{
|
|
||||||
embedId: upcloudScraper.id,
|
|
||||||
url: await getFlixhqSourceDetails(ctx, upcloudStream.episodeId),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async scrapeShow(ctx) {
|
async scrapeShow(ctx) {
|
||||||
|
@ -32,16 +42,24 @@ export const flixhqScraper = makeSourcerer({
|
||||||
if (!id) throw new NotFoundError('no search results match');
|
if (!id) throw new NotFoundError('no search results match');
|
||||||
|
|
||||||
const sources = await getFlixhqShowSources(ctx, ctx.media, id);
|
const sources = await getFlixhqShowSources(ctx, ctx.media, id);
|
||||||
const upcloudStream = sources.find((v) => v.embed.toLowerCase() === 'server upcloud');
|
|
||||||
if (!upcloudStream) throw new NotFoundError('upcloud stream not found for flixhq');
|
const embeds: SourcererEmbed[] = [];
|
||||||
|
for (const source of sources) {
|
||||||
|
if (source.embed.toLowerCase() === 'server upcloud') {
|
||||||
|
embeds.push({
|
||||||
|
embedId: upcloudScraper.id,
|
||||||
|
url: await getFlixhqSourceDetails(ctx, source.episodeId),
|
||||||
|
});
|
||||||
|
} else if (source.embed.toLowerCase() === 'server vidcloud') {
|
||||||
|
embeds.push({
|
||||||
|
embedId: vidCloudScraper.id,
|
||||||
|
url: await getFlixhqSourceDetails(ctx, source.episodeId),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
embeds: [
|
embeds,
|
||||||
{
|
|
||||||
embedId: upcloudScraper.id,
|
|
||||||
url: await getFlixhqSourceDetails(ctx, upcloudStream.episodeId),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { mixdropScraper } from '@/providers/embeds/mixdrop';
|
import { mixdropScraper } from '@/providers/embeds/mixdrop';
|
||||||
import { upcloudScraper } from '@/providers/embeds/upcloud';
|
import { upcloudScraper } from '@/providers/embeds/upcloud';
|
||||||
import { upstreamScraper } from '@/providers/embeds/upstream';
|
import { upstreamScraper } from '@/providers/embeds/upstream';
|
||||||
|
import { vidCloudScraper } from '@/providers/embeds/vidcloud';
|
||||||
import { getZoeChipSourceURL, getZoeChipSources } from '@/providers/sources/zoechip/scrape';
|
import { getZoeChipSourceURL, getZoeChipSources } from '@/providers/sources/zoechip/scrape';
|
||||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||||
|
|
||||||
|
@ -55,6 +56,11 @@ export async function createZoeChipStreamData(ctx: MovieScrapeContext | ShowScra
|
||||||
for (const source of sources) {
|
for (const source of sources) {
|
||||||
const formatted = await formatSource(ctx, source);
|
const formatted = await formatSource(ctx, source);
|
||||||
if (formatted) {
|
if (formatted) {
|
||||||
|
// Zoechip does not return titles for their sources, so we can not check if a source is upcloud or vidcloud because the domain is the same.
|
||||||
|
const upCloudAlreadyExists = embeds.find((e) => e.embedId === upcloudScraper.id);
|
||||||
|
if (formatted.embedId === upcloudScraper.id && upCloudAlreadyExists) {
|
||||||
|
formatted.embedId = vidCloudScraper.id;
|
||||||
|
}
|
||||||
embeds.push(formatted);
|
embeds.push(formatted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue