xvideosx 1.4.9 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,6 +41,7 @@ const newFresh = async ({ url, puppeteerConfig } = {}) => {
28
41
  thumb,
29
42
  title,
30
43
  url,
44
+ files,
31
45
  });
32
46
  }
33
47
  });
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.9",
4
+ "version": "1.5.0",
5
5
  "main": "index.js",
6
6
  "license": "BSD-3-Clause",
7
7
  "repository": {