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 | |
| parent | fix: Throw redirects (diff) | |
| download | due.moe-bbd9c8d2b5fa2136f466921e4c163b9e31c1cabe.tar.xz due.moe-bbd9c8d2b5fa2136f466921e4c163b9e31c1cabe.zip | |
fix(api:birthdays): Update HTML parser for primary source
| -rw-r--r-- | src/lib/Tools/Birthdays.svelte | 1 | ||||
| -rw-r--r-- | src/routes/api/birthdays/primary/+server.ts | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/Tools/Birthdays.svelte b/src/lib/Tools/Birthdays.svelte index 519e1550..122662d4 100644 --- a/src/lib/Tools/Birthdays.svelte +++ b/src/lib/Tools/Birthdays.svelte @@ -51,6 +51,7 @@ if (last === last.toUpperCase()) { split[split.length - 1] = last[0] + last.slice(1).toLowerCase(); + return split.join(' '); } 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() }; }), |