@rodrigogs/xvideos
v1.3.0
Published
xvideos.com api implementation.
Downloads
49
Maintainers
Readme
xvideos
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.videos[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();
- Is there a next page?
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();
- Is there a next page?
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();
- Is there a next page?
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();
- Is there a next page?
Retrieve video details
const details = await xvideos.videos.details({ url: 'https://www.xvideos.com/video36638661/chaturbate_lulacum69_30-05-2018' });
Filter videos
const videos = await xvideos.videos.details({ k: 'threesome' }); const videos = await xvideos.videos.details({ k: 'public', page: 5 });
- Is there a next page?
console.log(videos.hasNext()); // true or false
- Is there a previous page?
console.log(videos.hasPrevious()); // true or false
- Refresh page videos
const refreshedVideos = await videos.refresh();
- Retrieve next verified page videos
const nextVideos = await videos.next();
- Retrieve previous verified page videos
const previousVideos = await videos.previous();
- Is there a next page?
License
Licence © Rodrigo Gomes da Silva