Coder Social home page Coder Social 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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xvideos's Issues

Search functionaluty seems not working and retrieve video tags in details

Hi.
First of all thanks for the work, nice library!

I would like to know why the search functionality is not available, I thought that yo can search videos under a tag (or tags) usign the method dashboard and passing the paramarter "key".. am I worng?. Using this, there is no diference in the answer.

On the other hand I would like to get the tags of the video in the await answers or in the detail method.

Thanks for your time

Paging fails.

Hello,

First of all, I really appreciate this library, so thank you for your hard work.

There is an issue though, I have been exploring this library but it seems that paging does not really work. For example, paging through fresh videos returns the same page, but in the pagination object, it does say the page has changed to page 2 for instance, but the videos are the same.

Could you provide some clarity.

Thank you.

Video details not working

Hi, I am Lachit, I have an rodrigogs/xvideos adult node app and search results JSON are working fine. On the video details page JSON not working on the server-side using port 5050. but the same code running on my localhost port 5050. Do you guys have any ideas? I tested the code on 3 servers, with NO OUTPUT. CURL is working. Is this issue with the server or code?

Not able to show results

const dashboardList = await xvideos.videos.dashboard({ page: 1 });
^

TypeError: Cannot read properties of undefined (reading 'dashboard')
at test (C:\mynodeapp\xvideos-lib\test.js:13:44)
at Object. (C:\mynodeapp\xvideos-lib\test.js:16:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47

reverse lookup?

Hey so I have a ton of these downloaded videos with the terrible naming convention that xvideos uses:

capture

Is there any way to do a reverse lookup to retrieve the titles for these?

can return thumbnail url in videos fresh and search

how to get thumbnail url . i no see image url for thumbnail from you example scripts


// 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

Please update to latest version

npm WARN config init.module Use --init-module instead.

up to date, audited 504 packages in 2s

75 packages are looking for funding
run npm fund for details

21 vulnerabilities (4 moderate, 12 high, 5 critical)

To address issues that do not require attention, run:
npm audit fix

To address all issues (including breaking changes), run:
npm audit fix --force

Run npm audit for details.
root@clipst:/home/xvideos#

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.