Code Monkey home page Code Monkey logo

booru-rs's Introduction

ci-badge crates.io version

booru-rs

An async Booru client for Rust

Overview

The client currently supports:

  • Gelbooru
  • Safebooru
  • Danbooru
  • Konachan
  • R34
  • 3DBooru
  • More... ?

Example

Remember to bring the Client trait into scope with use booru_rs::client::Client;

let posts = GelbooruClient::builder()
    .tag("kafuu_chino")
    .tag("2girls")
    .rating(GelbooruRating::General)
    .sort(GelbooruSort::Score)
    .limit(5)
    .random(true)
    .blacklist_tag(GelbooruRating::Explicit)
    .build()
    .get()
    .await
    .expect("There was an error retrieving posts from the API");

booru-rs's People

Contributors

54n17y avatar ajiiisai avatar nachtalb avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

booru-rs's Issues

Missing traits on danbooru client builder

I downloaded this lib to try it out but i found something that wasn't working as it should be...
image
DanbooruClient does not implement BooruClient and DanbooruClientBuilder does not implement BooruBuilder

use rustls for reqwest instead of native TLS

Reqwest is the only dependency to use the system's TLS which can be a problem when doing cross-compilation as it is dynamically linked.

This issue can be resolved however by changing the following line in the Cargo.toml

reqwest = { version = "0.11.12", features = ["json"] }

to

reqwest = { version = "0.11.12", features = ["json", "rustls-tls"], default-features = false }

Doing this solved my issue as reqwest is the only library still not to use rustls by default in my project, although I would highly recommend you look through the other default features to see which ones you do need.

This change doesn't change any of the functionality your library is currently using so it'd be great to either have this by default or behind a feature flag people can enable.

Danbooru API implementation is not working

When I try to do any kind of request to danbooru API I get an 403 error. After some investigation I discovered that it happens because Cloudflare has started serving up an anti-bot challenge page which obviously blocks programmatic API access. Can you implement solution for this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.