10 releases

0.2.0 Dec 23, 2024
0.1.8 Sep 26, 2023
0.1.6 Aug 27, 2023
0.1.2 Jul 9, 2023
0.1.1 May 28, 2023

#1162 in Web programming

Download history 8/week @ 2024-09-25 1/week @ 2024-10-30 7/week @ 2024-12-04 12/week @ 2024-12-11 97/week @ 2024-12-18 26/week @ 2024-12-25 7/week @ 2025-01-08

130 downloads per month

MIT license

89KB
2.5K SLoC

dlsite-rs

This is a library to get information about products on DLsite. Some information is not available on the HTML page, so this library also makes requests to the AJAX API.

NOTE: This library is still wip, and the API may change. Also, only the parts I needed are implemented, so there are many unimplemented parts.

Features

  • Get product information by scraping html and using ajax api for web.
    • Basic information
    • Additional information
  • Get product review
  • Get product information using api.
  • Search product
  • Get circle info
    • Get circle product list
    • Get circle sale list
  • Login and user related feature
  • Get ranking

Example

  • Get product by api
use dlsite::{DlsiteClient, product::Product};
use tokio;
#[tokio::main]
async fn main() {
    let client = DlsiteClient::default();
    let product = client.get_product_api("RJ01014447").await.unwrap();
    assert_eq!(product.creators.unwrap().voice_by.unwrap()[0].name, "佐倉綾音");
}
  • Search products
use dlsite::{DlsiteClient, product::Product, search::options::*};
use tokio;
#[tokio::main]
async fn main() {
    let client = DlsiteClient::default();
    let product = client
        .search_product(&ProductSearchOptions {
            sex_category: Some(vec![SexCategory::Male]),
            keyword: Some("ASMR".to_string()),
            ..Default::default()
        })
        .await
        .expect("Failed to search");
    dbg!(&product);
}

Dependencies

~13–26MB
~376K SLoC