Slight refactor.
This commit is contained in:
parent
41cc4c8132
commit
3aa8d50de3
|
@ -28,6 +28,7 @@ def gelboorusource_urlcleaner(url):
|
||||||
class BotInstance:
|
class BotInstance:
|
||||||
# Gelbooru API URL
|
# Gelbooru API URL
|
||||||
gelbooru_url = "https://gelbooru.com/index.php?page=dapi&s=post&q=index&json=1&limit=100&tags="
|
gelbooru_url = "https://gelbooru.com/index.php?page=dapi&s=post&q=index&json=1&limit=100&tags="
|
||||||
|
gelbooru_post_url = "https://gelbooru.com/index.php?page=post&s=view&id="
|
||||||
# Misskey API URL
|
# Misskey API URL
|
||||||
misskey_url = "https://misskey.io/api/"
|
misskey_url = "https://misskey.io/api/"
|
||||||
# Misskey API token
|
# Misskey API token
|
||||||
|
@ -93,7 +94,7 @@ class BotInstance:
|
||||||
|
|
||||||
# Get the image ID
|
# Get the image ID
|
||||||
image_id = gelbooru_json['post'][image_number]["id"]
|
image_id = gelbooru_json['post'][image_number]["id"]
|
||||||
image_post_url = "https://gelbooru.com/index.php?page=post&s=view&id=" + str(image_id)
|
image_post_url = self.gelbooru_post_url + str(image_id)
|
||||||
|
|
||||||
# Get the image URL
|
# Get the image URL
|
||||||
image_url = gelbooru_json['post'][image_number]["file_url"]
|
image_url = gelbooru_json['post'][image_number]["file_url"]
|
||||||
|
|
Loading…
Reference in New Issue