Booru Tasks

Booru-related Parsers can be imported from image_crawler_utils.stations.booru. Check out its documentation for more details.

Keyword Filter for Booru

Booru-structured sites share a keyword filter image_crawler_utils.stations.booru.filter_keyword_booru(). It will check whether a standard syntax keyword string matches the tags of an image.

  • For example, “kuon_(utawarerumono) OR chinadress” matches tags “kuon_(utawarerumono)”, “hair_ornament”, while “kuon_(utawarerumono) AND chinadress” does not match.

To use it in Downloader is like:

from image_crawler_utils.stations.booru import filter_keyword_booru

downloader = Downloader(
    image_info_filter=lambda info: filter_keyword_booru(info, "kuon_(utawarerumono) OR chinadress")
)

Danbooru Tips

See also

Danbooru’s cheatsheet

Read this page before searching in Danbooru.

About DanbooruKeywordParser

For the meaning of parameters and attributes, check out the documentation of DanbooruKeywordParser.

Important

Danbooru sometimes does not accept user agents. Leave the parameter headers blank (or set to None) in CrawlerSettings is acceptable.

Note

For free users, Danbooru only supports searching at most 2 keywords / tags at the same time (can be connected by logic symbols). Refer to the DanbooruKeywordParser documentation for more details.

Example Program of DanbooruKeywordParser

This example program downloads the first 20 images from Danbooru with keyword / tag “kuon_(utawarerumono)” and “rating:general” into the Danbooru folder. Information of images will be stored in image_info_list.json at same the path of your program.

from image_crawler_utils import CrawlerSettings, Downloader, save_image_infos
from image_crawler_utils.stations.booru import DanbooruKeywordParser

#======================================================================#
# This part prepares the settings for crawling and downloading images. #
#======================================================================#

crawler_settings = CrawlerSettings(
    image_num=20,
    # If you do not use system proxies, remove '#' and set the proxies manually.
    # proxies={"https": "socks5://127.0.0.1:7890"},
)

#==================================================================#
# This part gets the URLs and information of images from Danbooru. #
#==================================================================#

parser = DanbooruKeywordParser(
    crawler_settings=crawler_settings,
    standard_keyword_string="kuon_(utawarerumono) AND rating:general",
)
image_info_list = parser.run()
# The information will be saved at image_info_list.json
save_image_infos(image_info_list, "image_info_list")

#===================================================================#
# This part downloads the images according to the image information #
# just collected in the image_info_list.                            #
#===================================================================#

downloader = Downloader(
    store_path='Danbooru',
    image_info_list=image_info_list,
    crawler_settings=crawler_settings,
)
downloader.run()

Example ImageInfo of DanbooruKeywordParser

This example image information (Danbooru ID 4994142) is from this Danbooru page. Its ImageInfo structure in JSON is like:

