diff --git a/src/lucida.ts b/src/lucida.ts index 82c9a8c..ca77d94 100644 --- a/src/lucida.ts +++ b/src/lucida.ts @@ -21,7 +21,7 @@ export async function lucida(album: URL, baseTimeout: number, context: BrowserCo const page: Page = await openAlbum(album, context); // Check 'Hide my download from recently downloaded' checkbox - await page.locator('input[id="hide-from-recent"]').first().setChecked(true); + await page.locator('input[id="hide-from-ticker"]').first().setChecked(true); // Parse info const albumName: string = (await page.locator('h1[class="svelte-6pt9ji"]').last().innerText()).trim(); @@ -81,13 +81,16 @@ async function booklet(album: URL, context: BrowserContext): Promise 0) { - console.log(await link.innerHTML()); - } else { + + if (0 <= linkCount) { console.log('No goodies link found'); + await page.close(); return null; } + console.log(`Found goodies: ${await link.innerHTML()}`) + let result: File | null = null; + try { // Go to the goodies link await link.dispatchEvent('click'); @@ -97,13 +100,13 @@ async function booklet(album: URL, context: BrowserContext): Promise