Skip to content

Commit

Permalink
feat: 微信搜索时添加描述
Browse files Browse the repository at this point in the history
  • Loading branch information
vertex-app committed Mar 17, 2024
1 parent a6f5721 commit e3c3f6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/common/Douban.js
Original file line number Diff line number Diff line change
Expand Up @@ -1091,13 +1091,13 @@ class Douban {
}

async search (key) {
const json = await this._getJson('https://movie.douban.com/j/subject_suggest?q=' + encodeURIComponent(key));
const json = await this._getJson('https://www.douban.com/j/search_suggest?debug=true&q=' + encodeURIComponent(key));
const result = [];
for (const detail of json) {
for (const detail of json.cards.filter(item => item.url?.indexOf('movie') !== -1)) {
const item = {};
item.doubanId = this.id;
item.title = detail.title;
item.subtitle = detail.sub_title;
item.subtitle = detail.card_subtitle;
item.link = detail.url;
item.poster = detail.img?.replace(/img\d/, 'img9').replace('s_ratio', 'l_ratio').replace('webp', 'jpg');
item.id = detail.id;
Expand Down
2 changes: 1 addition & 1 deletion app/model/WebhookMod.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ class WebhookMod {
await redis.del('vertex:select:douban');
const keys = [];
for (const [index, value] of result.entries()) {
await global.doubanPush.pushWeChat(`${index}: ${value.title} - ${value.year}`, '', value.poster);
await global.doubanPush.pushWeChat(`${index}: ${value.title} - ${value.year}`, value.subtitle || '', value.poster);
keys.push({ id: index, text: `${value.title} - ${value.year}` });
}
const selectors = [
Expand Down

0 comments on commit e3c3f6c

Please sign in to comment.