CLICK HERE TO DISPLAY
{
    "url": "https://cdn.donmai.us/original/cd/91/cd91f0000b9574bf142d125a1e886e5c.png",
    "name": "Danbooru 4994142 cd91f0000b9574bf142d125a1e886e5c.png",
    "info": {
        "info": {
            "id": 4994142,
            "created_at": "2021-12-21T08:02:13.706-05:00",
            "uploader_id": 772564,
            "score": 10,
            "source": "https://i.pximg.net/img-original/img/2020/08/11/12/41/43/83599609_p0.png",
            "md5": "cd91f0000b9574bf142d125a1e886e5c",
            "last_comment_bumped_at": null,
            "rating": "s",
            "image_width": 2000,
            "image_height": 2828,
            "tag_string": "1girl absurdres animal_ears black_eyes black_hair coat grabbing_own_breast hair_ornament hairband highres holding holding_mask japanese_clothes kuon_(utawarerumono) long_hair looking_at_viewer mask ponytail shirokuro_neko_(ouma_haruka) smile solo utawarerumono utawarerumono:_itsuwari_no_kamen",
            "fav_count": 10,
            "file_ext": "png",
            "last_noted_at": null,
            "parent_id": null,
            "has_children": false,
            "approver_id": null,
            "tag_count_general": 17,
            "tag_count_artist": 1,
            "tag_count_character": 1,
            "tag_count_copyright": 2,
            "file_size": 4527472,
            "up_score": 10,
            "down_score": 0,
            "is_pending": false,
            "is_flagged": false,
            "is_deleted": false,
            "tag_count": 23,
            "updated_at": "2024-07-10T12:21:31.782-04:00",
            "is_banned": false,
            "pixiv_id": 83599609,
            "last_commented_at": null,
            "has_active_children": false,
            "bit_flags": 0,
            "tag_count_meta": 2,
            "has_large": true,
            "has_visible_children": false,
            "media_asset": {
                "id": 5056745,
                "created_at": "2021-12-21T08:02:04.132-05:00",
                "updated_at": "2023-03-02T04:43:15.608-05:00",
                "md5": "cd91f0000b9574bf142d125a1e886e5c",
                "file_ext": "png",
                "file_size": 4527472,
                "image_width": 2000,
                "image_height": 2828,
                "duration": null,
                "status": "active",
                "file_key": "nxj2jBet8",
                "is_public": true,
                "pixel_hash": "5d34bcf53ddde76fd723f29aae5ebc53",
                "variants": [
                    {
                        "type": "180x180",
                        "url": "https://cdn.donmai.us/180x180/cd/91/cd91f0000b9574bf142d125a1e886e5c.jpg",
                        "width": 127,
                        "height": 180,
                        "file_ext": "jpg"
                    },
                    {
                        "type": "360x360",
                        "url": "https://cdn.donmai.us/360x360/cd/91/cd91f0000b9574bf142d125a1e886e5c.jpg",
                        "width": 255,
                        "height": 360,
                        "file_ext": "jpg"
                    },
                    {
                        "type": "720x720",
                        "url": "https://cdn.donmai.us/720x720/cd/91/cd91f0000b9574bf142d125a1e886e5c.webp",
                        "width": 509,
                        "height": 720,
                        "file_ext": "webp"
                    },
                    {
                        "type": "sample",
                        "url": "https://cdn.donmai.us/sample/cd/91/sample-cd91f0000b9574bf142d125a1e886e5c.jpg",
                        "width": 850,
                        "height": 1202,
                        "file_ext": "jpg"
                    },
                    {
                        "type": "original",
                        "url": "https://cdn.donmai.us/original/cd/91/cd91f0000b9574bf142d125a1e886e5c.png",
                        "width": 2000,
                        "height": 2828,
                        "file_ext": "png"
                    }
                ]
            },
            "tag_string_general": "1girl animal_ears black_eyes black_hair coat grabbing_own_breast hair_ornament hairband holding holding_mask japanese_clothes long_hair looking_at_viewer mask ponytail smile solo",
            "tag_string_character": "kuon_(utawarerumono)",
            "tag_string_copyright": "utawarerumono utawarerumono:_itsuwari_no_kamen",
            "tag_string_artist": "shirokuro_neko_(ouma_haruka)",
            "tag_string_meta": "absurdres highres",
            "file_url": "https://cdn.donmai.us/original/cd/91/cd91f0000b9574bf142d125a1e886e5c.png",
            "large_file_url": "https://cdn.donmai.us/sample/cd/91/sample-cd91f0000b9574bf142d125a1e886e5c.jpg",
            "preview_file_url": "https://cdn.donmai.us/180x180/cd/91/cd91f0000b9574bf142d125a1e886e5c.jpg"
        },
        "family_group": null,
        "tags": [
            "1girl",
            "absurdres",
            "animal_ears",
            "black_eyes",
            "black_hair",
            "coat",
            "grabbing_own_breast",
            "hair_ornament",
            "hairband",
            "highres",
            "holding",
            "holding_mask",
            "japanese_clothes",
            "kuon_(utawarerumono)",
            "long_hair",
            "looking_at_viewer",
            "mask",
            "ponytail",
            "shirokuro_neko_(ouma_haruka)",
            "smile",
            "solo",
            "utawarerumono",
            "utawarerumono:_itsuwari_no_kamen"
        ],
        "tags_class": {
            "1girl": "general",
            "animal_ears": "general",
            "black_eyes": "general",
            "black_hair": "general",
            "coat": "general",
            "grabbing_own_breast": "general",
            "hair_ornament": "general",
            "hairband": "general",
            "holding": "general",
            "holding_mask": "general",
            "japanese_clothes": "general",
            "long_hair": "general",
            "looking_at_viewer": "general",
            "mask": "general",
            "ponytail": "general",
            "smile": "general",
            "solo": "general",
            "kuon_(utawarerumono)": "character",
            "utawarerumono": "copyright",
            "utawarerumono:_itsuwari_no_kamen": "copyright",
            "shirokuro_neko_(ouma_haruka)": "artist",
            "absurdres": "meta",
            "highres": "meta"
        }
    },
    "backup_urls": [
        "https://i.pximg.net/img-original/img/2020/08/11/12/41/43/83599609_p0.png"
    ]
}

