xvideosx 1.4.8 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable linebreak-style */
2
2
  /* eslint-disable no-undef */
3
+ const cheerio = require('cheerio');
3
4
  const puppeteer = require('puppeteer');
4
5
 
5
6
  const newFresh = async ({ url, puppeteerConfig } = {}) => {
@@ -14,6 +15,18 @@ const newFresh = async ({ url, puppeteerConfig } = {}) => {
14
15
  const titles = document.querySelectorAll('.title');
15
16
  const data = [];
16
17
  thumbs.forEach((thumb, index) => {
18
+ const $ = cheerio.load(thumb);
19
+ const videoScript = $('#video-player-bg > script:nth-child(6)').html();
20
+ const files = {
21
+ low: (videoScript.match('html5player.setVideoUrlLow\\(\'(.*?)\'\\);') || [])[1],
22
+ high: videoScript.match('html5player.setVideoUrlHigh\\(\'(.*?)\'\\);' || [])[1],
23
+ HLS: videoScript.match('html5player.setVideoHLS\\(\'(.*?)\'\\);' || [])[1],
24
+ thumb: videoScript.match('html5player.setThumbUrl\\(\'(.*?)\'\\);' || [])[1],
25
+ thumb69: videoScript.match('html5player.setThumbUrl169\\(\'(.*?)\'\\);' || [])[1],
26
+ thumbSlide: videoScript.match('html5player.setThumbSlide\\(\'(.*?)\'\\);' || [])[1],
27
+ thumbSlideBig: videoScript.match('html5player.setThumbSlideBig\\(\'(.*?)\'\\);' || [])[1],
28
+ };
29
+
17
30
  const anchor = thumb.querySelector('a');
18
31
  const img = thumb.querySelector('img');
19
32
  const text = titles[index];
@@ -28,12 +41,13 @@ const newFresh = async ({ url, puppeteerConfig } = {}) => {
28
41
  thumb,
29
42
  title,
30
43
  url,
44
+ files,
31
45
  });
32
46
  }
33
- return result;
34
47
  });
35
48
  return data;
36
49
  });
50
+ return result;
37
51
  } finally {
38
52
  if (browser) await browser.close();
39
53
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "xvideosx",
3
3
  "description": "xvideos.com api implementation.",
4
- "version": "1.4.8",
4
+ "version": "1.5.0",
5
5
  "main": "index.js",
6
6
  "license": "BSD-3-Clause",
7
7
  "repository": {