Merge branch 'dev' into lookmovie

This commit is contained in:
MemeCornucopia
2023-12-07 20:58:18 -05:00
committed by GitHub
7 changed files with 25 additions and 10 deletions

View File

@@ -17286,9 +17286,9 @@
"dev": true
},
"node_modules/vite": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.0.tgz",
"integrity": "sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==",
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.5.1.tgz",
"integrity": "sha512-AXXFaAJ8yebyqzoNB9fu2pHoo/nWX+xZlaRwoeYUxEqBO+Zj4msE5G+BhGBll9lYEKv9Hfks52PAF2X7qDYXQA==",
"dev": true,
"dependencies": {
"esbuild": "^0.18.10",

View File

@@ -1,6 +1,6 @@
{
"name": "@movie-web/providers",
"version": "1.1.2",
"version": "1.1.4",
"description": "Package that contains all the providers of movie-web",
"main": "./lib/index.umd.js",
"types": "./lib/index.d.ts",

View File

@@ -74,7 +74,12 @@ export const upcloudScraper = makeEmbed({
let sources: { file: string; type: string } | null = null;
if (!isJSON(streamRes.sources)) {
const scriptJs = await ctx.proxiedFetcher<string>(`https://rabbitstream.net/js/player/prod/e4-player.min.js`);
const scriptJs = await ctx.proxiedFetcher<string>(`https://rabbitstream.net/js/player/prod/e4-player.min.js`, {
query: {
// browser side caching on this endpoint is quite extreme. Add version query paramter to circumvent any caching
v: Date.now().toString(),
},
});
const decryptionKey = extractKey(scriptJs);
if (!decryptionKey) throw new Error('Key extraction failed');

View File

@@ -5,7 +5,6 @@ import { getFlixhqMovieSources, getFlixhqShowSources, getFlixhqSourceDetails } f
import { getFlixhqId } from '@/providers/sources/flixhq/search';
import { NotFoundError } from '@/utils/errors';
// TODO tv shows are available in flixHQ, just no scraper yet
export const flixhqScraper = makeSourcerer({
id: 'flixhq',
name: 'FlixHQ',

View File

@@ -11,3 +11,4 @@ export const apiUrls = [
];
export const appKey = atob('bW92aWVib3g=');
export const appId = atob('Y29tLnRkby5zaG93Ym94');
export const captionsDomains = [atob('bWJwaW1hZ2VzLmNodWF4aW4uY29t'), atob('aW1hZ2VzLnNoZWd1Lm5ldA==')];

View File

@@ -43,6 +43,7 @@ export const superStreamScraper = makeSourcerer({
};
const { qualities, fid } = await getStreamQualities(ctx, apiQuery);
if (fid === undefined) throw new NotFoundError('No streamable file found');
return {
embeds: [],
@@ -90,6 +91,7 @@ export const superStreamScraper = makeSourcerer({
};
const { qualities, fid } = await getStreamQualities(ctx, apiQuery);
if (fid === undefined) throw new NotFoundError('No streamable file found');
return {
embeds: [],

View File

@@ -2,6 +2,8 @@ import { Caption, getCaptionTypeFromUrl, isValidLanguageCode } from '@/providers
import { sendRequest } from '@/providers/sources/superstream/sendRequest';
import { ScrapeContext } from '@/utils/context';
import { captionsDomains } from './common';
interface CaptionApiResponse {
data: {
list: {
@@ -31,16 +33,22 @@ export async function getSubtitles(
tid: type !== 'movie' ? id : undefined,
episode: episodeId?.toString(),
season: seasonId?.toString(),
group: episodeId ? '' : undefined,
};
const subtitleList = ((await sendRequest(ctx, subtitleApiQuery)) as CaptionApiResponse).data.list;
const subResult = (await sendRequest(ctx, subtitleApiQuery)) as CaptionApiResponse;
const subtitleList = subResult.data.list;
const output: Caption[] = [];
subtitleList.forEach((sub) => {
const subtitle = sub.subtitles.sort((a, b) => b.order - a.order)[0];
if (!subtitle) return;
const subtitleType = getCaptionTypeFromUrl(subtitle.file_path);
const subtitleFilePath = subtitle.file_path
.replace(captionsDomains[0], captionsDomains[1])
.replace(/\s/g, '+')
.replace(/[()]/g, (c) => {
return `%${c.charCodeAt(0).toString(16)}`;
});
const subtitleType = getCaptionTypeFromUrl(subtitleFilePath);
if (!subtitleType) return;
const validCode = isValidLanguageCode(subtitle.lang);
@@ -50,7 +58,7 @@ export async function getSubtitles(
language: subtitle.lang,
hasCorsRestrictions: true,
type: subtitleType,
url: subtitle.file_path,
url: subtitleFilePath,
});
});