Skip to content

Export your BlueSky likes to you local Shimmie2 or Danbooru instance

Notifications You must be signed in to change notification settings

madebynoxc/bsky2booru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Export your BlueSky likes to you local Shimmie2 or Danbooru instance. Supports images, reposted images and video thumbnails. 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.

Requirements

  • BlueSky account.
  • PostgreSQL running on the network.
  • Shimmie2 or Danbooru running on the network (Danbooru hasn't been tested, but Shimmie uses the same API).
  • If using Shimmie2, make sure that Danbooru Client API extension is enabled.

First run

If you don't have pnpm installed (pnpm --version) you can install it here.

After pulling this repository:

pnpm i && pnpm build

Make your own .env file from the template.

cp .env.template .env
vim .env
  • DATABASE_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 at 1 for now.

Run with:

pnpm start

The 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.

Scheduled run

After 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>&1

About

Export your BlueSky likes to you local Shimmie2 or Danbooru instance

Topics

Resources

Stars

Watchers

Forks