IMDB Crawler
A node library to get Movie and Tv Series info from IMDB and returns collected data as a json
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
Nodejs, Npm
Installing
npm i hi-imdb-crawler
Options
Default options
'movie': 'imdb_id': 'container': "meta[property='pageId']" 'attr' : "content" 'type' : "String" 'name': 'container': ".title_wrapper > h1[itemprop='name']" 'attr': false 'type': 'String' 'directors': 'container': "span[itemprop='director'] > a > span[itemprop='name']" 'attr': false 'type': 'String|Array' 'creators': 'container': "span[itemprop='creator'] > a > span[itemprop='name']" 'attr': false 'type': 'String|Array' 'description': 'container': ".summary_text" 'attr': false 'type': 'String' 'original_title': 'container': ".originalTitle" 'attr': false 'type': 'String' 'duration': 'container': ".title_wrapper .subtext time[itemprop='duration']" 'attr': false 'type': 'String' 'rating': 'container': "span[itemprop='ratingValue']" 'attr': false 'type': 'String|Float' 'image': 'container': "meta[property='og:image']" 'attr': 'content' 'type': 'Image' 'genres': 'container': "div[itemprop='genre'] a" 'attr': false 'type': 'String|Array' 'series': 'imdb_id': 'container': "meta[property='pageId']" 'attr' : "content" 'type' : "String" 'name': 'container': ".title_wrapper > h1[itemprop='name']" 'attr': false 'type': 'String' 'creators': 'container': "span[itemprop='creator'] > a > span[itemprop='name']" 'attr': false 'type': 'String|Array' 'description': 'container': ".summary_text" 'attr': false 'type': 'String' 'original_title': 'container': ".originalTitle" 'attr': false 'type': 'String' 'duration': 'container': ".title_wrapper .subtext time[itemprop='duration']" 'attr': false 'type': 'String' 'rating': 'container': "span[itemprop='ratingValue']" 'attr': false 'type': 'String|Float' 'image': 'container': "meta[property='og:image']" 'attr': 'content' 'type': 'Image' 'genres': 'container': "div[itemprop='genre'] a" 'attr': false 'type': 'String|Array' 'seasons': 'name': 'container': "div.seasons-and-year-nav div>a[href*='?season=']" 'attr': false 'type': 'String' 'episode_url': 'container': "div.list.detail.eplist > .list_item a[itemprop='name'] " 'attr': 'href' 'type': 'String' 'episodes': 'imdb_id': 'container': "meta[property='pageId']" 'attr' : "content" 'type' : "String" 'season': 'container': "div.bp_item > .bp_content > .bp_description > .bp_heading" 'attr' : false 'type' : "String|Split" 'action' : 'split(" ")[1]' 'name': 'container': ".title_wrapper > h1[itemprop='name']" 'attr': false 'type': 'String' 'directors': 'container': "span[itemprop='director'] > a > span[itemprop='name']" 'attr': false 'type': 'String|Array' 'creators': 'container': "span[itemprop='creator'] > a > span[itemprop='name']" 'attr': false 'type': 'String|Array' 'description': 'container': ".summary_text" 'attr': false 'type': 'String' 'original_title': 'container': ".originalTitle" 'attr': false 'type': 'String' 'duration': 'container': ".title_wrapper .subtext time[itemprop='duration']" 'attr': false 'type': 'String' 'rating': 'container': "span[itemprop='ratingValue']" 'attr': false 'type': 'String|Float' 'image': 'container': "meta[property='og:image']" 'attr': 'content' 'type': 'Image' 'genres': 'container': "div[itemprop='genre'] a" 'attr': false 'type': 'String|Array'
These options are against imdb site updates. So you can basicly change which tag to use for getting the content. The extractor will try to extract the content from the options you passed.
To change default options you should pass your own options as a param while creating new instance of ImdbCrawler
const ImdbCrawler = ; let options = 'movie': 'imdb_id': 'container': "meta[property='imdbId']" 'attr' : "content" 'type' : "String" 'name': 'container': ".title_wrapper > h2[itemprop='name']" 'attr': false 'type': 'String' 'series': 'rating': 'container': "span[itemprop='rating']" 'attr': false 'type': 'String|Float' let imdb_code = "tt4227538";let imdbCrawler = imdb_codeoptions; imdbCrawler;
Usage
to get an episode
const ImdbCrawler = ; let imdb_code = "tt4227538";let imdbCrawler = imdb_code; imdbCrawler;
to get an movie
const ImdbCrawler = ; let imdb_code = "tt0110413";let imdbCrawler = imdb_code; imdbCrawler;
to get an series
You can get series with or without episodes.
If you want to get with episodes basicly pass true
param after callback function in getSeries
without episodes
const ImdbCrawler = ; let imdb_code = "tt4574334";let imdbCrawler = imdb_code; imdbCrawler;
with episodes
const ImdbCrawler = ; let imdb_code = "tt4574334";let imdbCrawler = imdb_code; imdbCrawler;
Running the tests
npm test
License
This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the https://www.gnu.org/licenses/gpl-3.0.html for details