Skip to content

Commit

Permalink
Update Asura and handle time gated chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
puckzxz committed Dec 15, 2024
1 parent a835469 commit e7bed77
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/scrapers/asura.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ export default {
const data = (await page.evaluate(() => {
const title = document.querySelector("span.text-xl.font-bold")?.textContent;
const imageUrl = document.querySelector('img[alt="poster"]')?.getAttribute("src");
const latestUrl = Array.from(document.querySelectorAll('h3[class="text-sm text-white font-medium"] a')).map(
(x) => (x as HTMLAnchorElement).href
)[0];
const latestChapter = latestUrl.split("/").pop();
const chapterDivs = Array.from(document.querySelectorAll('div[class*="pl-4 py-2 border rounded-md group w-full"]'));
const latestDiv = chapterDivs[0];
if (latestDiv?.querySelector('svg')) {
return null;
}
const latestUrl = latestDiv?.querySelector('a')?.href;
const latestChapter = latestUrl?.split("/").pop();
if (title && latestChapter && latestUrl) {
return {
title,
Expand Down

0 comments on commit e7bed77

Please sign in to comment.