diff options
| author | Fuwn <[email protected]> | 2025-12-07 03:20:48 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-12-07 03:20:48 -0800 |
| commit | bbd9c8d2b5fa2136f466921e4c163b9e31c1cabe (patch) | |
| tree | 5196f2c72085e46316ff7ffc02969f24a32b27d9 /src/routes | |
| parent | fix: Throw redirects (diff) | |
| download | due.moe-bbd9c8d2b5fa2136f466921e4c163b9e31c1cabe.tar.xz due.moe-bbd9c8d2b5fa2136f466921e4c163b9e31c1cabe.zip | |
fix(api:birthdays): Update HTML parser for primary source
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/api/birthdays/primary/+server.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/routes/api/birthdays/primary/+server.ts b/src/routes/api/birthdays/primary/+server.ts index 1e480283..774d47e1 100644 --- a/src/routes/api/birthdays/primary/+server.ts +++ b/src/routes/api/birthdays/primary/+server.ts @@ -23,10 +23,10 @@ export const GET = async ({ url }: { url: URL }) => { if (!anchor || !title) return { image: '', title: '' }; + const image = li.getElementsByClassName('item-cover')[0]; + return { - image: anchor.getAttribute('data-bg') - ? `https://cdn.anisearch.com/images/${anchor.getAttribute('data-bg')}` - : null, + image: image ? image.getAttribute('src') : '', name: title.textContent?.trim() }; }), |