#api-client #tmdb #client #api-bindings #api

tmdb_client

Rust 版 The Movie Database (TMDB) API 客户端

18 个版本 (稳定)

1.6.0 2020年2月24日
1.5.4 2020年2月14日
1.5.3 2019年11月12日
1.4.2 2019年10月29日
0.1.1 2019年6月25日

#3 in #tmdb

每月下载量 47

MIT 许可证

385KB
7.5K SLoC

Rust 版 The Movie Database (TMDB) API 客户端

概述

此 API 客户端由 OpenAPI Generator 项目生成,使用自定义的 tmdb_oas.json OAS 文件。

  • API 版本:3
  • 包版本:1.6.0
  • 构建包:org.openapitools.codegen.languages.RustClientCodegen

功能

  • 几乎支持所有 API 功能。
  • 从 1.5.0 版本开始,库提供辅助函数以从 每日导出 下载和解析 TMDB ID。
  • 从 1.6.0 版本开始,移除了速率限制器,因为 TMDB 不再有限制速率

已知问题

  • 尚未测试所有 API 功能。由于用于生成的 OAS 文件不是官方的,可能存在缺失的字段。
  • 生成的代码不够流畅。调用函数时需要所有 API 参数。
  • 速率限制器可以更智能,并使用响应头。

安装

将以下内容添加到 Cargo.toml 中的 [dependencies]

tmdb_client = "1.6.0"

用法示例

use tmdb_client::apis::Error;
use tmdb_client::apis::client::APIClient;
use tmdb_client::models::MoviePaginated;

fn search_movie() -> Result<MoviePaginated, Error> {
    let client = APIClient::new_with_api_key("###TMDB_API_KEY###");
    // Parameters: title, year, primary_release_year, language, page, include_adult, region
    client.search_api().get_search_movie_paginated("Movie title", None, None, None, None, None, None)
}

API 端点文档

所有 URI 都相对于 https://api.themoviedb.org/3

