@fubasi/bilibilicomics
v0.2.0
Published
Node.js client for bilibilicomics.com
Downloads
3
Readme
connectors-bilibilicomics
Node.js client for bilibilicomics.com
Installing
npm install @fubasi/bilibilicomics
Usage
const { BilibilicomicsConnector, BilibilicomicsIdentity } = require('@fubasi/bilibilicomics');
const { promises: fs } = require('fs');
const user = new BilibilicomicsIdentity('[email protected]', 'examplepassword');
const client = new BilibilicomicsConnector(user);
client.chapter(98523).then(manifest => {
// Metadata for chapter
console.log('Manifest:', manifest);
// Downloading first chunk of first page
return client.image(manifest.chunks[0][0]);
}).then(image => {
console.log('Image size:', image.length);
// Save chunk to file
return fs.writeFile('test.jpg', image);
}).then(() => {
console.log('Done!');
});