GithubHelp home page GithubHelp logo

lucasleandro1204 / pornsearch Goto Github PK

View Code? Open in Web Editor NEW
302.0 45.0 64.0 284 KB

Easy way to search for porn content!

License: MIT License

JavaScript 100.00%
porn pornhub search nsfw boobs gifs gif xvideos redtube sex

pornsearch's Introduction

Pornsearch

js-semistandard-style

Easy way to search for porn content

If you have any suggestions of a website, open an issue!

Simple search

You can do it in two ways:

const Pornsearch = require('pornsearch');
const Searcher = new Pornsearch('tits');

Searcher.videos()
  .then(videos => console.log(videos));
// using import
import Pornsearch from 'pornsearch';

const Searcher = new Pornsearch('tits');

Searcher.videos()
  .then(videos => console.log(videos));

or (my favourite)

const Pornsearch = require('pornsearch').search('ass');

Pornsearch.gifs()
  .then(gifs => console.log(gifs));

Support

Basic search

Site (Module name) Videos Gifs
pornhub X X
sex X X
redtube X
xvideos X
youporn X
motherless X

Videos structure

What will return in video search

Site (Module name) Title Url Thumbnail Duration
pornhub X X X X
sex X X X X
redtube X X X X
xvideos X X X X
youporn X X X X
motherless X X X X

Gifs structure

What will return in gif search

Site (Module name) Title Url Webm
pornhub X X X
sex X X

Installation

Via NPM:

$ npm install pornsearch

Via GIT:

$ git clone git://github.com/LucasLeandro1204/api.git node_modules/pornsearch

Usage

There's two ways to use Pornsearch:

You can create a new instance with two parameters: the first one is the query, what you want to search, the second one is the driver (Pornhub default).

const Pornsearch = require('pornsearch');
const Searcher = new Pornsearch(query, driver = 'pornhub');
// Using import
import Pornsearch from 'pornsearch';

const Searcher = new Pornsearch(query, driver = 'pornhub');

Or you can use the static search method, but you can pass only the query, the driver will be pornhub.

const Pornsearch = require('pornsearch').search(query);

But you always can change the current driver:

Pornsearch.driver(driver);

An error will be thrown if Pornsearch don't support the driver you passed in

To know the current driver

Pornsearch.current();

Search

It's easy to search for porn content with Pornsearch =)

Check the support table to know what you can do

Pornsearch.videos()
  .then(videos => console.log(videos)
  .then(() => Pornsearch.gifs())
  .then(gifs => console.log(gifs));

Specify the page to search on

Pornsearch.gifs(3);

Change de query

Pornsearch.search('pussy')
  .gifs()
  .then(gifs => console.log(gifs));

Log only url

Pornsearch.gifs(3)
  .then(gifs => console.log(gifs.map(gif => gif.url)));

Output

Videos

To know what the current driver will return in video search check the videos structure

Gifs

To know what the current driver will return in gif search check the gifs structure

PORNHUB gifs in general are extremely heavy, so be a nice person and share webm (sex.com gifs are nice)

If has error in whenever search, will be throw an error:

No results for search related to *query* in page *page*

pornsearch's People

Contributors

favna avatar lucasleandro1204 avatar nirewen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pornsearch's Issues

Webpack setup

We have to setup a webpack bundle, so it can be translated to older javascript and then we can use Imports instead of require.

Ability to check how much pages/results for each search

Umm this isn't really like a suggestion that you might be looking for, but like it would be cool if we can check how much pages and number of results each search returns. Like im using it to make it pull out a random webm each search, but if it hits a page number that exceeds the page number, or it hits a number that exceeds the number of search results, it errors lol.

'Sex' provider return forbidden gifs Urls

On call .gifs() with. provider = 'Sex' all urls returns forbidden

PornDriver.driver('sex').gifs()

The url field returned is not working , it looks there is some kind of restriction with this provider

Why is it page related

is/ will there be a function where the results aren't related to any page, so it can take them off all the pages?

driver not defined

This is my current code:

const Pornsearch = require('pornsearch');
const Searcher = new Pornsearch(args.slice().join(' '), driver = 'redtube');

I am getting the error:
ReferenceError: driver is not defined

How to fix this?

Thanks!

Queries with multiple words are crashing with the Pornhub module

When I tried to make a search with multiple tags it crashed telling me that "replace" was undefined.

To be precise, it's in Porhub.js at line 75.

   thumb: data.find('img').attr('data-mediumthumb').replace(/\([^)]*\)/g, ''),

