fix: douyin like domain (#3764)

This commit is contained in:
huobaolajiao
2020-01-17 00:33:39 +08:00
committed by DIYgod
parent e303965204
commit 9a6e6148e5
+4 -4
View File
@@ -16,7 +16,7 @@ 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(() => {});
})
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
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();
@@ -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) {
@@ -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),
};