npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xvideos.js

v1.0.4

Published

powerful xvideos wrapper based on typescript

Downloads

91

Readme

xvideos

A Node.js library for the xvideos.com API.

Installation

$ npm install xvideos.js
$ pnpm install xvideos.js
$ yarn add xvideos.js

Usage

import { XVideos } from 'xvideos.js';
const xvideos = new XVideos();
//-- Inside an async function --//

// Retrieve fresh videos from the first page
const fresh = await xvideos.fresh(1);
// Log details of the retrieved videos 
console.log(fresh.videos); // Array of video objects with properties like url, path, title, duration, profile, views
console.log(fresh.pagination.page); // Current page number
console.log(fresh.pagination.pages); // Array of available page numbers
console.log(fresh.hasNext()); // Check if there is a next page
console.log(fresh.hasPrevious()); // Check if there is a previous page

// Retrieve detailed information about a specific video
const detail = await xvideos.details(fresh.videos[0].url);
// Log details of the specific video
console.log(detail); // Detailed video object with properties like title, duration, image, videoType, views, files

API

Retrieve Fresh Videos

// Retrieve fresh videos from the first page
const freshList = await xvideos.fresh(1);

// Check if there is a next page of results
console.log(freshList.hasNext()); // Outputs: true or false

// Check if there is a previous page of results
console.log(freshList.hasPrevious()); // Outputs: true or false

// Retrieve the next page of fresh videos if available
const nextVideos = await freshList.next();

// Retrieve the previous page of fresh videos if available
const previousVideos = await freshList.previous();

Retrieve Verified Videos

// Retrieve verified videos from the first page
const verifiedList = await xvideos.getVerified("women", 1); // Argument 'type' can be either "women", "men", "gay", or "trans"

// Check if there is a next page of results
console.log(verifiedList.hasNext()); // Outputs: true or false

// Check if there is a previous page of results
console.log(verifiedList.hasPrevious()); // Outputs: true or false

// Refresh the current page of results to get updated data
const refreshedVideos = await verifiedList.refresh();

// Retrieve the next page of verified videos if available
const nextVideos = await verifiedList.next();

// Retrieve the previous page of verified videos if available
const previousVideos = await verifiedList.previous();

Retrieve Video Details

// Retrieve detailed information about a specific video using its URL
const details = await xvideos.details('https://www.xvideos.com/video.udefpih987f/mi_madrastra_perdio_apuesta_en_final_argentina_vs_colombia_y_me_lo_chupa');

// Log detailed information about the video
console.log(details); // Detailed video object with properties like title, duration, image, videoType, views, files

Download Video Details

// Download video thumbnail from a specific video using its URL
const image = await xvideos.downloadImage('https://www.xvideos.com/video.udefpih987f/mi_madrastra_perdio_apuesta_en_final_argentina_vs_colombia_y_me_lo_chupa');
// Download video in high quality from a specific video using its URL
const high = await xvideos.downloadHigh('https://www.xvideos.com/video.udefpih987f/mi_madrastra_perdio_apuesta_en_final_argentina_vs_colombia_y_me_lo_chupa');
// Download video in low quality from a specific video using its URL
const low = await xvideos.downloadLow('https://www.xvideos.com/video.udefpih987f/mi_madrastra_perdio_apuesta_en_final_argentina_vs_colombia_y_me_lo_chupa');

console.log(image, high, low); // path to downloaded image and videos

Filter Videos

// Search for videos using a keyword, and optionally specify a page number
const videos = await xvideos.search('threesome', 5);
// Example with a specific page number
// const videos = await xvideos.videos.search({ k: 'public', page: 5 });

// Check if there is a next page of results
console.log(videos.hasNext()); // Outputs: true or false

// Check if there is a previous page of results
console.log(videos.hasPrevious()); // Outputs: true or false

// Retrieve the next page of videos if available
const nextVideos = await videos.next();

// Retrieve the previous page of videos if available
const previousVideos = await videos.previous();

// Search for videos with specific parameters
const videos = await xvideos.search("threesome", 5, {
  sort: 'rating',
  datef: 'week',
  durf: '3-10min',
  quality: 'hd'
});

// Log the search results
console.log(videos); // Array of video objects with properties based on the search parameters

Params explanation

| Parameter | Default | Options | |-----------|----------------|------------------------------------------------------------------------------------------| | sort | "relevance" | "uploaddate", "rating", "length", "views", "random" | | datef | "all" | "today", "week", "month", "3month", "6month", "all" | | durf | "allduration"| "1-3min", "3-10min", "10min_more", "10-20min", "20min_more", "allduration" | | quality | "all" | "hd", "1080P", "all" | | premium | false | true, false |


🐼 @me

You can find me on twitter as 🐤 @osinthappyemo or on instagram as 🍢 @osintxv