mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 17:43:25 +00:00
Compare commits
1 Commits
0654625219
...
97db04b66e
Author | SHA1 | Date | |
---|---|---|---|
|
97db04b66e |
@@ -14,7 +14,7 @@ import { vidsrcembedScraper } from '@/providers/embeds/vidsrc';
|
|||||||
import { vTubeScraper } from '@/providers/embeds/vtube';
|
import { vTubeScraper } from '@/providers/embeds/vtube';
|
||||||
import { flixhqScraper } from '@/providers/sources/flixhq/index';
|
import { flixhqScraper } from '@/providers/sources/flixhq/index';
|
||||||
import { goMoviesScraper } from '@/providers/sources/gomovies/index';
|
import { goMoviesScraper } from '@/providers/sources/gomovies/index';
|
||||||
import { insertunitScraper } from '@/providers/sources/insertunit';
|
import { insertunitScraper } from '@/providers/sources/insertunit/insertunit';
|
||||||
import { kissAsianScraper } from '@/providers/sources/kissasian/index';
|
import { kissAsianScraper } from '@/providers/sources/kissasian/index';
|
||||||
import { lookmovieScraper } from '@/providers/sources/lookmovie';
|
import { lookmovieScraper } from '@/providers/sources/lookmovie';
|
||||||
import { remotestreamScraper } from '@/providers/sources/remotestream';
|
import { remotestreamScraper } from '@/providers/sources/remotestream';
|
||||||
|
@@ -1,30 +1,32 @@
|
|||||||
import { Caption, removeDuplicatedLanguages } from '@/providers/captions';
|
import { Caption } from "@/providers/captions";
|
||||||
|
import { Subtitle } from "./types";
|
||||||
|
|
||||||
import { Subtitle } from './types';
|
import { removeDuplicatedLanguages } from "@/providers/captions";
|
||||||
|
|
||||||
export async function getCaptions(data: Subtitle[]) {
|
export async function getCaptions(data: Subtitle[]) {
|
||||||
let captions: Caption[] = [];
|
let captions: Caption[] = [];
|
||||||
for (const subtitle of data) {
|
let subtitle: Subtitle;
|
||||||
let language = '';
|
for (subtitle of data) {
|
||||||
|
let language = '';
|
||||||
|
|
||||||
if (subtitle.name.includes('Рус')) {
|
if (subtitle.name.includes('Рус')) {
|
||||||
language = 'ru';
|
language = 'ru';
|
||||||
} else if (subtitle.name.includes('Укр')) {
|
} else if (subtitle.name.includes('Укр')) {
|
||||||
language = 'uk';
|
language = 'uk';
|
||||||
} else if (subtitle.name.includes('Eng')) {
|
} else if (subtitle.name.includes('Eng')) {
|
||||||
language = 'en';
|
language = 'en';
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
captions.push({
|
||||||
|
id: subtitle.url,
|
||||||
|
url: subtitle.url,
|
||||||
|
language,
|
||||||
|
type: 'vtt',
|
||||||
|
hasCorsRestrictions: false,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
captions = removeDuplicatedLanguages(captions);
|
||||||
captions.push({
|
return(captions)
|
||||||
id: subtitle.url,
|
}
|
||||||
url: subtitle.url,
|
|
||||||
language,
|
|
||||||
type: 'vtt',
|
|
||||||
hasCorsRestrictions: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
captions = removeDuplicatedLanguages(captions);
|
|
||||||
return captions;
|
|
||||||
}
|
|
@@ -1,10 +1,10 @@
|
|||||||
import { flags } from '@/entrypoint/utils/targets';
|
import { flags } from '@/entrypoint/utils/targets';
|
||||||
import { makeSourcerer } from '@/providers/base';
|
import { makeSourcerer } from '@/providers/base';
|
||||||
import { Caption } from '@/providers/captions';
|
import { Caption, removeDuplicatedLanguages } from '@/providers/captions';
|
||||||
import { NotFoundError } from '@/utils/errors';
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
|
||||||
import { getCaptions } from './captions';
|
import { getCaptions } from './captions';
|
||||||
import { Season } from './types';
|
|
||||||
|
import { Season, Subtitle } from './types';
|
||||||
|
|
||||||
const insertUnitBase = 'https://api.insertunit.ws/';
|
const insertUnitBase = 'https://api.insertunit.ws/';
|
||||||
|
|
||||||
@@ -39,11 +39,16 @@ export const insertunitScraper = makeSourcerer({
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!currentEpisode?.hls) throw new NotFoundError('No result found');
|
if (!currentEpisode?.hls) throw new NotFoundError('No result found');
|
||||||
|
|
||||||
let captions: Caption[] = [];
|
let captions: Caption[] = []
|
||||||
|
|
||||||
|
if (currentEpisode.cc != null) {
|
||||||
|
captions = await getCaptions(currentEpisode.cc)
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.progress(80);
|
||||||
|
|
||||||
if (currentEpisode.cc != null) {
|
if (currentEpisode.cc != null) {
|
||||||
captions = await getCaptions(currentEpisode.cc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.progress(95);
|
ctx.progress(95);
|
||||||
@@ -82,7 +87,7 @@ export const insertunitScraper = makeSourcerer({
|
|||||||
|
|
||||||
if (subtitleJSONData != null && subtitleJSONData[1] != null) {
|
if (subtitleJSONData != null && subtitleJSONData[1] != null) {
|
||||||
const subtitleData = JSON.parse(subtitleJSONData[1]);
|
const subtitleData = JSON.parse(subtitleJSONData[1]);
|
||||||
captions = await getCaptions(subtitleData);
|
captions = await getCaptions(subtitleData)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.progress(90);
|
ctx.progress(90);
|
Reference in New Issue
Block a user