From 735904a630cf258e4a10ff14f04443b9629bd5f7 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 29 Feb 2024 17:33:33 +0800 Subject: [PATCH] feat: v3 migration - 13/n --- lib/v2/alternativeto/utils.js | 2 +- lib/v2/apkpure/versions.js | 2 +- lib/v2/bluestacks/release.js | 2 +- lib/v2/ccac/news.js | 2 +- lib/v2/chinadegrees/province.js | 2 +- lib/v2/cmde/index.js | 2 +- lib/v2/cw/author.js | 2 +- lib/v2/cw/master.js | 2 +- lib/v2/cw/sub.js | 2 +- lib/v2/cw/today.js | 2 +- lib/v2/dcard/section.js | 2 +- lib/v2/douyin/hashtag.js | 2 +- lib/v2/douyin/live.js | 2 +- lib/v2/douyin/utils.js | 2 +- lib/v2/fortnite/news.js | 2 +- lib/v2/gov/customs/list.js | 2 +- lib/v2/gov/pbc/goutongjiaoliu.js | 2 +- lib/v2/gov/pbc/trade-announcement.js | 2 +- lib/v2/ielts/index.js | 2 +- lib/v2/iqiyi/video.js | 2 +- lib/v2/njust/utils.js | 2 +- lib/v2/nuaa/utils/pypasswaf.js | 2 +- lib/v2/nytimes/index.js | 2 +- lib/v2/oceanengine/arithmetic-index.js | 2 +- lib/v2/picnob/user.js | 2 +- lib/v2/picuki/profile.js | 2 +- lib/v2/pincong/utils.js | 2 +- lib/v2/pnas/index.js | 2 +- lib/v2/pwc/sustainability.js | 2 +- lib/v2/researchgate/publications.js | 2 +- lib/v2/science/blogs.js | 2 +- lib/v2/science/current.js | 2 +- lib/v2/science/early.js | 2 +- lib/v2/sysu/ygafz.js | 2 +- lib/v2/tiktok/user.js | 2 +- lib/v2/uchicago/current.js | 2 +- lib/v2/uestc/auto.js | 2 +- lib/v2/uestc/cqe.js | 2 +- lib/v2/uestc/scse.js | 2 +- lib/v2/uestc/sice.js | 2 +- lib/v2/uestc/sise.js | 2 +- lib/v2/uraaka-joshi/uraaka-joshi-user.js | 2 +- lib/v2/uraaka-joshi/uraaka-joshi.js | 2 +- lib/v2/xiaohongshu/util.js | 6 +++--- 44 files changed, 46 insertions(+), 46 deletions(-) diff --git a/lib/v2/alternativeto/utils.js b/lib/v2/alternativeto/utils.js index 0883dfa52..88370c715 100644 --- a/lib/v2/alternativeto/utils.js +++ b/lib/v2/alternativeto/utils.js @@ -4,7 +4,7 @@ const baseURL = 'https://alternativeto.net'; const puppeteerGet = (url, cache) => cache.tryGet(url, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/apkpure/versions.js b/lib/v2/apkpure/versions.js index d4d884774..f9c4043c3 100644 --- a/lib/v2/apkpure/versions.js +++ b/lib/v2/apkpure/versions.js @@ -8,7 +8,7 @@ module.exports = async (ctx) => { const baseUrl = 'https://apkpure.com'; const link = `${baseUrl}/${region}/${pkg}/versions`; - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/bluestacks/release.js b/lib/v2/bluestacks/release.js index b9f9e6aec..c04e48534 100644 --- a/lib/v2/bluestacks/release.js +++ b/lib/v2/bluestacks/release.js @@ -6,7 +6,7 @@ import puppeteer from '@/utils/puppeteer'; const pageUrl = 'https://support.bluestacks.com/hc/en-us/articles/360056960211-Release-Notes-BlueStacks-5'; module.exports = async (ctx) => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/ccac/news.js b/lib/v2/ccac/news.js index ee77d4129..25dc76664 100644 --- a/lib/v2/ccac/news.js +++ b/lib/v2/ccac/news.js @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import puppeteer from '@/utils/puppeteer'; module.exports = async (ctx) => { - const browser = puppeteer(); + const browser = await puppeteer(); const lang = ctx.req.param('lang') ?? 'sc'; const type = utils.TYPE[ctx.req.param('type')]; diff --git a/lib/v2/chinadegrees/province.js b/lib/v2/chinadegrees/province.js index 3b917207c..dd8215f6e 100644 --- a/lib/v2/chinadegrees/province.js +++ b/lib/v2/chinadegrees/province.js @@ -14,7 +14,7 @@ module.exports = async (ctx) => { const data = await cache.tryGet( url, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/cmde/index.js b/lib/v2/cmde/index.js index 49bfdf49e..d2435646c 100644 --- a/lib/v2/cmde/index.js +++ b/lib/v2/cmde/index.js @@ -9,7 +9,7 @@ const rootURL = 'https://www.cmde.org.cn'; module.exports = async (ctx) => { const cate = ctx.req.param('cate') ?? 'xwdt/zxyw'; const url = `${rootURL}/${cate}/`; - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const data = await cache.tryGet(url, async () => { const page = await browser.newPage(); await page.setRequestInterception(true); diff --git a/lib/v2/cw/author.js b/lib/v2/cw/author.js index 9805e3241..c2107f7a8 100644 --- a/lib/v2/cw/author.js +++ b/lib/v2/cw/author.js @@ -2,7 +2,7 @@ const { baseUrl, parsePage } = require('./utils'); import puppeteer from '@/utils/puppeteer'; module.exports = async (ctx) => { - const browser = puppeteer(); + const browser = await puppeteer(); const { $, items } = await parsePage('author', browser, ctx); diff --git a/lib/v2/cw/master.js b/lib/v2/cw/master.js index aa0ffbf04..f56607214 100644 --- a/lib/v2/cw/master.js +++ b/lib/v2/cw/master.js @@ -2,7 +2,7 @@ const { baseUrl, parsePage } = require('./utils'); import puppeteer from '@/utils/puppeteer'; module.exports = async (ctx) => { - const browser = puppeteer(); + const browser = await puppeteer(); const { $, items } = await parsePage('master', browser, ctx); diff --git a/lib/v2/cw/sub.js b/lib/v2/cw/sub.js index 8313dbf76..46449992b 100644 --- a/lib/v2/cw/sub.js +++ b/lib/v2/cw/sub.js @@ -2,7 +2,7 @@ const { baseUrl, parsePage } = require('./utils'); import puppeteer from '@/utils/puppeteer'; module.exports = async (ctx) => { - const browser = puppeteer(); + const browser = await puppeteer(); const { $, items } = await parsePage('sub', browser, ctx); diff --git a/lib/v2/cw/today.js b/lib/v2/cw/today.js index 35e4c60df..a31f1d2cd 100644 --- a/lib/v2/cw/today.js +++ b/lib/v2/cw/today.js @@ -2,7 +2,7 @@ const { baseUrl, parsePage } = require('./utils'); import puppeteer from '@/utils/puppeteer'; module.exports = async (ctx) => { - const browser = puppeteer(); + const browser = await puppeteer(); const { $, items } = await parsePage('today', browser, ctx); diff --git a/lib/v2/dcard/section.js b/lib/v2/dcard/section.js index 6bc225a60..d92ad1b6b 100644 --- a/lib/v2/dcard/section.js +++ b/lib/v2/dcard/section.js @@ -6,7 +6,7 @@ import puppeteer from '@/utils/puppeteer'; module.exports = async (ctx) => { const { type = 'latest', section = 'posts' } = ctx.req.param(); const limit = ctx.req.query('limit') ? Number(ctx.req.query('limit')) : 30; - const browser = puppeteer(); + const browser = await puppeteer(); let link = `https://www.dcard.tw/f`; let api = `https://www.dcard.tw/service/api/v2`; diff --git a/lib/v2/douyin/hashtag.js b/lib/v2/douyin/hashtag.js index 3b37332c9..4bbb454e9 100644 --- a/lib/v2/douyin/hashtag.js +++ b/lib/v2/douyin/hashtag.js @@ -21,7 +21,7 @@ module.exports = async (ctx) => { const tagData = await cache.tryGet( `douyin:hashtag:${cid}`, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); let awemeList = ''; diff --git a/lib/v2/douyin/live.js b/lib/v2/douyin/live.js index 866fa5a1d..c9783493a 100644 --- a/lib/v2/douyin/live.js +++ b/lib/v2/douyin/live.js @@ -16,7 +16,7 @@ module.exports = async (ctx) => { `douyin:live:${rid}`, async () => { let roomInfo; - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); diff --git a/lib/v2/douyin/utils.js b/lib/v2/douyin/utils.js index a06ad7663..386976a14 100644 --- a/lib/v2/douyin/utils.js +++ b/lib/v2/douyin/utils.js @@ -80,7 +80,7 @@ const gotGet = async (url, ua) => { }; const puppeteerGet = async (pageUrl) => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/fortnite/news.js b/lib/v2/fortnite/news.js index 1ac58601f..1ed29a445 100644 --- a/lib/v2/fortnite/news.js +++ b/lib/v2/fortnite/news.js @@ -17,7 +17,7 @@ module.exports = async (ctx) => { // using puppeteer instead instead of got // whitch may be blocked by anti-crawling script with response code 403 - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); // intercept all requests diff --git a/lib/v2/gov/customs/list.js b/lib/v2/gov/customs/list.js index f66083b8a..26fa2884c 100644 --- a/lib/v2/gov/customs/list.js +++ b/lib/v2/gov/customs/list.js @@ -26,7 +26,7 @@ module.exports = async (ctx) => { break; } - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const list = await cache.tryGet( link, diff --git a/lib/v2/gov/pbc/goutongjiaoliu.js b/lib/v2/gov/pbc/goutongjiaoliu.js index 8d37584d2..3d1648409 100644 --- a/lib/v2/gov/pbc/goutongjiaoliu.js +++ b/lib/v2/gov/pbc/goutongjiaoliu.js @@ -7,7 +7,7 @@ import puppeteer from '@/utils/puppeteer'; module.exports = async (ctx) => { const link = 'http://www.pbc.gov.cn/goutongjiaoliu/113456/113469/index.html'; - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/gov/pbc/trade-announcement.js b/lib/v2/gov/pbc/trade-announcement.js index c131dcb2c..532dd0aa5 100644 --- a/lib/v2/gov/pbc/trade-announcement.js +++ b/lib/v2/gov/pbc/trade-announcement.js @@ -7,7 +7,7 @@ import puppeteer from '@/utils/puppeteer'; module.exports = async (ctx) => { const link = 'http://www.pbc.gov.cn/zhengcehuobisi/125207/125213/125431/125475/index.html'; - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/ielts/index.js b/lib/v2/ielts/index.js index f955383be..0b134468f 100644 --- a/lib/v2/ielts/index.js +++ b/lib/v2/ielts/index.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const html = await cache.tryGet( targetUrl, async () => { - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/iqiyi/video.js b/lib/v2/iqiyi/video.js index e578c5e39..73445484d 100644 --- a/lib/v2/iqiyi/video.js +++ b/lib/v2/iqiyi/video.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { const link = `https://www.iqiyi.com/u/${uid}/videos`; // Use puppeteer because iqiyi page has a delay. - const browser = puppeteer(); + const browser = await puppeteer(); const data = await cache.tryGet( link, async () => { diff --git a/lib/v2/njust/utils.js b/lib/v2/njust/utils.js index 957ac2a79..3c096ecd4 100644 --- a/lib/v2/njust/utils.js +++ b/lib/v2/njust/utils.js @@ -3,7 +3,7 @@ import puppeteer from '@/utils/puppeteer'; async function getContent(url, pptr = false) { if (pptr) { - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); try { const page = await browser.newPage(); // 更改 window.navigator.webdriver 值以避开反爬 diff --git a/lib/v2/nuaa/utils/pypasswaf.js b/lib/v2/nuaa/utils/pypasswaf.js index e4896848f..5a91f63bd 100644 --- a/lib/v2/nuaa/utils/pypasswaf.js +++ b/lib/v2/nuaa/utils/pypasswaf.js @@ -6,7 +6,7 @@ import puppeteer from '@/utils/puppeteer'; * @desc 返回一个可用的cookie,使用 `got` 发起请求的时候,传入到`options.headers.cookie`即可 */ module.exports = async function getCookie(host) { - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/nytimes/index.js b/lib/v2/nytimes/index.js index 1379e0b7b..c5c7ddd67 100644 --- a/lib/v2/nytimes/index.js +++ b/lib/v2/nytimes/index.js @@ -40,7 +40,7 @@ module.exports = async (ctx) => { // Do nothing } - const browser = puppeteer(); + const browser = await puppeteer(); const feed = await parser.parseURL(rssUrl); const items = await Promise.all( feed.items.splice(0, 10).map(async (item) => { diff --git a/lib/v2/oceanengine/arithmetic-index.js b/lib/v2/oceanengine/arithmetic-index.js index d59a35085..e0f9f91f1 100644 --- a/lib/v2/oceanengine/arithmetic-index.js +++ b/lib/v2/oceanengine/arithmetic-index.js @@ -98,7 +98,7 @@ module.exports = async (ctx) => { const item = await cache.tryGet( link, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/picnob/user.js b/lib/v2/picnob/user.js index cdeefb37b..c0ce13df8 100644 --- a/lib/v2/picnob/user.js +++ b/lib/v2/picnob/user.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { const id = ctx.req.param('id'); const url = `${baseUrl}/profile/${id}/`; - const browser = puppeteer(); + const browser = await puppeteer(); // TODO: can't bypass cloudflare 403 error without puppeteer let html; let usePuppeteer = false; diff --git a/lib/v2/picuki/profile.js b/lib/v2/picuki/profile.js index fcb18737e..3a9269ade 100644 --- a/lib/v2/picuki/profile.js +++ b/lib/v2/picuki/profile.js @@ -22,7 +22,7 @@ function deVideo(media) { module.exports = async (ctx) => { // use Puppeteer due to the obstacle by cloudflare challenge - const browser = puppeteer(); + const browser = await puppeteer(); const id = ctx.req.param('id'); const displayVideo = ctx.req.param('functionalFlag') !== '0'; diff --git a/lib/v2/pincong/utils.js b/lib/v2/pincong/utils.js index b3aa91667..7af5785ad 100644 --- a/lib/v2/pincong/utils.js +++ b/lib/v2/pincong/utils.js @@ -4,7 +4,7 @@ const baseUrl = 'https://pincong.rocks'; const puppeteerGet = (url, cache) => cache.tryGet(url, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/pnas/index.js b/lib/v2/pnas/index.js index 3c1c81879..68cb201c9 100644 --- a/lib/v2/pnas/index.js +++ b/lib/v2/pnas/index.js @@ -37,7 +37,7 @@ module.exports = async (ctx) => { }; }); - const browser = puppeteer(); + const browser = await puppeteer(); const out = await Promise.all( list.map((item) => diff --git a/lib/v2/pwc/sustainability.js b/lib/v2/pwc/sustainability.js index c4bd34745..65698aa1f 100644 --- a/lib/v2/pwc/sustainability.js +++ b/lib/v2/pwc/sustainability.js @@ -8,7 +8,7 @@ module.exports = async (ctx) => { const feedLang = 'en'; const feedDescription = 'Sustainability Publications from PwC Strategy&'; - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); logger.http(`Requesting ${baseUrl}`); await page.setRequestInterception(true); diff --git a/lib/v2/researchgate/publications.js b/lib/v2/researchgate/publications.js index 85811f576..420520484 100644 --- a/lib/v2/researchgate/publications.js +++ b/lib/v2/researchgate/publications.js @@ -8,7 +8,7 @@ module.exports = async (ctx) => { const rootUrl = 'https://www.researchgate.net'; const currentUrl = `${rootUrl}/profile/${id}`; - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/science/blogs.js b/lib/v2/science/blogs.js index dc5f9c7b0..70d97e750 100644 --- a/lib/v2/science/blogs.js +++ b/lib/v2/science/blogs.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { const response = await cache.tryGet( link, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); diff --git a/lib/v2/science/current.js b/lib/v2/science/current.js index 18e69794f..e98fd14b0 100644 --- a/lib/v2/science/current.js +++ b/lib/v2/science/current.js @@ -29,7 +29,7 @@ module.exports = async (ctx) => { .toArray() .map((item) => getItem(item, $)); - const browser = puppeteer(); + const browser = await puppeteer(); const items = await fetchDesc(list, browser, cache.tryGet); await browser.close(); diff --git a/lib/v2/science/early.js b/lib/v2/science/early.js index 9c2124a8c..2b931a24e 100644 --- a/lib/v2/science/early.js +++ b/lib/v2/science/early.js @@ -20,7 +20,7 @@ module.exports = async (ctx) => { .toArray() .map((item) => getItem(item, $)); - const browser = puppeteer(); + const browser = await puppeteer(); const items = await fetchDesc(list, browser, cache.tryGet); await browser.close(); diff --git a/lib/v2/sysu/ygafz.js b/lib/v2/sysu/ygafz.js index ac04323e6..0f99c034d 100644 --- a/lib/v2/sysu/ygafz.js +++ b/lib/v2/sysu/ygafz.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const baseUrl = 'https://ygafz.sysu.edu.cn'; const url = `${baseUrl}/${type}`; - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/tiktok/user.js b/lib/v2/tiktok/user.js index dd150c247..01322c28b 100644 --- a/lib/v2/tiktok/user.js +++ b/lib/v2/tiktok/user.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { const data = await cache.tryGet( `tiktok:user:${user}`, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/uchicago/current.js b/lib/v2/uchicago/current.js index 47961add0..20935fb6b 100644 --- a/lib/v2/uchicago/current.js +++ b/lib/v2/uchicago/current.js @@ -10,7 +10,7 @@ module.exports = async (ctx) => { const baseUrl = 'https://www.journals.uchicago.edu'; const link = `${baseUrl}/toc/${journal}/current`; - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/uestc/auto.js b/lib/v2/uestc/auto.js index 72c7f8bec..1e11a514a 100644 --- a/lib/v2/uestc/auto.js +++ b/lib/v2/uestc/auto.js @@ -6,7 +6,7 @@ const baseIndexUrl = 'https://www.auto.uestc.edu.cn/index/tzgg1.htm'; const host = 'https://www.auto.uestc.edu.cn/'; module.exports = async (ctx) => { - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/uestc/cqe.js b/lib/v2/uestc/cqe.js index 84aa8aa07..b872cfdc4 100644 --- a/lib/v2/uestc/cqe.js +++ b/lib/v2/uestc/cqe.js @@ -21,7 +21,7 @@ module.exports = async (ctx) => { throw new Error('type not supported'); } - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/uestc/scse.js b/lib/v2/uestc/scse.js index d4a19fe41..62cd2715e 100644 --- a/lib/v2/uestc/scse.js +++ b/lib/v2/uestc/scse.js @@ -20,7 +20,7 @@ const prefixes = { }; module.exports = async (ctx) => { - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/uestc/sice.js b/lib/v2/uestc/sice.js index fd70beff0..0a10e3d82 100644 --- a/lib/v2/uestc/sice.js +++ b/lib/v2/uestc/sice.js @@ -7,7 +7,7 @@ const baseIndexUrl = 'https://www.sice.uestc.edu.cn/index.htm'; const host = 'https://www.sice.uestc.edu.cn/'; module.exports = async (ctx) => { - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/uestc/sise.js b/lib/v2/uestc/sise.js index 1f2f9a061..c37428fa5 100644 --- a/lib/v2/uestc/sise.js +++ b/lib/v2/uestc/sise.js @@ -36,7 +36,7 @@ module.exports = async (ctx) => { throw new Error('type not supported'); } - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/uraaka-joshi/uraaka-joshi-user.js b/lib/v2/uraaka-joshi/uraaka-joshi-user.js index 38d568c59..89a268228 100644 --- a/lib/v2/uraaka-joshi/uraaka-joshi-user.js +++ b/lib/v2/uraaka-joshi/uraaka-joshi-user.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const response = await cache.tryGet( link, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', (request) => { diff --git a/lib/v2/uraaka-joshi/uraaka-joshi.js b/lib/v2/uraaka-joshi/uraaka-joshi.js index bc81433b4..726a04ddd 100644 --- a/lib/v2/uraaka-joshi/uraaka-joshi.js +++ b/lib/v2/uraaka-joshi/uraaka-joshi.js @@ -6,7 +6,7 @@ module.exports = async (ctx) => { const link = `https://www.uraaka-joshi.com/`; const title = `裏垢女子まとめ`; - const browser = puppeteer(); + const browser = await puppeteer(); const page = await browser.newPage(); await page.setRequestInterception(true); diff --git a/lib/v2/xiaohongshu/util.js b/lib/v2/xiaohongshu/util.js index 914630d84..e16ec5526 100644 --- a/lib/v2/xiaohongshu/util.js +++ b/lib/v2/xiaohongshu/util.js @@ -7,7 +7,7 @@ const getUser = (url, cache) => cache.tryGet( url, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); try { const page = await browser.newPage(); await page.setRequestInterception(true); @@ -56,7 +56,7 @@ const getBoard = (url, cache) => cache.tryGet( url, async () => { - const browser = puppeteer(); + const browser = await puppeteer(); try { const page = await browser.newPage(); await page.setRequestInterception(true); @@ -90,7 +90,7 @@ const getNotes = (url, cache) => let user = ''; let notes = []; - const browser = puppeteer({ stealth: true }); + const browser = await puppeteer({ stealth: true }); try { const page = await browser.newPage(); await setPageFilter(page);