1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-30 16:17:41 +01:00

fix netfilm qualities

This commit is contained in:
James Hawkins 2023-01-26 13:42:08 +00:00
parent b1333cfc16
commit a1cae1c9f7

View file

@ -1,14 +1,22 @@
import { proxiedFetch } from "../helpers/fetch"; import { proxiedFetch } from "../helpers/fetch";
import { registerProvider } from "../helpers/register"; import { registerProvider } from "../helpers/register";
import { MWStreamType } from "../helpers/streams"; import { MWStreamQuality, MWStreamType } from "../helpers/streams";
import { MWMediaType } from "../metadata/types"; import { MWMediaType } from "../metadata/types";
const netfilmBase = "https://net-film.vercel.app"; const netfilmBase = "https://net-film.vercel.app";
const qualityMap = {
"360": MWStreamQuality.Q360P,
"480": MWStreamQuality.Q480P,
"720": MWStreamQuality.Q720P,
"1080": MWStreamQuality.Q1080P,
};
type QualityInMap = keyof typeof qualityMap;
registerProvider({ registerProvider({
id: "netfilm", id: "netfilm",
displayName: "NetFilm", displayName: "NetFilm",
rank: 999, rank: 150,
type: [MWMediaType.MOVIE, MWMediaType.SERIES], type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media, episode, progress }) { async scrape({ media, episode, progress }) {
@ -50,7 +58,7 @@ registerProvider({
embeds: [], embeds: [],
stream: { stream: {
streamUrl: source.url, streamUrl: source.url,
quality: source.quality, quality: qualityMap[source.quality as QualityInMap],
type: MWStreamType.HLS, type: MWStreamType.HLS,
// captions: [], // captions: [],
}, },
@ -111,7 +119,7 @@ registerProvider({
embeds: [], embeds: [],
stream: { stream: {
streamUrl: source.url, streamUrl: source.url,
quality: source.quality, quality: qualityMap[source.quality as QualityInMap],
type: MWStreamType.HLS, type: MWStreamType.HLS,
// captions: [], // captions: [],
}, },