Skip to content

Commit

Permalink
fix: douyin like domain (DIYgod#3764)
Browse files Browse the repository at this point in the history
  • Loading branch information
huobaolajiao authored and lotosbin committed Mar 3, 2020
1 parent abddeff commit a8a45d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/routes/douyin/like.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ module.exports = async (ctx) => {
list: null,
};

page.goto(`https://www.douyin.com/share/user/${id}`)
page.goto(`https://www.iesdouyin.com/share/user/${id}`)
.then(() => {
page.click('.like-tab').catch(() => {});
})
.catch(() => {});

page.on('response', (response) => {
const req = response.request();
if (req.url().match(`www.douyin.com/share/user/${id}`)) {
if (req.url().match(`www.iesdouyin.com/share/user/${id}`)) {
response.text().then((text) => {
const $ = cheerio.load(text);
result.name = $('.nickname').text();
Expand All @@ -34,7 +34,7 @@ module.exports = async (ctx) => {
browser.close();
}
});
} else if (req.url().match('www.douyin.com/web/api/v2/aweme/like')) {
} else if (req.url().match('www.iesdouyin.com/web/api/v2/aweme/like')) {
response.json().then((data) => {
result.list = data;
if (result.name) {
Expand All @@ -48,7 +48,7 @@ module.exports = async (ctx) => {

ctx.state.data = {
title: `${data.name}的抖音-喜欢的视频`,
link: `https://www.douyin.com/share/user/${id}`,
link: `https://www.iesdouyin.com/share/user/${id}`,
description: data.description,
item: data.list && data.list.aweme_list.map(formatItem),
};
Expand Down

0 comments on commit a8a45d2

Please sign in to comment.