Export your BlueSky likes to you local Shimmie2 or Danbooru instance.
Supports images, reposted images and videos through yt-dlp. Post author will be added as artist:bsky-handle tag and text will be analyzed for any # words and add it as tags (Japanese characters are supported). An extra bluesky tag will be added.
I recommend creating special account in your Shimmie for this purpose, so in a case you need to re-run, you can delete that account will all images.
- BlueSky account.
- PostgreSQL running on the network.
- Shimmie2 or Danbooru running on the network (Danbooru hasn't been tested, but Shimmie Danbooru 1.0 API plugin).
- If using Shimmie2, make sure that
Danbooru Client APIextension is enabled.
If you don't have pnpm installed (pnpm --version) you can install it here.
After pulling this repository:
pnpm i && pnpm buildMake your own .env file from the template.
cp .env.template .env
vim .envDATABASE_URL- Connection string to PostreSQL database (feel free to use Shimmie DB, this script will only add one table).BSKY_USERNAME- Your BlueSky username.BSKY_PASSWORD- Bluesky App password (get it here).BSKY_PAGE_DELAY- Delay (in ms) between page requests from bsky API.SHIMMIE_API_URL- API URL for image upload.SHIMMIE_USERNAME- Image upload username.SHIMMIE_API_KEY- Image upload key/password.SCAN_ALL- Determines if the script will continue scanning likes after encountering a familiar one. Leave it at1for now.YTDLPATH- (optional) You may specify path to the yt-dlp binary for video downloads. Otherwise the latest release will be downloaded automatically.
Run with:
pnpm startThe script will slowly go through all your likes and import them into Shimmie. It will log BlueSky URI of the post and any tags it found. In case of error, the script will log it and continue.
If you are getting EACCES when spawning yt-dlp, make sure that it has correct permissions:
sudo chmod a+rx ./yt-dlpAfter importing all your likes, switch SCAN_ALL flag to 0 and schedule to run this script using Cron.
Here is my configuration (every 6h):
0 */6 * * * cd /home/noxc/bsky2booru && /home/noxc/.local/share/pnpm/pnpm start >> ./crontab.log 2>&1If you ancounter issues with PATH, add it before any Cron entries, e.g.:
PATH=/home/noxc/.local/share/pnpm