metafilm
?
What is Getting metadata information about films and TV shows (title, actors, genres, etc.) from IMDb, TMDb, Kinopoisk, Douban
Installation
npm i metafilm
Usage
Import the library in your code:
const metafilm = ;
IMDb
- Movie from
imdb.com
metafilmidimdb_id: '6146586'; // alternative (use string ID '6146586' or 'tt6146586' or 'imdb6146586') metafilmid'6146586';
- Movie from
omdbapi.com
(get apikey)
metafilmidimdb_id: '5884052' imdb_key: 'apikey'; // alternative (use string ID '5884052' or 'tt5884052' or 'imdb5884052') metafilmid'tt5884052' null 'apikey';
- TV Series from
imdb.com
metafilmidimdb_id: '9561862' season: 1; // alternative (use string ID '9561862' or 'tt9561862' or 'imdb9561862') metafilmid'imdb9561862' '1';
- TV Series from
omdbapi.com
(get apikey)
metafilmidimdb_id: '9253866' season: '1' imdb_key: 'apikey'; // alternative (use string ID '9253866' or 'tt9253866' or 'imdb9253866') metafilmid'9253866' 1 'apikey';
TMDb
- Movie from
themoviedb.org
(get api_key)
metafilmidtmdb_id: '299534' tmdb_key: 'api_key'; // alternative (use integer ID 299534 or string ID 'tmdb299534') metafilmid299534 null 'api_key';
- TV Series from
themoviedb.org
(get api_key)
metafilmidtmdb_id: '82883' season: 1 tmdb_key: 'api_key'; // alternative (use integer ID 82883 or string ID 'tmdb82883') metafilmid'tmdb82883' 1 'api_key';
Douban
- Movie/TV Series from
movie.douban.com
metafilmiddouban_id: '26662282'; // alternative (use string ID 'douban26662282') metafilmid'douban26662282';
Kinopoisk
- Movie/TV Series from
kinopoisk.ru
It is recommended to use the
cookie
setting, otherwise your requests may be blocked.
metafilmidkp_id: '1047883'; // alternative (use string ID 'kp1047883') metafilmid'kp1047883';
From all sources
- Movie/TV Series from
imdb.com
,omdbapi.com
,themoviedb.org
,kinopoisk.ru
metafilmid "imdb_id": "0944947" "tmdb_id": 1399 "douban_id": 26584183 "kp_id": "464963" "season": 78 "tmdb_key": "e547e17d4e91c3e62a571656cd1ccaff" "imdb_key": "966f4f4f";
Output data
- shortened output (more actors, translations, episodes)
How to get genres and countries?
npm i colage
const colage = ; let en_countries = colage;console; //=> [ 'Russia', 'Germany', 'China' ] let en_languages = colage;console; //=> [ 'Russian', 'German', 'Chinese' ] let en_genres = colage;console; //=> [ 'comedy', 'musical', 'action' ]
API
metafilm.id(id, [season], [key])
id
Type: Object|String|Number
Example:
How to use cookie?
- Install Chrome extensions EditThisCookie
- Log in with your username on the website (
imdb
,douban
,kp
) - Click on the cookie icon, then
Export
- Insert an array of data in the field
{cookie:{website:[cookie]}}
season
Type: String|Number|Array
Required to determine the series (season specified) or movie (season not specified).
Example: '3'
,'3,4,5'
,6
,[7]
,[8,9]
key
Type: String
Required to receive data from TMDb and OMDb.
Example: 'e547e17d4e91c3e62a571656cd1ccaff'
,'966f4f4f'
Running tests
npm test