UNPKG

2.69 kBMarkdownView Raw
1Node Anime Scraper
2===================
3
4***
5
6Scrapes information from GOGOAnime.io to get anime, episode & video information & urls.
7
8Anime-scraper is a module that provides an easy way to scrape GOGOAnime.io for anime information, including genres and a brief summary.
9On top of this, it is also possible to retrieve an animes list of episodes, as well as get their direct video links in a variety of qualities where available.
10
11Currently GOGOAnime is using CloudFlare protection service which makes scraping difficult,
12and as a result, anime-scraper makes use of [cloudscraper](https://github.com/codemanki/cloudscraper) to automatically
13to bypass this restriction.
14
15:white_check_mark: Anime-scraper automatically manages your CloudFlare cookie and ensures that it is always valid.
16
17## Install
18```
19npm install anime-scraper
20```
21
22## Examples
23
24#### Retrieve anime information of anime named 'Sword Art Online II'
25```js
26var Anime = require('anime-scraper').Anime
27
28// Searches for anime using a POST request & uses first result
29Anime.fromName('Sword Art Online').then(function (anime) {
30 console.log(anime)
31})
32
33// You can also search and then choose manually
34Anime.search('Sword Art Online').then(function (results) {
35 // Same as above but uses the second search result rather than the first.
36 results[1].toAnime().then(function (anime) {
37 console.log(anime)
38 })
39})
40```
41
42#### Retrieve video links to first episode of anime named 'Haikyuu'
43```js
44Anime.fromName('Haikyuu!!').then(function (anime) {
45 anime.episodes[0].fetch().then(function (episode) {
46 console.log(episode)
47 })
48})
49```
50
51#### Retrieve all episode video data for anime named 'Yoru no Yatterman'
52```js
53Anime.fromName('Yoru no Yatterman').then(function(anime) {
54 anime.fetchAllEpisodes().then(function(episodes) {
55 console.log(episodes)
56 })
57})
58```
59
60### Get Anime from GOGOAnime URL
61**NOTE**: This is much faster than instantiating using fromName as you do not have to make a POST request (1 request instead of 2).
62```js
63Anime.fromUrl('https://ww1.gogoanime.io/category/naruto-shippuden').then(function(anime) {
64 console.log(anime)
65})
66```
67
68### Other information
69This package has just been re-created to use GOGOAnime after previously using KissAnime.
70As such, there are currently no tests or testing as yet. Please raise an issue or submit a PR if you find anything that requires fixing.
71
72Please note that this version of this package currently uses AirBNB ES6 as a style guide.
73
74### Contributors
75
76Many thanks to contributors.
77
78- [van-nguyen](https://github.com/van-nguyen)
79- [andrewprivate](https://github.com/andrewprivate)