方法 HTTP 请求 描述
AccountApi get_account_favorite_movies_paginated get /account/{account_id}/favorite/movies 获取喜欢的电影
AccountApi get_account_favorite_tv_paginated get /account/{account_id}/favorite/tv 获取喜欢的电视剧
AccountApi get_account_rated_movies_paginated get /account/{account_id}/rated/movies 获取评分电影
AccountApi get_account_rated_tv_episodes_paginated get /account/{account_id}/rated/tv/episodes 获取评分电视剧集
AccountApi get_account_rated_tv_paginated get /account/{account_id}/rated/tv 获取评分电视剧
AccountApi get_account_watchlist_movies_paginated get /account/{account_id}/watchlist/movies 获取电影观看列表
AccountApi get_account_watchlist_tv_paginated get /account/{account_id}/watchlist/tv 获取电视剧观看列表
AccountApi 获取当前账户详细信息 GET /account 获取详情
AccountApi get_current_account_lists_paginated GET /account/{account_id}/lists 获取创建的列表
AccountApi post_account_favorite POST /account/{account_id}/favorite 标记为收藏
AccountApi post_account_watchlist POST /account/{account_id}/watchlist 添加到观看列表
AuthenticationApi delete_authentication_session DELETE /authentication/session 删除会话
AuthenticationApi get_new_authentication_guest_session GET /authentication/guest_session/new 创建访客会话
AuthenticationApi get_new_authentication_session GET /authentication/session/new 创建会话
AuthenticationApi get_new_authentication_token GET /authentication/token/new 创建请求令牌
AuthenticationApi get_validate_authentication_token_with_login GET /authentication/token/validate_with_login 验证请求令牌
AuthenticationApi post_authentication_session_convert4 POST /authentication/session/convert/4 从v4访问令牌创建会话
CertificationsApi get_movie_certifications_list GET /certification/movie/list 获取电影认证
CertificationsApi get_tv_certifications_list GET /certification/tv/list 获取电视认证
ChangesApi get_movie_changes_paginated GET /movie/changes 获取电影变更列表
ChangesApi get_person_changes_paginated GET /person/changes 获取人物变更列表
ChangesApi get_tv_changes_paginated GET /tv/changes 获取电视变更列表
CollectionsApi get_collection_details GET /collection/{collection_id} 获取详情
CollectionsApi get_collection_images_list GET /collection/{collection_id}/images 获取图片
CollectionsApi get_collection_translations_list GET /collection/{collection_id}/translations 获取翻译
CompaniesApi get_company_details GET /company/{company_id} 获取详情
CompaniesApi get_company_images GET /company/{company_id}/images 获取图片
CompaniesApi get_company_movies_paginated GET /company/{company_id}/movies 获取电影
ConfigurationApi get_configuration GET /configuration 获取API配置
ConfigurationApi get_countries_list GET /configuration/countries 获取国家
ConfigurationApi get_jobs_list GET /configuration/jobs 获取工作
ConfigurationApi get_languages_list GET /configuration/languages 获取语言
ConfigurationApi get_primary_translations_list GET /configuration/primary_translations 获取主翻译
ConfigurationApi get_timezones_list GET /configuration/timezones 获取列表
CreditsApi get_credit_details GET /credit/{credit_id} 获取详情
DiscoverApi get_discover_movie_paginated GET /discover/movie 电影发现
DiscoverApi get_discover_tv_paginated GET /discover/tv 电视发现
FindApi get_find_external_id GET /find/{external_id} 通过ID查找
GenresApi get_all_movie_genres_list GET /genre/movie/list 获取电影列表
GenresApi get_all_tv_genres_list GET /genre/tv/list 获取电视列表
GenresApi get_movies_by_genre_paginated GET /genre/{genre_id}/movies 获取电影
GuestSessionsApi get_guest_session_rated_movies_paginated GET /guest_session/{guest_session_id}/rated/movies 获取评分电影
GuestSessionsApi get_guest_session_rated_tv_episodes_paginated GET /guest_session/{guest_session_id}/rated/tv/episodes 获取评分电视剧集
GuestSessionsApi get_guest_session_rated_tv_paginated GET /guest_session/{guest_session_id}/rated/tv 获取评分电视剧
KeywordsApi get_keyword_details GET /keyword/{keyword_id} 获取详情
KeywordsApi get_movies_by_keyword_paginated GET /keyword/{keyword_id}/movies 获取电影
ListsApi delete_list DELETE /list/{list_id} 删除列表
ListsApi get_list_details GET /list/{list_id} 获取详情
ListsApi get_list_item_status GET /list/{list_id}/item_status 检查项目状态
ListsApi post_list POST /list 创建列表
ListsApi post_list_add_item POST /list/{list_id}/add_item 添加电影
ListsApi post_list_clear POST /list/{list_id}/clear 清空列表
ListsApi post_list_remove_item POST /list/{list_id}/remove_item 删除电影
电影API delete_movie_rating delete /movie/{movie_id}/rating 删除评分
电影API get_movie_account_states get /movie/{movie_id}/account_states 获取账户状态
电影API get_movie_alternative_titles_list get /movie/{movie_id}/alternative_titles 获取替代标题
电影API get_movie_changes_list get /movie/{movie_id}/changes 获取更改
电影API get_movie_credits get /movie/{movie_id}/credits 获取荣誉
电影API get_movie_details get /movie/{movie_id} 获取详情
电影API get_movie_external_ids get /movie/{movie_id}/external_ids 获取外部ID
电影API get_movie_images get /movie/{movie_id}/images 获取图片
电影API 获取电影图片 get_movie_keywords_list get /movie/{movie_id}/keywords
电影API 获取关键词 get_movie_latest_details get /movie/latest
电影API 获取最新详情 get_movie_lists_paginated get /movie/{movie_id}/lists
电影API 获取列表 get_movie_now_playing_paginated get /movie/now_playing
电影API 获取正在上映 get_movie_popular_paginated get /movie/popular
电影API 获取热门 get_movie_recommendations_paginated get /movie/{movie_id}/recommendations
电影API 获取推荐 get_movie_release_dates get /movie/{movie_id}/release_dates
电影API 获取上映日期 get_movie_reviews_paginated get /movie/{movie_id}/reviews
电影API 获取评论 get_movie_similar_paginated get /movie/{movie_id}/similar
电影API 获取相似电影 get_movie_top_rated_paginated get /movie/top_rated
电影API 获取评分最高的 get_movie_translations_list 获取翻译
电影API get /movie/{movie_id}/translations 获取翻译 get_movie_upcoming_paginated
电影API get /movie/upcoming 获取即将上映 get_movie_videos_list
电影API get /movie/{movie_id}/videos 获取视频 post_movie_rating
post /movie/{movie_id}/rating 评分电影 NetworksApi get_network_alternative_names_list
post /movie/{movie_id}/rating get /network/{network_id}/alternative_names 获取替代名称 获取详情
post /movie/{movie_id}/rating get_network_details get /network/{network_id} 获取图片
get_network_images get /network/{network_id}/images PeopleApi 获取外部ID
get_network_images get_external_ids get /person/{person_id}/external_ids 获取更改
get_network_images get_person_changes get /person/{person_id}/changes get_person_combined_credits
get_network_images get /person/{person_id}/combined_credits 获取综合荣誉 获取详情
get_network_images get_person_details get /person/{person_id} 获取图片
get_network_images get_person_images_list get /person/{person_id}/images get /movie/latest
get_network_images get_person_latest_details get /person/latest get_person_movie_credits
get_network_images get /person/{person_id}/movie_credits 获取电影荣誉 get /movie/popular
get_network_images get_person_popular_paginated get /person/popular get_person_tagged_images_paginated
get_network_images get /person/{person_id}/tagged_images 获取标记图片 获取翻译
get_network_images get_person_translations_list get /person/{person_id}/translations get_person_tv_credits
get /person/{person_id}/tv_credits 获取电视荣誉 ReviewsApi 获取详情
get_review_details get /review/{review_id} SearchApi get_search_collection_paginated
get_review_details get /search/collection 搜索收藏 get_search_company_paginated
get_review_details get /search/company 搜索公司 get_search_keyword_paginated
get_review_details get /search/keyword 搜索关键词 get_search_movie_paginated
get_review_details get /search/movie 搜索电影 get_search_multi_paginated
get_review_details get /search/multi 多搜索 get_search_person_paginated
get_review_details get /search/person 搜索人物 get_search_tv_paginated
get /search/tv 搜索电视节目 TVApi 删除评分
get /search/tv delete_tv_rating delete /tv/{tv_id}/rating 获取账户状态
get /search/tv get_tv_account_states get /tv/{tv_id}/account_states get_tv_airing_today_paginated
get /search/tv get /tv/airing_today 获取今日播出 获取替代标题
get /search/tv get_tv_alternative_titles_list get /tv/{tv_id}/alternative_titles 获取更改
get /search/tv get_tv_changes get /tv/{tv_id}/content_ratings 获取内容评级
get /search/tv get_tv_credits get /tv/{tv_id}/credits 获取荣誉
get /search/tv get_tv_details get /tv/{tv_id} 获取详情
get /search/tv get_tv_episode_groups get /tv/{tv_id}/episode_groups 获取剧集组
get /search/tv get_tv_external_ids get /tv/{tv_id}/external_ids 获取外部ID
get /search/tv get_tv_images get /tv/{tv_id}/images 获取图片
get /search/tv get_tv_keywords_list get /tv/{tv_id}/keywords get /movie/{movie_id}/keywords
get /search/tv get_tv_latest_details get /tv/latest get /movie/latest
get /search/tv get_tv_on_the_air_paginated get /tv/on_the_air 获取正在播出的电视剧
get /search/tv get_tv_popular_paginated get /tv/popular get /movie/popular
get /search/tv get_tv_recommendations_paginated get /tv/{tv_id}/recommendations get /movie/{movie_id}/recommendations
get /search/tv get_tv_screened_theatrically get /tv/{tv_id}/screened_theatrically 获取电影院放映
get /search/tv get_tv_similar_paginated get /tv/{tv_id}/similar 获取类似电视剧
get /search/tv get_tv_top_rated_paginated get /tv/top_rated get /movie/top_rated
get /search/tv get_tv_translations_list get /tv/{tv_id}/translations 获取翻译
get /search/tv get_tv_videos_list get /tv/{tv_id}/videos get_movie_videos_list
get /search/tv post_tv_rating post /tv/{tv_id}/rating 评分电视剧
TVEpisodeGroupsApi get_episode_group_details get /tv/episode_group/{episode_group_id} 获取详情
TVEpisodesApi delete_tv_season_episode_rating delete /tv/{tv_id}/season/{season_number}/episode/{episode_number}/rating 删除评分
TVEpisodesApi get_tv_episode_changes get /tv/episode/{episode_id}/changes 获取更改
TVEpisodesApi get_tv_season_episode_account_states get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/account_states 获取账户状态
TVEpisodesApi get_tv_season_episode_credits get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/credits 获取荣誉
TVEpisodesApi get_tv_season_episode_details get /tv/{tv_id}/season/{season_number}/episode/{episode_number} 获取详情
TVEpisodesApi get_tv_season_episode_external_ids get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/external_ids 获取电视剧集外部ID
TVEpisodesApi get_tv_season_episode_images get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/images 获取图片
TVEpisodesApi get_tv_season_episode_translations_list get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/translations 获取翻译
TVEpisodesApi get_tv_season_episode_videos_list get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/videos get_movie_videos_list
TVEpisodesApi post_tv_season_episode_rating post /tv/{tv_id}/season/{season_number}/episode/{episode_number}/rating 评分电视剧集
TVSeasonsApi get_tv_season_account_states get /tv/{tv_id}/season/{season_number}/account_states 获取账户状态
TVSeasonsApi get_tv_season_changes get /tv/season/{season_id}/changes 获取更改
TVSeasonsApi get_tv_season_credits get /tv/{tv_id}/season/{season_number}/credits 获取荣誉
TVSeasonsApi get_tv_season_details get /tv/{tv_id}/season/{season_number} 获取详情
TVSeasonsApi get_tv_season_external_ids get /tv/{tv_id}/season/{season_number}/external_ids 获取外部ID
TVSeasonsApi get_tv_season_images get /tv/{tv_id}/season/{season_number}/images 获取图片
TVSeasonsApi get_tv_season_videos get /tv/{tv_id}/season/{season_number}/videos get_movie_videos_list
TrendingApi get_trending_paginated get /trending/{media_type}/{time_window} 获取趋势

模型文档

要获取生成的文档,请使用

cargo doc --open

作者

依赖关系

~21MB
~444K SLoC