#api-client #tmdb #movie

tmdb-api

Yet another TMDB client. This one is using async methods.

20 releases (7 breaking)

0.8.0 Mar 26, 2024
0.6.0 Jan 21, 2024
0.5.2 Nov 28, 2023
0.5.0 Jul 26, 2023
0.3.3 Oct 26, 2022

#48 in Video

Download history 2/week @ 2024-01-03 1/week @ 2024-01-17 8/week @ 2024-01-24 2/week @ 2024-02-14 10/week @ 2024-02-21 26/week @ 2024-02-28 16/week @ 2024-03-06 19/week @ 2024-03-13 80/week @ 2024-03-20 51/week @ 2024-03-27 43/week @ 2024-04-03 345/week @ 2024-04-10

521 downloads per month
Used in movie-rename

MIT license

1.5MB
6K SLoC

Rust client for The Movie DB API

This is yet another client for TMDB, but it supports async functions.

Installing

cargo add tmdb-api

Usage

use tmdb_api::tvshow::search::TVShowSearch;
use tmdb_api::prelude::Command;
use tmdb_api::client::Client;
use tmdb_api::client::reqwest::ReqwestExecutor;

#[tokio::main]
async fn main() {
    let secret = std::env::var("TMDB_TOKEN_V3").unwrap();
    let client = Client::<ReqwestExecutor>::new(secret);
    let cmd = TVShowSearch::new("simpsons".into());

    let result = cmd.execute(&client).await.unwrap();
    let item = result.results.first().unwrap();
    println!("TVShow found: {}", item.inner.name);
}

Features

Running the tests

cargo test

If you want to run some integration tests, just export a TMDB_TOKEN_V3 environment variable and run

cargo test --features integration

lib.rs:

Another implementation of a client for the TMDB API

It provides a support for async and implements each command using the Command pattern.

Dependencies

~1–15MB
~162K SLoC