Sync your favorites on moebooru websites to your own danbooru website. 同步你在 moebooru 网站上的收藏到你自己的 danbooru 网站。
Incrementally sync your favorites on moebooru websites to your own danbooru website.
In this repo, moebooru typically means konachan.com and yande.re.
moebooru konachan.com yande.re
As computer nerds and anime/manga art lovers, everyone wants their favorite images on moebooru to be stored locally, so that we can appreciate them later. However, if you just download them to you hard drive, there are no longer tags (a big feature in image boards like moebooru) holding the images together. With no tags, you will have a hard time finding related images by tags. Also, viewing the large original files is a suboptimal experience, especially for mobile devices.
Even when you try to use some photo-management software to organize the images (e.g. use Apple Photos and AppleScript to automate image-tagging), tagging all those images is still a pain in the ass, let alone the experience is still behind *booru for this purpose.
Why not self-hosting a danbooru instance and use this script to sync your favorite images on moebooru to your own website! You will have the same experience as moebooru websites with all the advantages of self-hosted websites. (since moebooru is a fork from danbooru, they are similar.)
anime/manga moebooru ~~~~~~~~~~~~ tag moebooru image boards tag tag ~~//~~
Apple Photos AppleScript ~~~~ *booru
danbooru moebooru moebooru moebooru danbooru fork
This script will first download the original images and metadata of your favorites posts from moebooru. Then it will create posts on your danbooru instance with the downloaded image and metadata.
moebooru danbooru posts
Since there is no direct access to moebooru websites like konachan.com or yande.re in my country, the script will download the images first (proxy configurable) and then upload them to self-host danbooru instance. Otherwise the self-hosted danbooru instance is able to directly fetch them (although the danbooru instance is able to use a proxy).
konachan.com yande.re danbooru danbooru
Screenshot of a self-hosting danbooru instance, with metadata of posts synced (see todo for supported metadata):
danbooru todo
Make sure GNU make
, curl
, wget
, node
, and yarn
are installed. Steps below are based on a unix-like OS. If you are using Windows, try WSL.
GNU make
, curl
, wget
, node
yarn
Unix Windows WSL
If it is your first time running this script, run yarn install
to install dependencies. yarn install
Prepare environment variables
MOEBOORU_USERNAME
: your username on moebooru
export MOEBOORU_USERNAME=username
MOEBOORU_HOST
: moebooru host, e.g. https://konachan.com
(don't forget http/https)
export MOEBOORU_HOST=https://konachan.com
DANBOORU_HOST
: your self-hosted danbooru, e.g. https://danbooru.example.com
(don't forget http/https)
export DANBOORU_HOST=https://konachan.com
DANBOORU_HOST=https://konachan.com
in a .env
file at repo rootDANBOORU_USERNAME
: username of your self-hosted danbooru account
export DANBOORU_USERNAME=username
DANBOORU_USERNAME=username
in a .env
file at repo rootDANBOORU_APIKEY
: api key of your self-hosted danbooru account (you can create one from account profile page)
export DANBOORU_APIKEY=key
DANBOORU_APIKEY=key
in a .env
file at repo rootPROXY
: proxy to use when accessing moebooru websites (because there is no direct access in my country), e.g. http://127.0.0.1:9999
export PROXY=http://yourproxy:1234
IMAGE_DIR
: path to directory, where to store downloaded images
~/Pictures/${MOEBOORU_HOSTNAME}
. For example, if you set MOEBOORU_HOST
as https://konachan.com
, then IMAGE_DIR
will be ~/Pictures/konachan.com
export IMAGE_DIR=./your-dir
Start syncing
make get_favorites_and_sync_to_danbooru
to download and sync your favorites to self-hosted danbooru incrementally (tags will also be synced).make get-and-update-tags-all
to sync tag metadata from moebooru to self-hosted danbooru. Since this is about tag metadata, not the tags of an image, you don't need to run this frequently (typically they won't change).Makefile
to see what they do.