CapĂtulo (\d+)<\/span>/gs;
+ let epMatch;
+ while ((epMatch = episodeRegex.exec(seasonHtml)) !== null) {
+ results.push({
+ season: season.number,
+ href: epMatch[1].trim(),
+ number: parseInt(epMatch[2], 10)
+ });
+ }
+ }));
+
+ results.sort((a, b) => {
+ if (a.season !== b.season) {
+ return a.season - b.season;
+ }
+ return a.number - b.number;
+ });
+
+ return JSON.stringify(results);
+ } catch (err) {
+ return JSON.stringify([{
+ href: "Error",
+ number: "Error",
+ season: "Error"
+ }]);
+ }
+}
+
+
+async function extractStreamUrl(url) {
+ try {
+ const response = await fetchv2(url);
+ const html = await response.text();
+
+ const blockRegex = /]*data-hash="([^"]+)"[^>]*>([\s\S]*?)<\/div>/g;
+ let hash = null;
+ let blockMatch;
+ while ((blockMatch = blockRegex.exec(html)) !== null) {
+ const blockContent = blockMatch[2];
+ if (/class="serv"[^>]*>uqload<\/span>/.test(blockContent)) {
+ hash = blockMatch[1].trim();
+ break;
+ }
+ }
+
+ const tokenRegex = /_token:\s*"([^"]+)"/;
+ const tokenMatch = html.match(tokenRegex);
+ const token = tokenMatch ? tokenMatch[1].trim() : null;
+
+ console.log("Hash:"+ hash);
+ console.log("Token:"+ token);
+
+ const embedResponse = await fetchv2("https://www.verseriesonline.net/hashembedlink", {}, "POST", `hash=${encodeURIComponent(hash)}&_token=${encodeURIComponent(token)}`);
+ const embedJson = await embedResponse.json();
+ const uqloadUrl = embedJson.link;
+
+ const someHtml = await fetchv2(uqloadUrl);
+ const someText = await someHtml.text();
+
+ const finalUrl = await uqloadExtractor(someText, uqloadUrl);
+ const streamObj = {
+ streams: [
+ {
+ title: "Server 1",
+ streamUrl: finalUrl,
+ headers: {
+ referer: "https://uqload.cx/"
+ }
+ }
+ ],
+ subtitle: "https://none.com"
+ };
+ return JSON.stringify(streamObj);
+ } catch (err) {
+ return "https://error.org/";
+ }
+}
+
+/* SCHEME START */
+
+/**
+ * @name uqloadExtractor
+ * @author scigward
+ */
+async function uqloadExtractor(html, embedUrl) {
+ try {
+ const match = html.match(/sources:\s*\[\s*"([^"]+\.mp4)"\s*\]/);
+ const videoSrc = match ? match[1] : "";
+
+ return videoSrc;
+ } catch (error) {
+ console.log("uqloadExtractor error:", error.message);
+ return null;
+ }
+}
+
+/* SCHEME END */
+