|
|
|
import Douyin from '../bot/Douyin.mjs';
|
|
|
|
import Kuaishou from '../bot/Kuaishou.mjs';
|
|
|
|
import Xigua from '../bot/Xigua.mjs';
|
|
|
|
import configs from '../config.mjs';
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
const heroCloudServer = 'ws://192.168.3.13:1818';
|
|
|
|
|
|
|
|
//抖音测试
|
|
|
|
//const douyin = new Douyin(heroCloudServer);
|
|
|
|
//const url = 'https://v.douyin.com/iJr1NsJJ/';
|
|
|
|
//console.log('请求中: %s ...', url);
|
|
|
|
//const data = await douyin.scrap(url);
|
|
|
|
//console.log("解析结果:\n%s", JSON.stringify(data));
|
|
|
|
|
|
|
|
//快手测试
|
|
|
|
configs.heroTabOptions.timeoutMs = 20000; //所有内容加载完成超时
|
|
|
|
configs.heroBotOptions.userAgent = configs.userAgents.iphone_wechat;
|
|
|
|
//configs.heroBotOptions.userAgent = configs.userAgents.mac_chrome;
|
|
|
|
console.log('Hero配置', configs);
|
|
|
|
|
|
|
|
const kuaishou = new Kuaishou(heroCloudServer);
|
|
|
|
//const url = 'https://www.kuaishou.com/f/X8FTguiIjZQVwE7';
|
|
|
|
const url = 'https://v.kuaishou.com/7zwqe6';
|
|
|
|
//const url = 'https://www.kuaishou.com/';
|
|
|
|
console.log('请求中: %s ...', url);
|
|
|
|
const data = await kuaishou.scrap(url);
|
|
|
|
console.log("解析结果:\n%s", JSON.stringify(data));
|
|
|
|
|
|
|
|
//西瓜测试
|
|
|
|
//const url = 'https://www.ixigua.com/7092326495246516749';
|
|
|
|
//configs.heroBotOptions.referrer = url;
|
|
|
|
//configs.heroBotOptions.userAgent = configs.userAgents.mac_chrome;
|
|
|
|
//console.log('Hero配置', configs);
|
|
|
|
|
|
|
|
//const xigua = new Xigua(heroCloudServer);
|
|
|
|
//console.log('请求中: %s ...', url);
|
|
|
|
//const data = await xigua.scrap(`${url}?wid_try=1`);
|
|
|
|
//console.log("解析结果:\n%s", JSON.stringify(data));
|
|
|
|
|
|
|
|
})();
|