Moebooru Tips

Currently supported Moebooru websites are listed below.

Important

konachan.com sometimes has a Cloudflare protection. Set has_cloudflare to True in MoebooruKeywordParser and do a manual clicking when Cloudflare page is displayed.

If you got stuck in the Cloudflare checking page, try changing an IP address (with a proxy) or switch to another environment to access.

See also

yande.re’s cheatsheet

Read this pages before searching in yande.re.

Konachan’s cheatsheet

Read this pages before searching in Konachan.

About MoebooruKeywordParser

For the meaning of parameters and attributes, check out the documentation of MoebooruKeywordParser.

Important

Currently, Moebooru-supported websites allow keywords connected by only one type of logic symbol (AND or OR in standard_keyword_string).

Example Program of MoebooruKeywordParser

For yande.re, this example will download images with keyword / tag “kuon_(utawarerumono)” and “rating:safe” into the “Yandere” folder using JSON-API.

from image_crawler_utils import Downloader
from image_crawler_utils.stations.booru import MoebooruKeywordParser

# use_api is True, then image_num_per_gallery_page and image_num_per_json must be designated
from image_crawler_utils.stations.booru import (
    YANDERE_IMAGE_NUM_PER_GALLERY_PAGE,
    YANDERE_IMAGE_NUM_PER_JSON,
)

parser = MoebooruKeywordParser(
    station_url="https://yande.re/",
    standard_keyword_string="kuon_(utawarerumono) AND rating:safe",
    use_api=True,
    image_num_per_gallery_page=YANDERE_IMAGE_NUM_PER_GALLERY_PAGE,
    image_num_per_json=YANDERE_IMAGE_NUM_PER_JSON,
)
image_info_list = parser.run()
downloader = Downloader(
    store_path='Yandere',
    image_info_list=image_info_list,
)
downloader.run()

For konachan.com, this example will download images with keyword / tag “kuon_(utawarerumono)” and “rating:safe” into the “Konachan_com” folder without using JSON-API.

from image_crawler_utils import Downloader
from image_crawler_utils.stations.booru import MoebooruKeywordParser

parser = MoebooruKeywordParser(
    station_url="https://konachan.com/",
    standard_keyword_string="kuon_(utawarerumono) AND rating:safe",
    use_api=False,
    has_cloudflare=True,
)
image_info_list = parser.run()
downloader = Downloader(
    store_path='Konachan_com',
    image_info_list=image_info_list,
)
downloader.run()

Example ImageInfo of MoebooruKeywordParser

This example image information (yande.re ID 444116) is from this yande.re page.

With use_api set to True, its ImageInfo structure in JSON is like:

