Files
vega-providers/dist/ringz/ringzGetMeta.js
himanshu8443 3f3e12f5df init
2025-06-15 21:29:40 +05:30

86 lines
2.8 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ringzGetInfo = void 0;
const ringzGetInfo = async function ({ link: data, }) {
try {
const dataJson = JSON.parse(data);
const title = dataJson?.kn || dataJson?.mn;
const image = dataJson?.IH || dataJson?.IV;
const tags = dataJson?.gn
.split(',')
.slice(0, 3)
.map((tag) => tag.trim());
const type = dataJson?.cg === 'webSeries' ? 'series' : 'movie';
const linkList = [];
if (dataJson?.cg === 'webSeries') {
['1', '2', '3', '4']?.forEach(item => {
const directLinks = [];
if (typeof dataJson?.['eServer' + item] === 'object' &&
Object?.keys(dataJson?.['eServer' + item])?.length > 0) {
Object.keys(dataJson?.['eServer' + item]).forEach(key => {
directLinks.push({
title: 'Episode ' + key,
link: JSON.stringify({
url: dataJson?.['eServer' + item][key],
server: 'Server ' + item,
}),
});
});
linkList.push({
title: dataJson?.pn + ' (Server ' + item + ')',
directLinks,
});
}
});
}
else {
const directLinks = [];
['1', '2', '3', '4']?.forEach(item => {
if (dataJson?.['s' + item]) {
directLinks.push({
title: 'Server ' + item + ' (HD)',
link: JSON.stringify({
url: dataJson?.s1,
server: 'Server ' + item,
}),
});
}
if (dataJson?.['4s' + item]) {
directLinks.push({
title: 'Server ' + item + ' (480p)',
link: JSON.stringify({
url: dataJson?.['4s' + item],
server: 'Server ' + item,
}),
});
}
});
linkList.push({
title: dataJson?.pn,
directLinks,
});
}
return {
title,
image,
imdbId: '',
synopsis: '',
type,
linkList,
tags,
};
}
catch (err) {
return {
title: '',
image: '',
imdbId: '',
synopsis: '',
type: 'movie',
linkList: [],
tags: [],
};
}
};
exports.ringzGetInfo = ringzGetInfo;