1.2.2 • Published 3 years ago

tube-utils v1.2.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Tube Utils

Here you find functions to parse video data and search results data from popular tubes.

Usage

First install per npm by running:

npm install tube-utils

then you can use the parser in your js/ts project:

import { TUBES, parser } from 'tube-utils';

// video data
// params: tube, videoId
const videoData = await parser.parseVideo(TUBES.XNXX, 'id');
/* Result:
{
  id: string;
  xvideosId?: string;
  title: string;
  duration: string;
  views: string;
  thumb: string;
  poster: string;
  tags: string[];
  pornstars: string[];
  relatedVideos: [
    {
      id: string;
      thumb: string;
      title: string;
      views: string;
      duration: string;
      channel?: string;
      poster?: string;
    },
    ...
  ];
}
*/

// search results data
// params: tube, keyword, page
const searchResults = await parser.parseSearch(TUBES.XNXX, 'keyword', 1);
/* Result:
{
  relatedKeywords: string[];
  videos: [
    {
      id: string;
      thumb: string;
      title: string;
      views: string;
      duration: string;
      channel?: string;
      poster?: string;
    },
    ...
  ];
}
*/

// get video Src (CDN Link)
// Note: This function bypass security of the tubes and need sometimes an proxy
// params: tube, videoId
const videoSrcData = await parser.parseVideoSrc(TUBES.XNXX, 'id');
/* Result:
{
  lowRes: 'https://cndlink.com/example_id.mp4',
  highRes: 'https://cndlink.com/example_id.mp4',
  hls: 'https://cdnlink.com/hls/v10/6293672-,240,360,480,720,1080,p.mp4.urlset/master.m3u8'
}
*/

// get related keywords for a given keyword by searching at all tubes
// params: keyword
const keywords = await parser.getRelatedKeywords('foo');
/*
[
  { keyword: 'foo', popularity: 4 },
  { keyword: 'foo bar', popularity: 3 },
  ...
]
*/
1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago