Skip to content

Commit ad24a86

Browse files
dragon-fishclaude
andcommitted
fix: ugoira player meta fetch and pximg URL replacement
- Use `type` import for ZipDownloaderOptions to prevent tree-shaking - Unwrap Pixiv API response envelope (data.body) in fetchMeta - Apply replacePximgInObject to ugoira meta URLs for proxy routing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f8bb7fd commit ad24a86

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

app/utils/UgoiraPlayer.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Artwork } from '~/types'
22
import gifWorkerUrl from 'gif.js/dist/gif.worker.js?url'
3-
import { ZipDownloader, ZipDownloaderOptions } from './ZipDownloader'
3+
import { ZipDownloader, type ZipDownloaderOptions } from './ZipDownloader'
4+
import { replacePximgInObject } from './pximg'
45

56
/**
67
* Public options
@@ -200,13 +201,15 @@ export class UgoiraPlayer {
200201

201202
// ====== network / assets ======
202203
async fetchMeta() {
203-
this._meta = await fetch(
204+
const data = await fetch(
204205
new URL(`/ajax/illust/${this._illust.id}/ugoira_meta`, location.href)
205206
.href,
206207
{
207208
cache: 'default',
208209
}
209210
).then((res) => res.json())
211+
// Pixiv API wraps response in { error, body }; replace pximg URLs
212+
this._meta = replacePximgInObject(data.body ?? data)
210213
return this
211214
}
212215

0 commit comments

Comments
 (0)