diff --git a/src/backend/metadata/getmeta.ts b/src/backend/metadata/getmeta.ts index 7fb14ae6..cb622e3b 100644 --- a/src/backend/metadata/getmeta.ts +++ b/src/backend/metadata/getmeta.ts @@ -54,7 +54,6 @@ export async function getMetaFromId( throw err; } - console.log(data.external_ids); const imdbId = data.external_ids.find( (v) => v.provider === "imdb_latest" )?.external_id; diff --git a/src/backend/providers/gomostream.ts b/src/backend/providers/gomostream.ts deleted file mode 100644 index 275e6099..00000000 --- a/src/backend/providers/gomostream.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { unpack } from "unpacker"; -import { proxiedFetch } from "../helpers/fetch"; -import { registerProvider } from "../helpers/register"; -import { MWStreamQuality, MWStreamType } from "../helpers/streams"; -import { MWMediaType } from "../metadata/types"; -import json5 from "json5"; - -const gomoBase = "https://gomo.to/"; - -registerProvider({ - id: "gomostream", - displayName: "gomostream", - rank: 999, - type: [MWMediaType.MOVIE], - - async scrape({ media, progress }) { - // get movie from gomostream - const contentResult = await proxiedFetch( - `/${media.meta.type}/${media.imdbId}`, - { - baseURL: gomoBase, - } - ); - - // movie doesn't exist - if ( - contentResult === "Movie not available." || - contentResult === "Episode not available." - ) - throw new Error("No watchable item found."); - - // decode stream - progress(25); - - const tc = contentResult.match(/var tc = '(.+)';/)?.[1] || ""; - const _token = contentResult.match(/"_token": "(.+)",/)?.[1] || ""; - - const fd = new FormData(); - fd.append("tokenCode", tc); - fd.append("_token", _token); - - const src = await proxiedFetch(`/decoding_v3.php`, { - baseURL: gomoBase, - method: "POST", - body: fd, - headers: { - "x-token": `${tc.slice(5, 13).split("").reverse().join("")}13574199`, - }, - parseResponse: JSON.parse, - }); - - // TODO should check all embed urls in future - const embedUrl = src.filter((url: string) => url.includes("gomo.to"))[1]; - - // get stream info - progress(50); - - const streamRes = await proxiedFetch(embedUrl); - - const streamResDom = new DOMParser().parseFromString( - streamRes, - "text/html" - ); - if (streamResDom.body.innerText === "File was deleted") - throw new Error("No watchable item found."); - - const script = Array.from(streamResDom.querySelectorAll("script")).find( - (s: HTMLScriptElement) => - s.innerHTML.includes("eval(function(p,a,c,k,e,d") - )?.innerHTML; - if (!script) throw new Error("Could not get packed data"); - - // unpack data - progress(75); - - const unpacked = unpack(script); - const rawSources = /sources:(\[.*?\])/.exec(unpacked); - if (!rawSources) throw new Error("Could not get stream URL"); - - const sources = json5.parse(rawSources[1]); - const streamUrl = sources[0].file; - - console.log(sources); - - const streamType = streamUrl.split(".").at(-1); - if (streamType !== "mp4" && streamType !== "m3u8") - throw new Error("Unsupported stream type"); - - return { - embeds: [], - stream: { - quality: streamType, - streamUrl: streamUrl, - type: streamType, - }, - }; - }, -}); diff --git a/src/backend/providers/superstream/superstream.ts b/src/backend/providers/superstream/superstream.ts index cb0c3928..7cdcc851 100644 --- a/src/backend/providers/superstream/superstream.ts +++ b/src/backend/providers/superstream/superstream.ts @@ -1,13 +1,11 @@ import { registerProvider } from "@/backend/helpers/register"; import { MWMediaType } from "@/backend/metadata/types"; -import { conf } from "@/setup/config"; import { customAlphabet } from "nanoid"; // import toWebVTT from "srt-webvtt"; import CryptoJS from "crypto-js"; import { proxiedFetch } from "@/backend/helpers/fetch"; import { MWStreamQuality, MWStreamType } from "@/backend/helpers/streams"; -import { MetadataSchema } from "hls.js"; const nanoid = customAlphabet("0123456789abcdef", 32); @@ -154,8 +152,6 @@ registerProvider({ if (!hdQuality) throw new Error("No quality could be found."); - console.log(hdQuality); - // const subtitleApiQuery = { // fid: hdQuality.fid, // uid: "",