I'd guess the regex in the Gif part would do the same error but I'm not using it...

In any case, for now I just had to remove the replace part and deal with it...

.

.

Video date?

is there any way to add when the video was posted? or sort it by the date?

Thanks

how to search on Pagination

this project awesome . i have problem how to search method . i want parameter on_page . example on_page = 2

this result only show in page 1 . how to search on page 2 - last page

const fs = require('fs');
const Pornsearch = require('pornsearch');
const Searcher = new Pornsearch('tiger benson', driver = 'xvideos');

Searcher.videos(1)
  .then(videos => {

Added "https://porngifs.xxx/" since "https://www.sex.com/gifs/" gifs doesn't work

Modules.js

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _Sex = require('../modules/Sex');

var _Sex2 = _interopRequireDefault(_Sex);

var _Porngifs = require('../modules/Porngifs');

var _Porngifs2 = _interopRequireDefault(_Porngifs);

var _Pornhub = require('../modules/Pornhub');

var _Pornhub2 = _interopRequireDefault(_Pornhub);

var _Redtube = require('../modules/Redtube');

var _Redtube2 = _interopRequireDefault(_Redtube);

var _Xvideos = require('../modules/Xvideos');

var _Xvideos2 = _interopRequireDefault(_Xvideos);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = {
  sex: _Sex2.default,
  porngifs: _Porngifs2.default,
  pornhub: _Pornhub2.default,
  redtube: _Redtube2.default,
  xvideos: _Xvideos2.default
};
module.exports = exports['default'];

Add Porngifs.js to the "modules" folder.

'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');

var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _GifMixin = require('../core/GifMixin');

var _GifMixin2 = _interopRequireDefault(_GifMixin);

var _VideoMixin = require('../core/VideoMixin');

var _VideoMixin2 = _interopRequireDefault(_VideoMixin);

var _AbstractModule = require('../core/AbstractModule');

var _AbstractModule2 = _interopRequireDefault(_AbstractModule);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Porngifs = function (_AbstractModule$with) {
    (0, _inherits3.default)(Porngifs, _AbstractModule$with);

    function Porngifs() {
        (0, _classCallCheck3.default)(this, Porngifs);
        return (0, _possibleConstructorReturn3.default)(this, (Porngifs.__proto__ || (0, _getPrototypeOf2.default)(Porngifs)).apply(this, arguments));
    }

    (0, _createClass3.default)(Porngifs, [{
        key: 'gifUrl',
        value: function gifUrl(page) {
            return 'https://porngifs.xxx/page' + (page || this.firstpage + '/' + '?s=' + this.query);
        }
    }, {
        key: 'gifParser',
        value: function gifParser($) {
            var gifs = $('#masonry_container .masonry_box').not('.ad_box');

            return gifs.map(function (i, gif) {
                var data = $(gif).find('a.image_wrapper');
                var title = data.attr('title');
                var url = data.find('img').data('gif');

                if (!title || !url) {
                    return;
                }

                return {
                    title: title,
                    url: url
                };
            }).get();
        }
    }, {
        key: 'name',
        get: function get() {
            return 'Porngifs';
        }
    }, {
        key: 'firstpage',
        get: function get() {
            return 1;
        }
    }]);
    return Porngifs;
}(_AbstractModule2.default.with(_GifMixin2.default, _VideoMixin2.default));

exports.default = Porngifs;
module.exports = exports['default'];

Driver will be called porngifs

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.