fix: enhance metadata fetching logic and improve selector for episodes

This commit is contained in:
himanshu8443
2025-07-04 18:53:36 +05:30
parent 3d92996ec3
commit 355953eb4a
2 changed files with 4 additions and 2 deletions

3
dist/uhd/meta.js vendored
View File

@@ -30,6 +30,7 @@ const getMeta = function (_a) {
var _b; var _b;
try { try {
const { axios, cheerio } = providerContext; const { axios, cheerio } = providerContext;
console.log("Fetching metadata from UHD...", link, providerContext);
const url = link; const url = link;
const res = yield axios.get(url, { headers }); const res = yield axios.get(url, { headers });
const html = yield res.data; const html = yield res.data;
@@ -41,7 +42,7 @@ const getMeta = function (_a) {
// Links // Links
const episodes = []; const episodes = [];
// new structure // new structure
$(".mks_separator").each((index, element) => { $(".mks_separator,p:contains('mks_separator')").each((index, element) => {
$(element) $(element)
.nextUntil(".mks_separator") .nextUntil(".mks_separator")
.each((index, element) => { .each((index, element) => {

View File

@@ -28,6 +28,7 @@ export const getMeta = async function ({
}): Promise<Info> { }): Promise<Info> {
try { try {
const { axios, cheerio } = providerContext; const { axios, cheerio } = providerContext;
console.log("Fetching metadata from UHD...", link, providerContext);
const url = link; const url = link;
const res = await axios.get(url, { headers }); const res = await axios.get(url, { headers });
const html = await res.data; const html = await res.data;
@@ -43,7 +44,7 @@ export const getMeta = async function ({
const episodes: Link[] = []; const episodes: Link[] = [];
// new structure // new structure
$(".mks_separator").each((index, element) => { $(".mks_separator,p:contains('mks_separator')").each((index, element) => {
$(element) $(element)
.nextUntil(".mks_separator") .nextUntil(".mks_separator")
.each((index, element) => { .each((index, element) => {