diff --git a/lib/routes/pornhub/category_url.js b/lib/routes/pornhub/category_url.js index 40b55620f..d3640d843 100644 --- a/lib/routes/pornhub/category_url.js +++ b/lib/routes/pornhub/category_url.js @@ -5,18 +5,13 @@ module.exports = async (ctx) => { const url = ctx.params.url || 'video'; const link = `https://www.pornhub.com/${url}`; - const response = await got.get(link, { - headers: { - // set ua to "Safari" to get preview videos in mp4 format, instead of webm - 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15', - }, - }); + const response = await got.get(link); const $ = cheerio.load(response.data); const list = $('.nf-videos .videoBox'); ctx.state.data = { - title: $('title').text(), - url: link, + title: $('title').first().text(), + link: link, item: list && list @@ -26,7 +21,7 @@ module.exports = async (ctx) => { return { title: e.find('span.title a').text(), link: `https://www.pornhub.com` + e.find('span.title a').attr('href'), - description: `