Skip to content

Commit

Permalink
fix: misleading directory data on realbooru
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkaroid committed May 12, 2022
1 parent 52ece86 commit bbc4f6c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions booru/client/realbooru.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ def append_obj(raw_object: dict):
"post_url"
] = f"{get_hostname(Booru.realbooru)}/index.php?page=post&s=view&id={raw_object[i]['id']}"


elif not raw_object[i]["directory"]:
raw_object[i][
"file_url"
] = f"{get_hostname(Booru.realbooru)}/images/{raw_object[i]['image'][0:2]}/{raw_object[i]['image'][2:4]}/{raw_object[i]['image']}"
raw_object[i][
"post_url"
] = f"{get_hostname(Booru.realbooru)}/index.php?page=post&s=view&id={raw_object[i]['id']}"

raw_object[i][
"directory"
] = f"{raw_object[i]['image'][0:2]}/{raw_object[i]['image'][2:4]}"

else:
raw_object[i]["file_url"] = Booru.error_handling_cantparse
raw_object[i][
Expand Down

0 comments on commit bbc4f6c

Please sign in to comment.