AtoraSuunva / booru

Searches boorus for images using some js magic
https://www.npmjs.com/package/booru
MIT License
75 stars 18 forks source link

fix: dont parse null directory #82

Closed sinkaroid closed 2 years ago

sinkaroid commented 2 years ago

realbooru api is not always update, that directory value said null but actually not https://realbooru.com/index.php?page=dapi&s=post&q=index&tags=webm&json=1

rather than misleading like this, better to reject them Screenshot_413

sinkaroid commented 2 years ago

Since you were fixed this on d112039 I'll close this pr

AtoraSuunva commented 2 years ago

oh whoops, never saw this PR

the directory is just the first 2 characters + 3-4th characters of the hash

ie. if the hash is abcdefgh then the directory is ab/cd

so you can still generate the file url even when directory is null (although i don't know why it's sometimes null)

sinkaroid commented 2 years ago

Nice stuff😈 I just thought there is no way to handle this issue other than rejecting it, cuz majority broken is just for animated content

On Fri, 8 Apr 2022 at 09:37, Atora @.***> wrote:

oh whoops, never saw this PR

the directory is just the first 2 characters + 3-4th characters of the hash

ie. if the hash is abcdefgh then the directory is ab/cd

so you can still generate the file url even when directory is null (although i don't know why it's sometimes null)

— Reply to this email directly, view it on GitHub https://github.com/AtoraSuunva/booru/pull/82#issuecomment-1092385606, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6MUAJB7WXXRLZYNDVWS7TVD6LYFANCNFSM5RTCF3ZA . You are receiving this because you modified the open/close state.Message ID: @.***>