fix: Improve movie link detection
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
||||
"icon": "https://files.catbox.moe/ttj4fc.gif",
|
||||
"url": "https://github.com/JMcrafter26"
|
||||
},
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"language": "English (DUB)",
|
||||
"streamType": "HLS",
|
||||
"quality": "720p",
|
||||
|
||||
@@ -91,13 +91,13 @@ async function extractEpisodes(url) {
|
||||
|
||||
const finishedList = [];
|
||||
const seasonLinks = getSeasonLinks(html);
|
||||
console.log("Season Links: " + JSON.stringify(seasonLinks));
|
||||
sendLog("Season Links: " + JSON.stringify(seasonLinks));
|
||||
|
||||
for (const seasonLink of seasonLinks) {
|
||||
const seasonEpisodes = await fetchSeasonEpisodes(`${seasonLink}`);
|
||||
finishedList.push(...seasonEpisodes);
|
||||
}
|
||||
console.log("Finished Episode List: " + JSON.stringify(finishedList));
|
||||
sendLog("Finished Episode List: " + JSON.stringify(finishedList));
|
||||
|
||||
|
||||
return JSON.stringify(finishedList);
|
||||
@@ -112,6 +112,7 @@ async function extractEpisodes(url) {
|
||||
|
||||
async function extractStreamUrl(url) {
|
||||
try {
|
||||
sendLog("ExtractStreamUrl called with URL: " + url);
|
||||
const language = [2 ,4, 3]; // Prioritize languages: 1=Deutsch, 3=Ger-Sub, 2=Englisch, 4=Eng-Sub
|
||||
|
||||
const fetchUrl = `${url}`;
|
||||
@@ -234,7 +235,8 @@ function getSeasonLinks(html) {
|
||||
const filmeLinks = [];
|
||||
while ((seasonLinkMatch = seasonLinkRegex.exec(seasonList)) !== null) {
|
||||
const [_, seasonLink] = seasonLinkMatch;
|
||||
if (seasonLink.endsWith('/filme')) {
|
||||
// ends with /filme or contains staffel-0
|
||||
if (seasonLink.endsWith('/filme') || seasonLink.includes('staffel-0')) {
|
||||
filmeLinks.push(seasonLink);
|
||||
} else {
|
||||
seasonLinks.push(seasonLink);
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"icon": "https://files.catbox.moe/ttj4fc.gif",
|
||||
"url": "https://github.com/JMcrafter26"
|
||||
},
|
||||
"version": "0.4.0",
|
||||
"version": "0.4.1",
|
||||
"language": "German (DUB)",
|
||||
"streamType": "HLS",
|
||||
"quality": "720p",
|
||||
|
||||
@@ -91,13 +91,13 @@ async function extractEpisodes(url) {
|
||||
|
||||
const finishedList = [];
|
||||
const seasonLinks = getSeasonLinks(html);
|
||||
console.log("Season Links: " + JSON.stringify(seasonLinks));
|
||||
sendLog("Season Links: " + JSON.stringify(seasonLinks));
|
||||
|
||||
for (const seasonLink of seasonLinks) {
|
||||
const seasonEpisodes = await fetchSeasonEpisodes(`${seasonLink}`);
|
||||
finishedList.push(...seasonEpisodes);
|
||||
}
|
||||
console.log("Finished Episode List: " + JSON.stringify(finishedList));
|
||||
sendLog("Finished Episode List: " + JSON.stringify(finishedList));
|
||||
|
||||
|
||||
return JSON.stringify(finishedList);
|
||||
@@ -112,6 +112,7 @@ async function extractEpisodes(url) {
|
||||
|
||||
async function extractStreamUrl(url) {
|
||||
try {
|
||||
sendLog("ExtractStreamUrl called with URL: " + url);
|
||||
const language = [1, 3, 2 ,4]; // Prioritize languages: 1=Deutsch, 3=Ger-Sub, 2=Englisch, 4=Eng-Sub
|
||||
|
||||
const fetchUrl = `${url}`;
|
||||
@@ -234,7 +235,8 @@ function getSeasonLinks(html) {
|
||||
const filmeLinks = [];
|
||||
while ((seasonLinkMatch = seasonLinkRegex.exec(seasonList)) !== null) {
|
||||
const [_, seasonLink] = seasonLinkMatch;
|
||||
if (seasonLink.endsWith('/filme')) {
|
||||
// ends with /filme or contains staffel-0
|
||||
if (seasonLink.endsWith('/filme') || seasonLink.includes('staffel-0')) {
|
||||
filmeLinks.push(seasonLink);
|
||||
} else {
|
||||
seasonLinks.push(seasonLink);
|
||||
|
||||
Reference in New Issue
Block a user