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

  • 1.0.0
  • Source
  • npm
  • Socket score

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

PORNHUB API

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 and to get the download links.

npm install module-name

Function available

Scraping a page pornhub
async page(url, options)
nametypedescription
urlStringurl of the page
optionsArray or String if there is only one optionList of the options
name of optionreturn 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
Scraping a search page pornhub
async search(value)
nametypedescription
valueStringvalue search in pornhub
optionsArray or String if there is only one optionList of the options
name of optionreturn typedescription
page_XStringX specify the number of page search to scrap
related_searchArrayThe related search
related_pornstarsArrayThe related pornstars

Examples

Scraping the title of a video
const video = await module-name.page(url, ['title']);
{
	"title": "Name of the video"
}
Scraping the title of a video and the description
const video = await module-name.page(url, ['title','description']);
{
	"title": "Name of the video",
	"description": "Description of the video"
}
const video = await module-name.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 video = await module-name.page("Aa");
[{
	"link": "https://p.com/link1",
	"title": "Title of the video",
	"hd": true,
	"author": "Robert",
	"duration": 13000,
	"views": 1200,
	"premium": true,
	"rating": 80
},{
	"link": "https://p.com/link2",
	"title": "Title of the video",
	"hd": false,
	"author": "Ggegwg",
	"duration": 5120,
	"views": 120,
	"premium": false,
	"rating": 60
}]

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.
  • If pornhub is blocked in your country, the API will not work. Keep that in mind.

License

MIT - Copyright © JUSTAL Kevin

Keywords

FAQs

Package last updated on 21 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