mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
Revert "feat: add extractors bundled in file refactor stream handling in multiple providers"
This reverts commit 13d41f9da6.
This commit is contained in:
@@ -3,10 +3,14 @@ const cheerio = require("cheerio");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
// Load utilities
|
||||
// Load extractors and utilities
|
||||
let providerContext;
|
||||
try {
|
||||
const { getBaseUrl } = require("./dist/getBaseUrl.js");
|
||||
const { hubcloudExtracter } = require("./dist/hubcloudExtractor.js");
|
||||
const { gofileExtracter } = require("./dist/gofileExtracter.js");
|
||||
const { superVideoExtractor } = require("./dist/superVideoExtractor.js");
|
||||
const { gdFlixExtracter } = require("./dist/gdFlixExtractor.js");
|
||||
|
||||
providerContext = {
|
||||
axios,
|
||||
@@ -16,11 +20,17 @@ try {
|
||||
"User-Agent":
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
||||
},
|
||||
Aes: {},
|
||||
extractors: {
|
||||
hubcloudExtracter,
|
||||
gofileExtracter,
|
||||
superVideoExtractor,
|
||||
gdFlixExtracter,
|
||||
},
|
||||
Crypto: {},
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(
|
||||
"⚠️ Could not load provider context. Run 'npm run build' first.",
|
||||
"⚠️ Could not load provider context. Run 'npm run build' first."
|
||||
);
|
||||
providerContext = null;
|
||||
}
|
||||
@@ -102,7 +112,7 @@ class ProviderTester {
|
||||
|
||||
if (disabledProviders.length > 0) {
|
||||
console.log(
|
||||
`\n⏭️ Skipping disabled providers: ${disabledProviders.join(", ")}`,
|
||||
`\n⏭️ Skipping disabled providers: ${disabledProviders.join(", ")}`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -171,7 +181,7 @@ class ProviderTester {
|
||||
// Pick a random filter
|
||||
const randomFilter = pickRandom(allFilters);
|
||||
console.log(
|
||||
` 🎲 Selected random filter: "${randomFilter.title}" (${randomFilter.filter})`,
|
||||
` 🎲 Selected random filter: "${randomFilter.title}" (${randomFilter.filter})`
|
||||
);
|
||||
|
||||
// Step 2: Test getPosts with random filter
|
||||
@@ -200,10 +210,10 @@ class ProviderTester {
|
||||
// Pick random posts to test
|
||||
const postsToTest = pickRandom(
|
||||
posts,
|
||||
Math.min(this.postsToTest, posts.length),
|
||||
Math.min(this.postsToTest, posts.length)
|
||||
);
|
||||
console.log(
|
||||
` 🎲 Selected ${postsToTest.length} random posts for meta testing`,
|
||||
` 🎲 Selected ${postsToTest.length} random posts for meta testing`
|
||||
);
|
||||
|
||||
// Step 3: Test getMeta with random posts
|
||||
@@ -227,14 +237,14 @@ class ProviderTester {
|
||||
|
||||
if (!meta || !meta.linkList) {
|
||||
console.log(
|
||||
` ⚠️ Meta returned but linkList is empty/missing`,
|
||||
` ⚠️ Meta returned but linkList is empty/missing`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
metaResults.push({ post, meta });
|
||||
console.log(
|
||||
` ✅ Got meta: type=${meta.type}, links=${meta.linkList.length}`,
|
||||
` ✅ Got meta: type=${meta.type}, links=${meta.linkList.length}`
|
||||
);
|
||||
|
||||
// Show link structure
|
||||
@@ -245,7 +255,7 @@ class ProviderTester {
|
||||
console.log(
|
||||
` [${i + 1}] ${link.title.substring(0, 30)} - ${
|
||||
hasEpisodes ? "📺 Episodes" : ""
|
||||
}${hasDirectLinks ? "🎬 Direct" : ""}`,
|
||||
}${hasDirectLinks ? "🎬 Direct" : ""}`
|
||||
);
|
||||
});
|
||||
} catch (err) {
|
||||
@@ -286,7 +296,7 @@ class ProviderTester {
|
||||
if (episodesModule && episodesModule.getEpisodes) {
|
||||
const testEpisodeLink = pickRandom(episodeLinks);
|
||||
console.log(
|
||||
` 🎲 Testing episodes from: ${testEpisodeLink.link.title}`,
|
||||
` 🎲 Testing episodes from: ${testEpisodeLink.link.title}`
|
||||
);
|
||||
console.log(` URL: ${testEpisodeLink.link.episodesLink}`);
|
||||
|
||||
@@ -332,7 +342,7 @@ class ProviderTester {
|
||||
console.log(
|
||||
` [${i + 1}] ${s.server} - ${
|
||||
s.quality || "unknown"
|
||||
} quality`,
|
||||
} quality`
|
||||
);
|
||||
});
|
||||
} else {
|
||||
@@ -369,11 +379,11 @@ class ProviderTester {
|
||||
const testDirectLink = pickRandom(directLinks);
|
||||
const linksToTest = pickRandom(
|
||||
testDirectLink.link.directLinks,
|
||||
Math.min(this.linksToTest, testDirectLink.link.directLinks.length),
|
||||
Math.min(this.linksToTest, testDirectLink.link.directLinks.length)
|
||||
);
|
||||
|
||||
console.log(
|
||||
` 🎲 Testing ${linksToTest.length} random direct link(s)`,
|
||||
` 🎲 Testing ${linksToTest.length} random direct link(s)`
|
||||
);
|
||||
|
||||
const streamModule = this.loadModule(providerName, "stream");
|
||||
@@ -404,7 +414,7 @@ class ProviderTester {
|
||||
console.log(
|
||||
` [${i + 1}] ${s.server} - ${
|
||||
s.quality || "unknown"
|
||||
} quality`,
|
||||
} quality`
|
||||
);
|
||||
});
|
||||
break; // One success is enough
|
||||
@@ -479,7 +489,7 @@ class ProviderTester {
|
||||
console.log(
|
||||
`\n ${statusIcon} Overall: ${
|
||||
result.summary.failed === 0 ? "PASSED" : "FAILED"
|
||||
}`,
|
||||
}`
|
||||
);
|
||||
|
||||
return result;
|
||||
@@ -519,7 +529,7 @@ class ProviderTester {
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(
|
||||
`\n❌ Critical error testing ${provider}: ${error.message}`,
|
||||
`\n❌ Critical error testing ${provider}: ${error.message}`
|
||||
);
|
||||
failed++;
|
||||
results[provider] = { error: error.message };
|
||||
|
||||
Reference in New Issue
Block a user