From cb57e0eef47a666f868831d213a912729344c721 Mon Sep 17 00:00:00 2001 From: Jorrin Date: Mon, 18 Dec 2023 20:48:52 +0100 Subject: [PATCH] pr feedback --- src/providers/embeds/smashystream/dued.ts | 2 +- src/providers/embeds/smashystream/video1.ts | 9 ++++----- src/providers/sources/smashystream/index.ts | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/providers/embeds/smashystream/dued.ts b/src/providers/embeds/smashystream/dued.ts index 1dd223e..89c0814 100644 --- a/src/providers/embeds/smashystream/dued.ts +++ b/src/providers/embeds/smashystream/dued.ts @@ -12,7 +12,7 @@ type DPlayerSourcesResponse = { export const smashyStreamDScraper = makeEmbed({ id: 'smashystream-d', name: 'SmashyStream (D)', - rank: 410, + rank: 71, async scrape(ctx) { const mainPageRes = await ctx.proxiedFetcher(ctx.url, { headers: { diff --git a/src/providers/embeds/smashystream/video1.ts b/src/providers/embeds/smashystream/video1.ts index 6aaad4f..cf22cdc 100644 --- a/src/providers/embeds/smashystream/video1.ts +++ b/src/providers/embeds/smashystream/video1.ts @@ -1,6 +1,6 @@ import { flags } from '@/main/targets'; import { makeEmbed } from '@/providers/base'; -import { Caption } from '@/providers/captions'; +import { Caption, getCaptionTypeFromUrl, labelToLanguageCode } from '@/providers/captions'; type FPlayerResponse = { sourceUrls: string[]; @@ -10,7 +10,7 @@ type FPlayerResponse = { export const smashyStreamFScraper = makeEmbed({ id: 'smashystream-f', name: 'SmashyStream (F)', - rank: 400, + rank: 70, async scrape(ctx) { const res = await ctx.proxiedFetcher(ctx.url, { headers: { @@ -28,9 +28,8 @@ export const smashyStreamFScraper = makeEmbed({ if (language && url) { return { url: url.replace(',', ''), - language, - kind: 'subtitles', - type: url.includes('.vtt') ? 'vtt' : 'srt', + language: labelToLanguageCode(language) ?? '', + type: getCaptionTypeFromUrl(url) ?? 'vtt', hasCorsRestrictions: false, }; } diff --git a/src/providers/sources/smashystream/index.ts b/src/providers/sources/smashystream/index.ts index 663debb..c5a8b27 100644 --- a/src/providers/sources/smashystream/index.ts +++ b/src/providers/sources/smashystream/index.ts @@ -57,7 +57,7 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr export const smashyStreamScraper = makeSourcerer({ id: 'smashystream', name: 'SmashyStream', - rank: 400, + rank: 70, flags: [flags.NO_CORS], scrapeMovie: universalScraper, scrapeShow: universalScraper,