WebService::Pornhub - Perl interface to the Pornhub.com API.
use WebService::Pornhub; my $pornhub = WebService::Pornhub->new; # Search videos from Pornhub API my $videos = $pornhub->search( search => 'hard', 'tags[]' => ['asian', 'young'], thumbsizes => 'medium', ); # Response is Array reference, Perl data structures for my $video (@$videos) { say $video->{title}; say $video->{url}; }
WebService::Pornhub provides bindings for the Pornhub.com API. This module build with role WebService::Client.
my $pornhub = WebService::Pornhub->new( timeout => 20, # optional, defaults to 10 logger => Log::Fast->new(...), # optinal, defaults to none log_method => 'DEBUG', # optional, default to 'DEBUG' );
Prameters:
timeout: (Optional) Integer. Defaults to 10
10
retries: (Optional) Integer. Defaults to 0
0
logger: (Optional) Log module instance, such modules as Log::Tiny, Log::Fast, etc.
log_method: (Optional) Text. Defaults to DEBUG
DEBUG
my $videos = $pornhub->search( search => 'hard', 'tags[]' => ['asian', 'young'], thumbsizes => 'medium', );
Parameters:
category: (Optional)
page: (Optional) Integer
search: (Optional) Text
phrase[]: (Optional) Array. Used as pornstars filter.
tags[]: (Optional) Array
ordering: (Optional) Text. Possible values are featured, newest, mostviewed and rating
period: (Optional) Text. Only works with ordering parameter. Possible values are weekly, monthly, and alltime
thumbsize: (Required). Possible values are small,medium,large,small_hd,medium_hd,large_hd
my $video = $pornhub->get_video( id => '44bc40f3bc04f65b7a35', thumbsize => 'medium', );
id: (Required) Integer
thumbsize: (Optional) If set, provides additional thumbnails in different formats. Possible values are small,medium,large,small_hd,medium_hd,large_hd
my $embed = $pornhub->get_embed_code( id => '44bc40f3bc04f65b7a35', );
my $videos = $pornhub->get_deleted_videos( page => 3, );
page: (Required) Integer
my $active = $pornhub->is_video_active( is => '44bc40f3bc04f65b7a35', );
my $categories = $pornhub->get_categories();
There are no parameters for this method.
my $tags = $pornhub->get_tags( list => 'a', );
list: a-z for tag starting letter, 0 for other.
my $stars = $pornhub->get_stars();
my $stars = $pornhub->get_stars_detailed();
WebService::Client
pornhub-api - npm
Copyright (C) Yusuke Wada.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Yusuke Wada <yusuke@kamawada.com>
To install WebService::Pornhub, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Pornhub
CPAN shell
perl -MCPAN -e shell install WebService::Pornhub
For more information on module installation, please visit the detailed CPAN module installation guide.