mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 14:53:24 +00:00
filter captions with invalid language code or caption type
This commit is contained in:
@@ -26,10 +26,13 @@ export const smashyStreamFScraper = makeEmbed({
|
|||||||
if (match) {
|
if (match) {
|
||||||
const [, language, url] = match;
|
const [, language, url] = match;
|
||||||
if (language && url) {
|
if (language && url) {
|
||||||
|
const languageCode = labelToLanguageCode(language);
|
||||||
|
const captionType = getCaptionTypeFromUrl(url);
|
||||||
|
if (!languageCode || !captionType) return null;
|
||||||
return {
|
return {
|
||||||
url: url.replace(',', ''),
|
url: url.replace(',', ''),
|
||||||
language: labelToLanguageCode(language) ?? '',
|
language: languageCode,
|
||||||
type: getCaptionTypeFromUrl(url) ?? 'vtt',
|
type: captionType,
|
||||||
hasCorsRestrictions: false,
|
hasCorsRestrictions: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user