Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

168 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pvg-rs

Build

Explore, filter, and download artworks from your pixiv bookmarks.

Features

  • Sync with your pixiv bookmarks incrementally
  • Find or exclude bookmarked artworks by tags, title, or author
  • Parallel and reliable download of bookmarked artworks
  • Local and remote access via a responsive Web UI
  • Cross-platform (Windows, Linux, and Android via Termux are tested)

Highlights

  • Custom FTS engine with FM-Index and incremental LSM for instant multi-keyword querying
    • Suffix-based indexing for accurate substring search in CJK titles and tags
    • Optimized with square-root decomposed bitmaps and query planner to achieve <1ms latency on 100K+ collections
  • Robust and efficient download manager with asynchronous I/O and file transactions for data integrity
  • Minimal resource usage for local-first experience on resource-constrained devices

Screenshot

Screenshot

Getting Started

  • Download and extract the latest Release for your platform
  • Retrieve your pixiv refresh_token
  • Create a config.json file in the extracted directory
    • A minimal example:
      {
        "username": "<your pixiv username>",
        "refresh_token": "<your refresh token>"
      }
  • Run pvg or pvg.exe to start the server
  • Open the URL shown in the terminal (Ctrl-click) in your browser

Configuration

The following options can be specified in config.json:

  • username: Your pixiv username (required)
  • refresh_token: Your pixiv refresh token
    • PIXIV_REFRESH_TOKEN environment variable takes precedence. Either must present.
  • port: Port to listen on (default: 5678)
  • host: Interface to listen on (default: "127.0.0.1")
    • Specify a LAN address or "0.0.0.0" to allow access from network
  • proxy: Proxy to use for network requests
    • Example: "http://127.0.0.1:8080"
  • safe_mode: Turn on to show only illustions with a safe sanity_level (default: false)
  • bookmark: Turn on to serve POST /bookmark (default: false)
  • home: Path to the directory to store data and index (default: .)
    • Downloaded artworks are saved in <home>/pix

Bookmarking from a client

With bookmark on, POST /bookmark takes {"id": <illust id>} and bookmarks that illust on pixiv under the configured account, public restrict, whether or not the archive knows it. The archive picks it up on the next incremental update. An illust already in the index is one pixiv already has bookmarked, so it answers from the index and calls no API. A pixiv rejection (a rate limit, an expired token, an unknown id) comes back as a 500 whose body names pixiv's status and its message, read out of the JSON envelope pixiv wraps it in, for the client to show as text.

This is the only route that writes to the pixiv account, so a server reachable beyond 127.0.0.1 offers that write to everyone who can reach it. Turn it on only where that is intended; with it off the route does not exist.

Build

$ cargo build --release

Credits

The usage of pixiv AAPI refers to the following projects:

About

Fast, local-first pixiv bookmark explorer.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages