update
This commit is contained in:
+16
-5
@@ -49,17 +49,28 @@ async function extractEpisodes(url) {
|
||||
const response = await fetchv2(url);
|
||||
const html = await response.text();
|
||||
|
||||
const regex = /<div class="inepcx">\s*<a href="([^"#]+)">\s*<span>New Episode<\/span>/;
|
||||
const match = regex.exec(html);
|
||||
const episodeRegex = /<li[^>]*>\s*<a href="([^"]+)"[^>]*>\s*<div class="epl-num">(\d+)<\/div>/g;
|
||||
let match;
|
||||
|
||||
if (match) {
|
||||
while ((match = episodeRegex.exec(html)) !== null) {
|
||||
results.push({
|
||||
href: match[1].trim(),
|
||||
number: 1
|
||||
number: parseInt(match[2], 10)
|
||||
});
|
||||
}
|
||||
|
||||
if (results.length === 0) {
|
||||
const singleRegex = /<div class="inepcx">\s*<a href="([^"#]+)">\s*<span>New Episode<\/span>/;
|
||||
const singleMatch = singleRegex.exec(html);
|
||||
if (singleMatch) {
|
||||
results.push({
|
||||
href: singleMatch[1].trim(),
|
||||
number: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return JSON.stringify(results);
|
||||
return JSON.stringify(results.reverse());
|
||||
}
|
||||
async function extractStreamUrl(url) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user