New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@justalk/pornhub-api

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@justalk/pornhub-api

Very complete scrapper for the famous porn website pornhub

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

PORNHUB API

Last version npm Last version Node version Travis Coverage Status Dependency status Last version

Star the project

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

Features

  • 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.

API

Video page pornhub

Function available for a page
async page(url, options)
nametypedescription
urlStringurl of the page
keysArrayList of the keys
Lists of keys available for a page
name of keyreturn typedescription
titleStringTitle
descriptionStringDescription
viewsNumberNumber total of views
up_votesNumberNumber of up vote
down_votesNumberNumber of down vote
percentNumberPercent of up vote
authorStringName of the uploader
author_subscriberNumberNumber of subscriber of the uploader
pornstarsArrayNames of the pornstars
categoriesArrayList of the names of the categories
tagsArrayList of the names of the tags
productionStringType of production
durationNumberDuration in second
number_of_commentNumberTotal number of comments
thumbnailStringUrl of the thumbnail
upload_dateDateDate of upload
download_urlsObjectList of download link by quality
commentsObjectList of comments with additionnals informations

Search page pornhub

async search(value)
nametypedescription
valueStringvalue search in pornhub
keysArray or String if there is only one optionList of the keys
optionsArrayList of the optional options
name of optionsreturn typedescription
pageNumberNumber of page to scraper
productionStringType of production targeted : homemade or professional
searchStringType of search targeted : video or pornstars
Lists of keys available for a search by title
name of keysreturn typedescription
linkStringLink of the videos
titleStringTitle of the videos
durationNumberDuration in seconds
viewsNumberNumber total of views
premiumBooleanTrue if the video is premium, false if else
authorStringAuthor of the video
ratingsNumberPositive rating of the video in percentage
name of keysreturn typedescription
actorStringName of the actor
video_numberNumberNumber of video of the actor
view_numberNumberNumber of view of the actor
rankNumberRank of the actor

Examples

Scraping the title of a video
const pornhub = require('@latsuj/pornhub-api');
const video = await pornhub.page(url, ['title']);
{
	"title": "Name of the video"
}
Scraping the title of a video and the description
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"
	}
}
Scraping a search pornhub without options
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
}]
Scraping a search pornhub with options
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
}]

How to test

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

Note

  • 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.

License

MIT - Copyright © JUSTAL Kevin

Keywords

FAQs

Package last updated on 30 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc