Skip to content

Commit

Permalink
fix: future gallery assets no longer avail in legacy cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
rayriffy committed Dec 7, 2024
1 parent d28d9f3 commit 5a29fb4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/src/core/services/getImageUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getImageUrl = (args: GetImageUrlArgs): string => {

return `https://${
type === 'gallery' ? 'i' : 't'
}.nhentai.net/galleries/${mediaId}/${
}4.nhentai.net/galleries/${mediaId}/${
type === 'cover' ? 'cover' : `${page}${type === 'thumbnail' ? 't' : ''}`
}.${image.t === 'p' ? 'png' : image.t === 'g' ? 'gif' : Number(mediaId) > 3110425 ? 'webp' : 'jpg'}`
}
19 changes: 18 additions & 1 deletion web/src/routes/api/_image/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,24 @@ import type { RequestHandler } from './$types'
import {URL} from "node:url";

const requestHandler = createRequestHandler({
remoteDomains: ['i.nhentai.net', 't.nhentai.net'],
remoteDomains: [
'i.nhentai.net',
'i1.nhentai.net',
'i2.nhentai.net',
'i3.nhentai.net',
'i4.nhentai.net',
'i5.nhentai.net',
'i6.nhentai.net',
'i7.nhentai.net',
't.nhentai.net',
't1.nhentai.net',
't2.nhentai.net',
't3.nhentai.net',
't4.nhentai.net',
't5.nhentai.net',
't6.nhentai.net',
't7.nhentai.net',
],
allowedDomains:
env.IMAGE_DOMAIN !== undefined ? [env.IMAGE_DOMAIN] : undefined,
})
Expand Down

0 comments on commit 5a29fb4

Please sign in to comment.