CLICK HERE TO DISPLAY
{
    "url": "https://files.yande.re/image/17c3abed8cd494314be5fe786d43ec13/yande.re%20444116%20amaduyu_tatsuki%20animal_ears%20kuon_%28utawarerumono%29%20nekone_%28utawarerumono%29%20seifuku%20tail%20utawarerumono%20utawarerumono_itsuwari_no_kamen.jpg",
    "name": "yande.re 444116 amaduyu_tatsuki animal_ears kuon_(utawarerumono) nekone_(utawarerumono) seifuku tail utawarerumono utawarerumono_itsuwari_no_kamen.jpg",
    "info": {
        "info": {
            "id": 444116,
            "tags": "amaduyu_tatsuki animal_ears kuon_(utawarerumono) nekone_(utawarerumono) seifuku tail utawarerumono utawarerumono_futari_no_hakuoro utawarerumono_itsuwari_no_kamen",
            "created_at": 1522675895,
            "updated_at": 1708546561,
            "creator_id": 1305,
            "approver_id": null,
            "author": "Radioactive",
            "change": 5864926,
            "source": "",
            "score": 48,
            "md5": "17c3abed8cd494314be5fe786d43ec13",
            "file_size": 3189824,
            "file_ext": "jpg",
            "file_url": "https://files.yande.re/image/17c3abed8cd494314be5fe786d43ec13/yande.re%20444116%20amaduyu_tatsuki%20animal_ears%20kuon_%28utawarerumono%29%20nekone_%28utawarerumono%29%20seifuku%20tail%20utawarerumono%20utawarerumono_itsuwari_no_kamen.jpg",
            "is_shown_in_index": true,
            "preview_url": "https://assets.yande.re/data/preview/17/c3/17c3abed8cd494314be5fe786d43ec13.jpg",
            "preview_width": 105,
            "preview_height": 150,
            "actual_preview_width": 211,
            "actual_preview_height": 300,
            "sample_url": "https://files.yande.re/sample/17c3abed8cd494314be5fe786d43ec13/yande.re%20444116%20sample%20amaduyu_tatsuki%20animal_ears%20kuon_%28utawarerumono%29%20nekone_%28utawarerumono%29%20seifuku%20tail%20utawarerumono%20utawarerumono_itsuwari_no_kamen.jpg",
            "sample_width": 1053,
            "sample_height": 1500,
            "sample_file_size": 363658,
            "jpeg_url": "https://files.yande.re/image/17c3abed8cd494314be5fe786d43ec13/yande.re%20444116%20amaduyu_tatsuki%20animal_ears%20kuon_%28utawarerumono%29%20nekone_%28utawarerumono%29%20seifuku%20tail%20utawarerumono%20utawarerumono_itsuwari_no_kamen.jpg",
            "jpeg_width": 4877,
            "jpeg_height": 6950,
            "jpeg_file_size": 0,
            "rating": "s",
            "is_rating_locked": false,
            "has_children": true,
            "parent_id": null,
            "status": "active",
            "is_pending": false,
            "width": 4877,
            "height": 6950,
            "is_held": false,
            "frames_pending_string": "",
            "frames_pending": [],
            "frames_string": "",
            "frames": [],
            "is_note_locked": false,
            "last_noted_at": 0,
            "last_commented_at": 0
        },
        "tags": [
            "amaduyu_tatsuki",
            "animal_ears",
            "kuon_(utawarerumono)",
            "nekone_(utawarerumono)",
            "seifuku",
            "tail",
            "utawarerumono",
            "utawarerumono_futari_no_hakuoro",
            "utawarerumono_itsuwari_no_kamen"
        ]
    },
    "backup_urls": []
}

With use_api set to False, its ImageInfo structure in JSON is like:

