mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 15:43:26 +00:00
rename to parseInputUrl
This commit is contained in:
@@ -10,7 +10,7 @@ export interface FebboxFileList {
|
||||
is_dir: 0 | 1;
|
||||
}
|
||||
|
||||
export function parseInput(url: string) {
|
||||
export function parseInputUrl(url: string) {
|
||||
const [type, id, seasonId, episodeId] = url.slice(1).split('/');
|
||||
const season = seasonId ? parseInt(seasonId, 10) : undefined;
|
||||
const episode = episodeId ? parseInt(episodeId, 10) : undefined;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { MediaTypes } from '@/main/media';
|
||||
import { flags } from '@/main/targets';
|
||||
import { makeEmbed } from '@/providers/base';
|
||||
import { parseInput } from '@/providers/embeds/febbox/common';
|
||||
import { parseInputUrl } from '@/providers/embeds/febbox/common';
|
||||
import { getStreams } from '@/providers/embeds/febbox/fileList';
|
||||
import { getSubtitles } from '@/providers/embeds/febbox/subtitles';
|
||||
import { showboxBase } from '@/providers/sources/showbox/common';
|
||||
@@ -17,7 +17,7 @@ export const febboxHlsScraper = makeEmbed({
|
||||
name: 'Febbox (HLS)',
|
||||
rank: 160,
|
||||
async scrape(ctx) {
|
||||
const { type, id, season, episode } = parseInput(ctx.url);
|
||||
const { type, id, season, episode } = parseInputUrl(ctx.url);
|
||||
const sharelinkResult = await ctx.proxiedFetcher<{
|
||||
data?: { link?: string };
|
||||
}>('/index/share_link', {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { MediaTypes } from '@/main/media';
|
||||
import { flags } from '@/main/targets';
|
||||
import { makeEmbed } from '@/providers/base';
|
||||
import { parseInputUrl } from '@/providers/embeds/febbox/common';
|
||||
import { getStreamQualities } from '@/providers/embeds/febbox/qualities';
|
||||
import { getSubtitles } from '@/providers/embeds/febbox/subtitles';
|
||||
|
||||
@@ -9,9 +9,7 @@ export const febboxMp4Scraper = makeEmbed({
|
||||
name: 'Febbox (MP4)',
|
||||
rank: 190,
|
||||
async scrape(ctx) {
|
||||
const [type, id, seasonId, episodeId] = ctx.url.slice(1).split('/');
|
||||
const season = seasonId ? parseInt(seasonId, 10) : undefined;
|
||||
const episode = episodeId ? parseInt(episodeId, 10) : undefined;
|
||||
const { type, id, season, episode } = parseInputUrl(ctx.url);
|
||||
let apiQuery: object | null = null;
|
||||
|
||||
if (type === 'movie') {
|
||||
@@ -42,7 +40,7 @@ export const febboxMp4Scraper = makeEmbed({
|
||||
|
||||
return {
|
||||
stream: {
|
||||
captions: await getSubtitles(ctx, id, fid, type as MediaTypes, episode, season),
|
||||
captions: await getSubtitles(ctx, id, fid, type, episode, season),
|
||||
qualities,
|
||||
type: 'file',
|
||||
flags: [flags.NO_CORS],
|
||||
|
Reference in New Issue
Block a user