Skip to content

Commit

Permalink
Add Comic URL to Search and Details
Browse files Browse the repository at this point in the history
  • Loading branch information
Mar0xy committed Sep 8, 2021
1 parent b1fef3d commit 4655e27
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`) })
})
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bilibilicomics-api",
"version": "1.0.5",
"version": "1.1.0",
"description": "An NodeJS API for bilibilicomics.com",
"keywords": [
"bilibili",
Expand Down

0 comments on commit 4655e27

Please sign in to comment.