CLICK HERE TO DISPLAY
{
    "url": "https://files.yande.re/image/17c3abed8cd494314be5fe786d43ec13/yande.re%20444116%20amaduyu_tatsuki%20animal_ears%20kuon_%28utawarerumono%29%20nekone_%28utawarerumono%29%20seifuku%20tail%20utawarerumono%20utawarerumono_itsuwari_no_kamen.jpg",
    "name": "yande.re 444116 amaduyu_tatsuki animal_ears kuon_(utawarerumono) nekone_(utawarerumono) seifuku tail utawarerumono utawarerumono_itsuwari_no_kamen.jpg",
    "info": {
        "info": {
            "id": 444116,
            "tags": "amaduyu_tatsuki animal_ears kuon_(utawarerumono) nekone_(utawarerumono) seifuku tail utawarerumono utawarerumono_futari_no_hakuoro utawarerumono_itsuwari_no_kamen",
            "created_at": 1522675895,
            "updated_at": 1708546561,
            "creator_id": 1305,
            "approver_id": null,
            "author": "Radioactive",
            "change": 5864926,
            "source": "",
            "score": 48,
            "md5": "17c3abed8cd494314be5fe786d43ec13",
            "file_size": 3189824,
            "file_ext": "jpg",
            "file_url": "https://files.yande.re/image/17c3abed8cd494314be5fe786d43ec13/yande.re%20444116%20amaduyu_tatsuki%20animal_ears%20kuon_%28utawarerumono%29%20nekone_%28utawarerumono%29%20seifuku%20tail%20utawarerumono%20utawarerumono_itsuwari_no_kamen.jpg",
            "is_shown_in_index": true,
            "preview_url": "https://assets.yande.re/data/preview/17/c3/17c3abed8cd494314be5fe786d43ec13.jpg",
            "preview_width": 105,
            "preview_height": 150,
            "actual_preview_width": 211,
            "actual_preview_height": 300,
            "sample_url": "https://files.yande.re/sample/17c3abed8cd494314be5fe786d43ec13/yande.re%20444116%20sample%20amaduyu_tatsuki%20animal_ears%20kuon_%28utawarerumono%29%20nekone_%28utawarerumono%29%20seifuku%20tail%20utawarerumono%20utawarerumono_itsuwari_no_kamen.jpg",
            "sample_width": 1053,
            "sample_height": 1500,
            "sample_file_size": 363658,
            "jpeg_url": "https://files.yande.re/image/17c3abed8cd494314be5fe786d43ec13/yande.re%20444116%20amaduyu_tatsuki%20animal_ears%20kuon_%28utawarerumono%29%20nekone_%28utawarerumono%29%20seifuku%20tail%20utawarerumono%20utawarerumono_itsuwari_no_kamen.jpg",
            "jpeg_width": 4877,
            "jpeg_height": 6950,
            "jpeg_file_size": 0,
            "rating": "s",
            "is_rating_locked": false,
            "has_children": true,
            "parent_id": null,
            "status": "active",
            "is_pending": false,
            "width": 4877,
            "height": 6950,
            "is_held": false,
            "frames_pending_string": "",
            "frames_pending": [],
            "frames_string": "",
            "frames": [],
            "is_note_locked": false,
            "last_noted_at": 0,
            "last_commented_at": 0
        },
        "tags": [
            "amaduyu_tatsuki",
            "animal_ears",
            "kuon_(utawarerumono)",
            "nekone_(utawarerumono)",
            "seifuku",
            "tail",
            "utawarerumono",
            "utawarerumono_futari_no_hakuoro",
            "utawarerumono_itsuwari_no_kamen"
        ],
        "tags_class": {
            "amaduyu_tatsuki": "artist",
            "animal_ears": "general",
            "kuon_(utawarerumono)": "character",
            "nekone_(utawarerumono)": "character",
            "seifuku": "general",
            "tail": "general",
            "utawarerumono": "copyright",
            "utawarerumono_futari_no_hakuoro": "copyright",
            "utawarerumono_itsuwari_no_kamen": "copyright"
        }
    },
    "backup_urls": []
}

This example image information (Konachan ID 249445) is from this konachan.net page.

CLICK HERE TO DISPLAY
{
    "url": "https://konachan.com/image/5e19a855a70f2ebc986ee4aa745995dc/Konachan.com%20-%20249445%20autumn%20bow%20goumudan%20kuon_%28utawarerumono%29%20leaves%20long_hair%20utawarerumono%20utawarerumono_itsuwari_no_kamen%20yellow_eyes.jpg",
    "name": "Konachan.com - 249445 autumn bow goumudan kuon_(utawarerumono) leaves long_hair utawarerumono utawarerumono_itsuwari_no_kamen yellow_eyes.jpg",
    "info": {
        "info": {
            "id": 249445,
            "tags": "autumn bow goumudan kuon_(utawarerumono) leaves long_hair utawarerumono utawarerumono_itsuwari_no_kamen yellow_eyes",
            "created_at": 1504211939,
            "creator_id": 156425,
            "author": "RyuZU",
            "change": 2181553,
            "source": "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=56743404",
            "score": 61,
            "md5": "5e19a855a70f2ebc986ee4aa745995dc",
            "file_size": 1076152,
            "file_url": "https://konachan.com/image/5e19a855a70f2ebc986ee4aa745995dc/Konachan.com%20-%20249445%20autumn%20bow%20goumudan%20kuon_%28utawarerumono%29%20leaves%20long_hair%20utawarerumono%20utawarerumono_itsuwari_no_kamen%20yellow_eyes.jpg",
            "is_shown_in_index": true,
            "preview_url": "https://konachan.com/data/preview/5e/19/5e19a855a70f2ebc986ee4aa745995dc.jpg",
            "preview_width": 150,
            "preview_height": 106,
            "actual_preview_width": 300,
            "actual_preview_height": 211,
            "sample_url": "https://konachan.com/sample/5e19a855a70f2ebc986ee4aa745995dc/Konachan.com%20-%20249445%20sample.jpg",
            "sample_width": 1500,
            "sample_height": 1056,
            "sample_file_size": 834664,
            "jpeg_url": "https://konachan.com/image/5e19a855a70f2ebc986ee4aa745995dc/Konachan.com%20-%20249445%20autumn%20bow%20goumudan%20kuon_%28utawarerumono%29%20leaves%20long_hair%20utawarerumono%20utawarerumono_itsuwari_no_kamen%20yellow_eyes.jpg",
            "jpeg_width": 1800,
            "jpeg_height": 1267,
            "jpeg_file_size": 0,
            "rating": "s",
            "has_children": false,
            "parent_id": null,
            "status": "active",
            "width": 1800,
            "height": 1267,
            "is_held": false,
            "frames_pending_string": "",
            "frames_pending": [],
            "frames_string": "",
            "frames": []
        },
        "family_group": null,
        "tags": [
            "autumn",
            "bow",
            "goumudan",
            "kuon_(utawarerumono)",
            "leaves",
            "long_hair",
            "utawarerumono",
            "utawarerumono_itsuwari_no_kamen",
            "yellow_eyes"
        ],
        "tags_class": {
            "autumn": "general",
            "bow": "general",
            "goumudan": "artist",
            "kuon_(utawarerumono)": "character",
            "leaves": "general",
            "long_hair": "general",
            "utawarerumono": "copyright",
            "utawarerumono_itsuwari_no_kamen": "copyright",
            "yellow_eyes": "general"
        }
    },
    "backup_urls": [
        "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=56743404"
    ]
}

