GithubHelp home page GithubHelp logo

classicvalues / pornhub Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zachbrowne/pornhub

0.0 0.0 0.0 14 KB

Access pornhub.com (WARNING: NSFW) programmatically with Node.JS.

License: Other

JavaScript 100.00%

pornhub's Introduction

pornhub

Access pornhub (WARNING: NSFW) programmatically with Node.JS. Uses hubtraffic.com (go signup!)

Overview

This module scrapes the HTML of pornhub.com and gives you information you can use in your node programs!

Super Quickstart

var ph = require("pornhub");

ph.details("http://www.pornhub.com/view_video.php?viewkey=591533139", function(err, details) {
  console.log(err, details);
});

Installation

Available via npm:

$ npm install pornhub

Or via git:

$ git clone git://github.com/electblake/pornhub.git node_modules/pornhub

Usage

The pornhub package exports a single documented function right now, details.

pornhub API

details

Gets details about a specific video.

ph.details(uri, cb);
// get details about a video
ph.details("http://www.pornhub.com/view_video.php?viewkey=591533139", function(err, details) {
  console.log(err, details);
});

Arguments

  • uri - a full url to an pornhub video page
  • cb - a callback to be called in the normal node way with an error (or null) and the video details

search

Performs a search and returns the results. parameters is an object that is used to construct the query string for the search URL.

Available parameters are:

  • category (Optional)

  • page (Optional) Integer

  • search (Optional) Text

  • stars (Optional) Array

  • tags (Optional) Array

  • thumbsize (Required). Possible values are small,medium,large,small_hd,medium_hd,large_hd

signup for hubtraffic.com and see method searchVideos for details

ph.search(parameters, cb);
// get details about a video
ph.search({search: "hard", tags: ["teen"], thumbsize: "medium"}, function(err, results) {
  console.log(err, results);
});

Arguments

  • parameters - an object containing parameters for the query string (see above for details about its properties)
  • cb - a callback to be called in the normal node way with an error (or null) and the search results

Example

Also see example.js.

#!/usr/bin/env node

var xv = require("pornhub");

// get details about a video
xv.details("http://www.pornhub.com/video3823160/stranded_busty_sweetie_decides_to_have_sex_with_a_stranger_in_public_for_money", function(err, details) {
  console.log(err, details);
});

Output (example):

null { title: 'Stranded busty sweetie decides to have sex with a stranger in public for money',
  duration: '5 min',
  tags:
   [ 'amateur',
     'bigtits',
     'brunette',
     'busty',
     'european',
     'flashing',
     'hardcore',
     'money',
     'outdoor',
     'POV',
     'public' ],
  flv: 'http://porn.im.cbce7ca3.3823160.x.pornhub.com/videos/flv/f/e/6/pornhub.com_fe6e41a62c4162b6b9ff750620acf599.flv?e=1366800046&ri=1024&rs=85&h=2cf1096659393b4c153b7cdfe93a8889',
  thumb: 'http://img-l3.pornhub.com/videos/thumbslll/fe/6e/41/fe6e41a62c4162b6b9ff750620acf599/fe6e41a62c4162b6b9ff750620acf599.23.jpg',
  html: '<iframe src="http://flashservice.pornhub.com/embedframe/3823160" frameborder=0 width=510 height=400 scrolling=no></iframe>' }

License

3-clause BSD. A copy is included with the source.

Contact

pornhub's People

Contributors

asleepwalker avatar deoxxa avatar electblake avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.