1.2.2 • Published 7 years ago
crunchyroll-lib v1.2.2
Chrunchyroll Library
Library to get the media information about a Chrunchyroll video.
How to use in Node
This library by default will use XMLHttpRequest. This can be changed by
setting the HTTP client to NodeHttpClient. Remember that this has to be done
in the start of the application before anything else is done with this library.
Example
import { NodeHttpClient } from "crunchyroll-lib/services/http/NodeHttpClient";
import { setHttpClient } from "crunchyroll-lib";
// Set the Http client in the start of the application.
setHttpClient(NodeHttpClient);Examples
Browser
import { NodeHttpClient } from "crunchyroll-lib/services/http/NodeHttpClient";
import { getMedia, setHttpClient } from "crunchyroll-lib";
const run = async () => {
const media = await getMedia('740239', '360p', 'http://www.crunchyroll.com/boruto-naruto-next-generations/episode-17-run-sarada-740239?p360=1');
const subtitles = media.getSubtitles();
console.log("name, author, default");
for (let i = 0; i < subtitles.length; i++) {
console.log(subtitles[i].getTitle() + ", " + subtitles[i].getAuthor() + ", " + (subtitles[i].isDefault() ? "true" : "false"));
}
};
run()
.then(undefined, err => console.error(err));Node
import { NodeHttpClient } from "crunchyroll-lib/services/http/NodeHttpClient";
import { getMedia, setHttpClient } from "crunchyroll-lib";
// Set the Http client to Node
setHttpClient(NodeHttpClient);
const run = async () => {
const media = await getMedia('740239', '360p', 'http://www.crunchyroll.com/boruto-naruto-next-generations/episode-17-run-sarada-740239?p360=1');
const subtitles = media.getSubtitles();
console.log("name, author, default");
for (let i = 0; i < subtitles.length; i++) {
console.log(subtitles[i].getTitle() + ", " + subtitles[i].getAuthor() + ", " + (subtitles[i].isDefault() ? "true" : "false"));
}
};
run()
.then(undefined, err => console.error(err));1.2.2
7 years ago
1.2.1
7 years ago
1.2.0
7 years ago
1.1.4
7 years ago
1.1.3
7 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.11
8 years ago
1.0.10
8 years ago
1.0.9
8 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago