]*class='[^']*min-w-10[^']*'[^>]*>(\d+)<\/div>\s*
]*class="[^"]*line-clamp-1[^"]*"[^>]*>([^<]+)<\/div>/g;
+
+ const episodes = [];
+ let match;
+
+ while ((match = regex.exec(html)) !== null) {
+ const [, href, num, title] = match;
+
+ episodes.push({
+ id: href.split("/").pop(),
+ number: Number(num),
+ title: title.trim(),
+ url: href,
+ });
+ }
+
+ return episodes;
+ }
+
+ async findEpisodeServer(episode, server) {
+ const html = await fetch(episode.url).then(r => r.text());
+
+ const srcMatch = html.match(
+ /]+src="([^"]+\.m3u8)"/i
+ );
+ if (!srcMatch) throw new Error("No m3u8 found");
+
+ const masterUrl = srcMatch[1];
+
+ const subtitles = [];
+ const trackRegex =
+ /