xvideosx 1.5.7 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -27,7 +27,7 @@ const details = async ({ url, puppeteerConfig } = {}) => {
|
|
27
27
|
const title = $element.find('.title a').text();
|
28
28
|
const duration = $element.find('.duration').text();
|
29
29
|
const channel = $element.find('.metadata .name').text();
|
30
|
-
const url = `https://www.
|
30
|
+
const url = `https://www.xvideos.com${$element.find('.title a').attr('href')}`;
|
31
31
|
const thumbNail = $element.find('.thumb img').attr('src');
|
32
32
|
return {
|
33
33
|
title,
|
@@ -1,18 +1,19 @@
|
|
1
1
|
/* eslint-disable linebreak-style */
|
2
|
+
/* eslint-disable no-unused-vars */
|
2
3
|
/* eslint-disable no-undef */
|
3
4
|
const puppeteer = require('puppeteer');
|
4
5
|
const cheerio = require('cheerio');
|
5
6
|
|
6
7
|
const newFresh = async ({ url, puppeteerConfig } = {}) => {
|
7
8
|
let browser;
|
9
|
+
|
8
10
|
try {
|
9
11
|
browser = await puppeteer.launch(puppeteerConfig);
|
10
12
|
const page = await browser.newPage();
|
11
|
-
await page.goto(
|
13
|
+
await page.goto('https://www.xvideos.com/');
|
12
14
|
const html = await page.content();
|
13
15
|
const $ = cheerio.load(html);
|
14
|
-
const
|
15
|
-
const $getVideos = cheerio.load(data);
|
16
|
+
const $getVideos = cheerio.load($.html());
|
16
17
|
const mozaique = $getVideos('.thumb-block');
|
17
18
|
const videos = mozaique.map((index, element) => {
|
18
19
|
const $element = $getVideos(element);
|
@@ -20,18 +21,19 @@ const newFresh = async ({ url, puppeteerConfig } = {}) => {
|
|
20
21
|
const url = `https://www.xvideos.com${$element.find('.title a').attr('href')}`;
|
21
22
|
const thumbNail = $element.find('.thumb img').attr('src');
|
22
23
|
const duration = $element.find('.duration').text();
|
23
|
-
const
|
24
|
+
const channel = $element.find('.metadata .name').text();
|
24
25
|
|
25
26
|
return {
|
26
|
-
|
27
27
|
title,
|
28
28
|
url,
|
29
29
|
thumbNail,
|
30
30
|
duration,
|
31
|
-
|
31
|
+
channel,
|
32
32
|
};
|
33
33
|
}).get();
|
34
34
|
return videos;
|
35
|
+
} catch (e) {
|
36
|
+
console.log(e);
|
35
37
|
} finally {
|
36
38
|
if (browser) await browser.close();
|
37
39
|
}
|