Skip to content

Commit 0c1502f

Browse files
committed
Fix bug of some old doujin result
1 parent 7288fb6 commit 0c1502f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ https://t.nhentai.net/galleries/1367250/thumb.png
107107

108108
### (6) Search
109109

110+
\* Some old doujin may have no `thumbnail.w` and `thumbnail.h`
111+
110112
```javascript
111113
{
112114
"num_results": 11706,

src/parse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: Jindai Kirin
33
* @Date: 2019-02-18 14:49:30
44
* @Last Modified by: Jindai Kirin
5-
* @Last Modified time: 2019-02-24 13:11:04
5+
* @Last Modified time: 2019-03-25 18:22:02
66
*/
77

88
const Cheerio = require('cheerio');
@@ -49,7 +49,7 @@ function list(html) {
4949
title: $this.find('.caption').html(),
5050
language,
5151
thumbnail: {
52-
s: $thumb.attr('data-src'),
52+
s: $thumb.attr('data-src') || $thumb.attr('src').replace(/^\/\//, 'https://'),
5353
w: $thumb.attr('width'),
5454
h: $thumb.attr('height')
5555
}

test/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ async function log(promise) {
1414
//log(api.tag('anal'));
1515
//log(api.tag('anal',2,'popular'));
1616

17-
api.g(263492).then(gallery => {
17+
/*api.g(263492).then(gallery => {
1818
console.log(gallery.getPages());
1919
console.log(gallery.getPagesThumbnail());
2020
console.log(gallery.getCover());
2121
console.log(gallery.getCoverThumbnail());
22-
});
22+
});*/
23+
24+
log(api.search('[陸乃家鴨] 司法畑でつかまえて♥'));

0 commit comments

Comments
 (0)