mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-24 18:51:53 +01:00
Merge branch 'source/theflix'
This commit is contained in:
commit
8e7b2d38ea
@ -62,9 +62,9 @@ async function getEpisodes(slug) {
|
|||||||
let seasons = [];
|
let seasons = [];
|
||||||
let episodes = [];
|
let episodes = [];
|
||||||
|
|
||||||
for (let i = 0; i < sNodes.length; i++) {
|
for (let s of sNodes) {
|
||||||
const text = sNodes[i].querySelector('div > section > div > div > div > h2 > a').textContent;
|
const text = s.querySelector('div > section > div > div > div > h2 > a').textContent;
|
||||||
if (!text.includes('Season')) return;
|
if (!text.includes('Season')) continue;
|
||||||
|
|
||||||
const season = text.split(' ')[1];
|
const season = text.split(' ')[1];
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ async function getEpisodes(slug) {
|
|||||||
const epNodes = Array.from(new DOMParser().parseFromString(epRes, 'text/html').querySelectorAll('div.episode_list > div.card'));
|
const epNodes = Array.from(new DOMParser().parseFromString(epRes, 'text/html').querySelectorAll('div.episode_list > div.card'));
|
||||||
epNodes.forEach((e, i) => episodes[season].push(++i));
|
epNodes.forEach((e, i) => episodes[season].push(++i));
|
||||||
}
|
}
|
||||||
|
|
||||||
return { seasons, episodes };
|
return { seasons, episodes };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user