Added Cinejoy, cleaned up README

This commit is contained in:
endoverdosing
2026-07-29 23:18:25 -07:00
parent 482055836a
commit 902326bdcd
7 changed files with 282 additions and 75 deletions

View File

@@ -1,54 +1,54 @@
import { HEALTH_PROBE_ID } from "../src/config.js";
// usage: npm test
// comment out the tests you don't want to run
import VylaSDK from "../src/sdk.js";
import dotenv from "dotenv";
dotenv.config();
const BACKROOMS = '1083381';
const sdk = new VylaSDK({
tmdbApiKey: process.env.TMDB_API_KEY
});
// 'true' is excludeDisabled
const sources = sdk.getSources(true);
const source = sources.find(s => s.key === 'goated');
try {
const movieSubs = await sdk.getSubtitles("155");
console.log("Movie Subtitles Count:", movieSubs.length);
console.log("First Subtitle Sample:", movieSubs[0] || "None");
} catch (err) {
console.error("Movie Subtitles Error:", err.message);
}
const result = await sdk.getStream(source.key, BACKROOMS);
console.log("Result:", result);
try {
const movieDownloads = await sdk.getDownloads("155");
console.log("Movie Downloads:", movieDownloads);
} catch (err) {
console.error("Movie Downloads Error:", err.message);
}
// const tests = {
// probeAll(log) {
// const sources = sdk.getSources(true);
// let index = 0;
try {
const tvDownloads = await sdk.getDownloads("1399", "1", "1");
console.log("TV Downloads:", tvDownloads);
} catch (err) {
console.error("TV Downloads Error:", err.message);
}
// Promise.all(sources.map(async (source, idx) => {
// try {
// const result = await sdk.probeSource(source.key);
// index++;
// log(`(${index}/${sources.length}) source #${idx + 1} (${source.label}):`, result);
// } catch (err) {
// log(`Error probing source ${source.key}:`, err);
// }
// })).then(() => {
// log("All sources probed.");
// });
// },
// tryHealthProbe(log) {
// const sources = sdk.getSources(true);
// let index = 0;
try {
const movieResult = await sdk.getStream("cinejoy", "155");
console.log("Movie Stream:", movieResult);
} catch (err) {
console.error("Movie Stream Error:", err.message);
}
// Promise.all(sources.map(async (source, idx) => {
// try {
// const result = await sdk.getStream(source.key, HEALTH_PROBE_ID, null, null, null);
// index++;
// log(`(${index}/${sources.length}) source #${idx + 1} (${source.label}):`, result?.allUrls?.[0]?.url || result?.url || "no sources :(");
// } catch (err) {
// log(`Error probing source ${source.key}:`, err);
// }
// })).then(() => {
// log("All sources probed.");
// });
// }
// }
try {
const tvResult = await sdk.getStream("cinejoy", "1399", "1", "1");
console.log("TV Stream:", tvResult);
} catch (err) {
console.error("TV Stream Error:", err.message);
}
// tests.tryHealthProbe(console.log);
try {
const tvSubs = await sdk.getSubtitles("1399", "1", "1");
console.log("TV Subtitles Count:", tvSubs.length);
console.log("First TV Subtitle Sample:", tvSubs[0] || "None");
} catch (err) {
console.error("TV Subtitles Error:", err.message);
}