GithubHelp home page GithubHelp logo

xvideos's Introduction

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.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();
  • 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' });
  • Filter videos

    const videos = await xvideos.videos.search({ k: 'threesome' });
    const videos = await xvideos.videos.search({ 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();

License

Licence © Rodrigo Gomes da Silva

xvideos's People

Contributors

dependabot[bot] avatar razpeitia avatar ribeiro-tiago avatar rodrigogs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.