# XNXX DL

A simple Node.js library to search and extract video information from [xnxx.com](https://www.xnxx.com).

> **Disclaimer:** This library is for educational and personal use only. The author is not responsible for misuse.

## 📦 Installation

```bash
npm install xnxx-dl
```

## 🚀 Usage

```js
const xnxx = require("xnxx-dl");

(async () => {
  // Search for videos by keyword
  const result = await xnxx.search("Mia Khalifa"); // returns array of objects { title, url }

  if (result.length >= 1) {
    // Get detailed info of the first video URL
    const info = await xnxx.getInfo(result[0].url);
    console.log(info);
  }
})();
```

### Example Output

```js
{
  url: 'https://www.xnxx.com/video-dzrou9c/mia_khalifa_pussy_fuck',
  dlink: 'https://cdn77-vid-mp4.xnxx-cdn.com/nHep9rDF8hEI4TFbZDmyYQ==,1755261645/videos/mp4/0/5/e/xvideos.com_05e335e4e9763effb85644dae5b3e2ca.mp4?ui=MzguNTYuMjE3LjE1LS0vdmlkZW8tZHpyb3U5Yy9taWFfa2hhbGlmYV9wdXM=',
  title: 'Mia khalifa pussy fuck',
  thumbnail: 'https://cdn77-pic.xnxx-cdn.com/videos/thumbs169xnxxll/05/e3/35/05e335e4e9763effb85644dae5b3e2ca/05e335e4e9763effb85644dae5b3e2ca.5.jpg',
  views: 4124800,
  duration: '05:46',
  likes: '2,533',
  rating: '97.06%'
}
```

## 📚 API

### `search(query: string, page?: number): Promise<{ title: string, url: string }[]>`

- **query** — Video search term.
- **page** _(optional, default 0)_ — Page number for search results.
- **returns** — Array of objects containing:
  - `title` — Video title.
  - `url` — Video page URL.

### `getInfo(url: string): Promise<VideoInfo>`

- **url** — Video page URL.
- **returns** — Object containing:

  - `url` _(string)_ — Video page URL.
  - `dlink` _(string | undefined)_ — Direct video link if available.
  - `title` _(string)_ — Video title.
  - `thumbnail` _(string | undefined)_ — Thumbnail URL.
  - `views` _(number)_ — Number of views.
  - `duration` _(string)_ — Video duration in HH\:MM\:SS.
  - `likes` _(string | undefined)_ — Number of likes.
  - `rating` _(string | undefined)_ — Video rating or score.