Gelbooru Tips

See also

Gelbooru’s cheatsheet

Read this page before searching in Gelbooru.

About GelbooruKeywordParser

For the meaning of parameters and attributes, check out the documentation of GelbooruKeywordParser.

Important

Currently, logic symbol OR (in standard_keyword_string) is not supported in Gelbooru.

Important

Some keywords / tags are protected by Cloudflare and thus not directly accessible by GelbooruKeywordParser. Please check out in your browser first before crawling!.

Warning

If use_api is set to True, it is required to have api_key and user_id in order to access JSON-API pages. The values can be found at the API Access Credentials column of https://gelbooru.com/index.php?page=account&s=options after logging in.

Example Program of GelbooruKeywordParser

For Gelbooru, this example will download images with keyword / tag “kuon_(utawarerumono)” and “rating:general” into the “Gelbooru” folder.

from image_crawler_utils import Downloader
from image_crawler_utils.stations.booru import GelbooruKeywordParser

parser = GelbooruKeywordParser(
    standard_keyword_string="kuon_(utawarerumono) AND rating:general",
)
image_info_list = parser.run()
downloader = Downloader(
    store_path='Gelbooru',
    image_info_list=image_info_list,
)
downloader.run()

Example ImageInfo of GelbooruKeywordParser

This example image information (Gelbooru ID 7963712) is from this Gelbooru page.

With use_api set to True, its ImageInfo structure in JSON is like:

