fix: Update douyin domain (#3762)

This commit is contained in:
huobaolajiao
2020-01-16 14:59:54 +08:00
committed by DIYgod
parent 84c3916b3d
commit 42f957c634
+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('.user-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/post')) {
} else if (req.url().match('www.iesdouyin.com/web/api/v2/aweme/post')) {
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),
};