Powerful scraper for PornHub. Unlike others scrapers, it's working in 2020 August with their new website. It allows you to get any informations out of any page.
npm install @justalk/pornhub-api
-
Scraper: Parse any informations from a video page on PornHub : Related video. comments, view, vote up and so many others...
-
Download links: Get the download links in all the quality without registering
-
Search pagination: Possibility to scrap multiple page search
-
Search by different criteria: Possibility to scrap search by actor or title
-
Flexible: The results are always return in a very specific javascrypt type making it easy to integrate to your need.
async page(url, options)
name | type | description |
---|---|---|
url | String | url of the page |
keys | Array | List of the keys |
name of key | return type | description |
---|---|---|
title | String | Title |
description | String | Description |
views | Number | Number total of views |
up_votes | Number | Number of up vote |
down_votes | Number | Number of down vote |
percent | Number | Percent of up vote |
author | String | Name of the uploader |
author_subscriber | Number | Number of subscriber of the uploader |
pornstars | Array | Names of the pornstars |
categories | Array | List of the names of the categories |
tags | Array | List of the names of the tags |
production | String | Type of production |
duration | Number | Duration in second |
number_of_comment | Number | Total number of comments |
thumbnail | String | Url of the thumbnail |
upload_date | Date | Date of upload |
download_urls | Object | List of download link by quality |
comments | Object | List of comments with additionnals informations |
async search(value)
name | type | description |
---|---|---|
value | String | value search in pornhub |
keys | Array or String if there is only one option | List of the keys |
options | Array | List of the optional options |
name of options | return type | description |
---|---|---|
page | Number | Number of page to scraper |
production | String | Type of production targeted : homemade or professional |
search | String | Type of search targeted : video or pornstars |
name of keys | return type | description |
---|---|---|
link | String | Link of the videos |
title | String | Title of the videos |
duration | Number | Duration in seconds |
views | Number | Number total of views |
premium | Boolean | True if the video is premium, false if else |
author | String | Author of the video |
ratings | Number | Positive rating of the video in percentage |
name of keys | return type | description |
---|---|---|
actor | String | Name of the actor |
video_number | Number | Number of video of the actor |
view_number | Number | Number of view of the actor |
rank | Number | Rank of the actor |
const pornhub = require('@latsuj/pornhub-api');
const video = await pornhub.page(url, ['title']);
{
"title": "Name of the video"
}
const pornhub = require('@latsuj/pornhub-api');
const video = await pornhub.page(url, ['title','description']);
{
"title": "Name of the video",
"description": "Description of the video"
}
const pornhub = require('@latsuj/pornhub-api');
const video = await pornhub.page(url, ['title','pornstars','download_urls']);
{
"title": "Title of the video",
"pornstars": ["Sophie A","Rocco B"],
"download_urls": {
"720" : "https://p.com/link1",
"480" : "https://p.com/link2",
"360" : "https://p.com/link3"
}
}
const pornhub = require('@latsuj/pornhub-api');
const video = await pornhub.search("Aa",["title","link","premium","hd"]);
[{
"link": "https://p.com/link1",
"title": "Title of the video",
"hd": true,
"premium": true
},{
"link": "https://p.com/link2",
"title": "Title of the video",
"hd": false,
"premium": false
}]
const pornhub = require('@latsuj/pornhub-api');
const video = await pornhub.search("Aa",["actor","rank"],{production: 'homemade', search: 'pornstars'});
[{
"actor": "Herica Alue",
"rank": 8005,
},{
"actor": "Robert Laach",
"rank": 60
},{
"actor": "Aalix Lolo",
"rank": 6500
}]
For testing, install the node project and run the test command.
node install
npm test
Also, you can use the command under for running the test without the linter
npm run test-no
- The version of ava is limited to 2.4.0 because the ESM is not yet compatible on ava 3. I am waiting to upgrade.
- If pornhub is blocked in your country, the API will obviously not work. You will need a proxy.
- Pornhub block the srapper from time to time, I have not found a solution yet.
MIT - Copyright © JUSTAL Kevin