CLICK HERE TO DISPLAY
[
    {
        "url": "https://img4.gelbooru.com/images/b6/48/b648128800c3206cd322de500058c558.jpeg",
        "name": "Gelbooru 7963712 b648128800c3206cd322de500058c558.jpeg",
        "info": {
            "info": {
                "id": 7963712,
                "created_at": "Sat Nov 26 11:08:44 -0600 2022",
                "score": 4,
                "width": 1790,
                "height": 2048,
                "md5": "b648128800c3206cd322de500058c558",
                "directory": "b6/48",
                "image": "b648128800c3206cd322de500058c558.jpeg",
                "rating": "general",
                "source": "https://twitter.com/nike_abc/status/819734442604273664/photo/1",
                "change": 1678866174,
                "owner": "angel...",
                "creator_id": 725689,
                "parent_id": 0,
                "sample": 1,
                "preview_height": 250,
                "preview_width": 218,
                "tags": "1girl animal_ears aquaplus blush bowl chewing eating festival flower flower_on_head food from_behind gradient_eyes hair_between_eyes hair_bun hair_up highres holding holding_bowl japanese_clothes kimono kuon_(utawarerumono) lily_(flower) long_hair long_sleeves looking_at_viewer multicolored_eyes nike_abc noodles raised_eyebrows sidelocks sitting solo swept_bangs udon utawarerumono utawarerumono:_itsuwari_no_kamen wide_sleeves yellow_eyes yukata",
                "title": "",
                "has_notes": "false",
                "has_comments": "false",
                "file_url": "https://img4.gelbooru.com/images/b6/48/b648128800c3206cd322de500058c558.jpeg",
                "preview_url": "https://img4.gelbooru.com/thumbnails/b6/48/thumbnail_b648128800c3206cd322de500058c558.jpg",
                "sample_url": "https://img4.gelbooru.com/samples/b6/48/sample_b648128800c3206cd322de500058c558.jpg",
                "sample_height": 973,
                "sample_width": 850,
                "status": "active",
                "post_locked": 0,
                "has_children": "false"
            },
            "family_group": null,
            "tags": [
                "1girl",
                "animal_ears",
                "aquaplus",
                "blush",
                "bowl",
                "chewing",
                "eating",
                "festival",
                "flower",
                "flower_on_head",
                "food",
                "from_behind",
                "gradient_eyes",
                "hair_between_eyes",
                "hair_bun",
                "hair_up",
                "highres",
                "holding",
                "holding_bowl",
                "japanese_clothes",
                "kimono",
                "kuon_(utawarerumono)",
                "lily_(flower)",
                "long_hair",
                "long_sleeves",
                "looking_at_viewer",
                "multicolored_eyes",
                "nike_abc",
                "noodles",
                "raised_eyebrows",
                "sidelocks",
                "sitting",
                "solo",
                "swept_bangs",
                "udon",
                "utawarerumono",
                "utawarerumono:_itsuwari_no_kamen",
                "wide_sleeves",
                "yellow_eyes",
                "yukata"
            ]
        },
        "backup_urls": [
            "https://twitter.com/nike_abc/status/819734442604273664/photo/1"
        ]
    }
]

With use_api set to False, its ImageInfo structure in JSON is like:

CLICK HERE TO DISPLAY
[
    {
        "url": "https://img4.gelbooru.com/images/b6/48/b648128800c3206cd322de500058c558.jpeg",
        "name": "Gelbooru 7963712 b648128800c3206cd322de500058c558.jpeg",
        "info": {
            "info": {
                "id": 7963712,
                "created_at": "2022-11-26 11:08:44",
                "owner": "Angel...",
                "creator_id": "725689",
                "width": 1790,
                "height": 2048,
                "source": "https://twitter.com/nike_abc/status/819734442604273664/photo/1",
                "rating": "general",
                "score": 4
            },
            "tags": [
                "nike_abc",
                "kuon_(utawarerumono)",
                "aquaplus",
                "utawarerumono",
                "utawarerumono:_itsuwari_no_kamen",
                "highres",
                "1girl",
                "animal_ears",
                "blush",
                "bowl",
                "chewing",
                "eating",
                "festival",
                "flower",
                "flower_on_head",
                "food",
                "from_behind",
                "gradient_eyes",
                "hair_between_eyes",
                "hair_bun",
                "hair_up",
                "holding",
                "holding_bowl",
                "japanese_clothes",
                "kimono",
                "lily_(flower)",
                "long_hair",
                "long_sleeves",
                "looking_at_viewer",
                "multicolored_eyes",
                "noodles",
                "raised_eyebrows",
                "sidelocks",
                "sitting",
                "solo",
                "swept_bangs",
                "udon",
                "wide_sleeves",
                "yellow_eyes",
                "yukata"
            ],
            "tags_class": {
                "nike_abc": "artist",
                "kuon_(utawarerumono)": "character",
                "aquaplus": "copyright",
                "utawarerumono": "copyright",
                "utawarerumono:_itsuwari_no_kamen": "copyright",
                "highres": "metadata",
                "1girl": "general",
                "animal_ears": "general",
                "blush": "general",
                "bowl": "general",
                "chewing": "general",
                "eating": "general",
                "festival": "general",
                "flower": "general",
                "flower_on_head": "general",
                "food": "general",
                "from_behind": "general",
                "gradient_eyes": "general",
                "hair_between_eyes": "general",
                "hair_bun": "general",
                "hair_up": "general",
                "holding": "general",
                "holding_bowl": "general",
                "japanese_clothes": "general",
                "kimono": "general",
                "lily_(flower)": "general",
                "long_hair": "general",
                "long_sleeves": "general",
                "looking_at_viewer": "general",
                "multicolored_eyes": "general",
                "noodles": "general",
                "raised_eyebrows": "general",
                "sidelocks": "general",
                "sitting": "general",
                "solo": "general",
                "swept_bangs": "general",
                "udon": "general",
                "wide_sleeves": "general",
                "yellow_eyes": "general",
                "yukata": "general"
            }
        },
        "backup_urls": [
            "https://twitter.com/nike_abc/status/819734442604273664/photo/1"
        ]
    }
]

Safebooru Tips

See also

Safebooru’s cheatsheet

Read this page before searching in Gelbooru.

About SafebooruKeywordParser

For the meaning of parameters and attributes, check out the documentation of SafebooruKeywordParser.

Example Program of SafebooruKeywordParser

For Safebooru, this example will download images with keyword / tag “kuon_(utawarerumono)” into the “Safebooru” folder.

from image_crawler_utils import Downloader
from image_crawler_utils.stations.booru import SafebooruKeywordParser

parser = SafebooruKeywordParser(
    standard_keyword_string="kuon_(utawareru_mono)",
)
image_info_list = parser.run()
downloader = Downloader(
    store_path='Safebooru',
    image_info_list=image_info_list,
)
downloader.run()

Example ImageInfo of SafebooruKeywordParser

This example image information (Safebooru ID 2193950) is from this Safebooru page. Its ImageInfo structure in JSON is like:

CLICK HERE TO DISPLAY
{
    "url": "https://safebooru.org/images/2104/de86b60fda7c55aaa6b4bc919334e83cc230a828.jpg",
    "name": "Safebooru 2193950 de86b60fda7c55aaa6b4bc919334e83cc230a828.jpg",
    "info": {
        "info": {
            "preview_url": "https://safebooru.org/thumbnails/2104/thumbnail_de86b60fda7c55aaa6b4bc919334e83cc230a828.jpg",
            "sample_url": "https://safebooru.org/samples/2104/sample_de86b60fda7c55aaa6b4bc919334e83cc230a828.jpg",
            "file_url": "https://safebooru.org/images/2104/de86b60fda7c55aaa6b4bc919334e83cc230a828.jpg",
            "directory": 2104,
            "hash": "060dc85cf55e4bc3038a778235e93601",
            "width": 1124,
            "height": 1754,
            "id": 2193950,
            "image": "de86b60fda7c55aaa6b4bc919334e83cc230a828.jpg",
            "change": 1491160788,
            "owner": "gelbooru",
            "parent_id": 0,
            "rating": "safe",
            "sample": true,
            "sample_height": 1326,
            "sample_width": 850,
            "score": 1,
            "tags": "1girl amazuyu_tatsuki animal_ears arm_up arms_up blue_hair boots breasts brown_eyes cat_ears cat_tail cherry_blossoms dagger eyebrows_visible_through_hair hair_ornament highres japanese_clothes kuon_(utawareru_mono) looking_at_viewer medium_breasts obi open_mouth outdoors petals sash scarf side_slit solo sunlight tail utawareru_mono utawareru_mono:_itsuwari_no_kamen weapon wide_sleeves",
            "source": "うたわれるもの 偽りの仮面/二人の白皇 公式ビジュアルコレクション",
            "status": "active",
            "has_notes": false,
            "comment_count": 0
        },
        "family_group": null,
        "tags": [
            "1girl",
            "amazuyu_tatsuki",
            "animal_ears",
            "arm_up",
            "arms_up",
            "blue_hair",
            "boots",
            "breasts",
            "brown_eyes",
            "cat_ears",
            "cat_tail",
            "cherry_blossoms",
            "dagger",
            "eyebrows_visible_through_hair",
            "hair_ornament",
            "highres",
            "japanese_clothes",
            "kuon_(utawareru_mono)",
            "looking_at_viewer",
            "medium_breasts",
            "obi",
            "open_mouth",
            "outdoors",
            "petals",
            "sash",
            "scarf",
            "side_slit",
            "solo",
            "sunlight",
            "tail",
            "utawareru_mono",
            "utawareru_mono:_itsuwari_no_kamen",
            "weapon",
            "wide_sleeves"
        ]
    },
    "backup_urls": []
}