@adulttechinc/xvideos

1.2.0 • Public • Published

xvideos

Build Status Code Climate Test Coverage

A a Node.js xvideos.com API library.

Install

$ npm install @rodrigogs/xvideos

Usage

const xvideos = require('@rodrigogs/xvideos');

//-- Inside an async function --//

// Retrieve fresh videos
const fresh = await xvideos.videos.fresh({ page: 1 });
console.log(fresh.videos); // { url, path, title, duration, profile: { name, url }, views, }
console.log(fresh.pagination.current); // 1 
console.log(fresh.pagination.pages); // [1, 2, 3, 4, 5...]
console.log(fresh.hasNext()); // true
console.log(fresh.hasPrevious()); // false

const nextPage = await fresh.next();
console.log(nextPage.pagination.current); // 2
console.log(nextPage.hasNext()); // true
console.log(nextPage.hasPrevious()); // true

const previousPage = await fresh.previous();
console.log(previousPage.pagination.current); // 1
console.log(previousPage.hasNext()); // true
console.log(previousPage.hasPrevious()); // tfalse

const detail = await xvideos.videos.details(fresh[0]); /**
{
  title,
  duration,
  image,
  videoType,
  videoWidth,
  videoHeigth,
  views,
  files: {
    low,
    high,
    HLS,
    thumb,
    thumb69,
    thumbSlide,
    thumbSlideBig
  }
} **/

API

  • Retrieve dashboard videos
    const dashboardList = await xvideos.videos.dashboard({ page: 1 });
    • Is there a next page?
      console.log(deshboardList.hasNext()); // true or false
    • Is there a previous page?
      console.log(deshboardList.hasPrevious()); // true or false
    • Refresh page videos
      const refreshedVideos = await deshboardList.refresh();
    • Retrieve next deshboard page videos
      const nextVideos = await deshboardList.next();
    • Retrieve previous deshboard page videos
      const previousVideos = await deshboardList.previous();
  • Retrieve fresh videos
    const freshList = await xvideos.videos.fresh({ page: 1 });
    • Is there a next page?
      console.log(freshList.hasNext()); // true or false
    • Is there a previous page?
      console.log(freshList.hasPrevious()); // true or false
    • Refresh page videos
      const refreshedVideos = await freshList.refresh();
    • Retrieve next fresh page videos
      const nextVideos = await freshList.next();
    • Retrieve previous fresh page videos
      const previousVideos = await freshList.previous();
  • Retrieve best videos
    const bestList = await xvideos.videos.best({ year: '2018', month: '02', page: 1 });
    • Is there a next page?
      console.log(bestList.hasNext()); // true or false
    • Is there a previous page?
      console.log(bestList.hasPrevious()); // true or false
    • Refresh page videos
      const refreshedVideos = await bestList.refresh();
    • Retrieve next best page videos
      const nextVideos = await bestList.next();
    • Retrieve previous best page videos
      const previousVideos = await bestList.previous();
  • Retrieve verified videos
    const verifiedList = await xvideos.videos.verified({ page: 1 });
    • Is there a next page?
      console.log(verifiedList.hasNext()); // true or false
    • Is there a previous page?
      console.log(verifiedList.hasPrevious()); // true or false
    • Refresh page videos
      const refreshedVideos = await verifiedList.refresh();
    • Retrieve next verified page videos
      const nextVideos = await verifiedList.next();
    • Retrieve previous verified page videos
      const previousVideos = await verifiedList.previous();
  • Retrieve video details
    const details = await xvideos.videos.details({ url: 'https://www.xvideos.com/video36638661/chaturbate_lulacum69_30-05-2018' });

License

Licence © Rodrigo Gomes da Silva

Package Sidebar

Install

npm i @adulttechinc/xvideos

Weekly Downloads

3

Version

1.2.0

License

BSD-3-Clause

Unpacked Size

63.4 kB

Total Files

63

Last publish

Collaborators

  • adulttechinc