From 4655e272a90cb38cc38a3f3a0e06e4a776b3aecb Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Wed, 8 Sep 2021 23:55:30 +0200 Subject: [PATCH] Add Comic URL to Search and Details --- README.md | 2 +- index.js | 4 +++- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6d75346..78e4a88 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ View the [test folder](https://github.com/Mar0xy/bilibilicomics-api/tree/main/te Returns most details about the comic: cover, title, desc, chapters (all chapters in an array, NOTE: Chapters get sorted from latest to oldest), total (total chapters) ##### bilibilicomics.Search(string) -Returns all results with the provided string the results return in an array with following data: id, title, authors, vcover, hcover, genres +Returns all results with the provided string the results return in an array with following data: id, title, url, authors, vcover, hcover, genres ##### bilibilicomics.fetchImages(int/number) Returns every image path for the chapter in an array for getTokens. diff --git a/index.js b/index.js index 6b9f654..680d1e2 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,8 @@ class bilibilicomics { let epcount = res.data.data.total let cover = res.data.data.horizontal_cover let desc = res.data.data.evaluate - return resolve({cover: cover, title: title, desc: desc, chapters: episodes, total: epcount}); + let url = `https://www.bilibilicomics.com/detail/mc${res.data.data.id}`; + return resolve({cover: cover, title: title, url: url, desc: desc, chapters: episodes, total: epcount}); }) .catch(err => { return reject(`An error occured within the api: ${err}`) }) }) @@ -58,6 +59,7 @@ class bilibilicomics { results.push({ id: comic.id, title: comic.title.replace(/(<([^>]+)>)/gi, ""), + url: `https://www.bilibilicomics.com/detail/mc${comic.id}`, authors: comic.author_name, vcover: comic.vertical_cover, hcover: comic.horizontal_cover, diff --git a/package.json b/package.json index 96ac5eb..7741daf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bilibilicomics-api", - "version": "1.0.5", + "version": "1.1.0", "description": "An NodeJS API for bilibilicomics.com", "keywords": [ "bilibili",