项目作者: yusukebe

项目描述 :
Perl interface to the Pornhub.com API.
高级语言: Perl
项目地址: git://github.com/yusukebe/p5-WebService-Pornhub.git
创建时间: 2020-01-19T22:09:23Z
项目社区:https://github.com/yusukebe/p5-WebService-Pornhub

开源协议:Other

下载


NAME

WebService::Pornhub - Perl interface to the Pornhub.com API.

SYNOPSIS

  1. use WebService::Pornhub;
  2. my $pornhub = WebService::Pornhub->new;
  3. # Search videos from Pornhub API
  4. my $videos = $pornhub->search(
  5. search => 'hard',
  6. 'tags[]' => ['asian', 'young'],
  7. thumbsizes => 'medium',
  8. );
  9. # Response is Array reference, Perl data structures
  10. for my $video (@$videos) {
  11. say $video->{title};
  12. say $video->{url};
  13. }

DESCRIPTION

WebService::Pornhub provides bindings for the Pornhub.com API. This module build with role WebService::Client.

METHODS

new

  1. my $pornhub = WebService::Pornhub->new(
  2. timeout => 20, # optional, defaults to 10
  3. logger => Log::Fast->new(...), # optinal, defaults to none
  4. log_method => 'DEBUG', # optional, default to 'DEBUG'
  5. );

Prameters:

  • timeout: (Optional) Integer. Defaults to 10
  • retries: (Optional) Integer. Defaults to 0
  • logger: (Optional) Log module instance, such modules as Log::Tiny, Log::Fast, etc.
  • log_method: (Optional) Text. Defaults to DEBUG
  1. my $videos = $pornhub->search(
  2. search => 'hard',
  3. 'tags[]' => ['asian', 'young'],
  4. thumbsizes => 'medium',
  5. );

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

get_video

  1. my $video = $pornhub->get_video(
  2. id => '44bc40f3bc04f65b7a35',
  3. thumbsize => 'medium',
  4. );

Parameters:

  • 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

get_embed_code

  1. my $embed = $pornhub->get_embed_code(
  2. id => '44bc40f3bc04f65b7a35',
  3. );

Parameters:

  • id: (Required) Integer

get_deleted_videos

  1. my $videos = $pornhub->get_deleted_videos(
  2. page => 3,
  3. );

Parameters:

  • page: (Required) Integer

is_video_active

  1. my $active = $pornhub->is_video_active(
  2. is => '44bc40f3bc04f65b7a35',
  3. );

Parameters:

  • id: (Required) Integer

get_categories

  1. my $categories = $pornhub->get_categories();

There are no parameters for this method.

get_tags

  1. my $tags = $pornhub->get_tags(
  2. list => 'a',
  3. );

Parameters:

  • list: a-z for tag starting letter, 0 for other.

get_stars

  1. my $stars = $pornhub->get_stars();

There are no parameters for this method.

get_stars_detailed

  1. my $stars = $pornhub->get_stars_detailed();

There are no parameters for this method.

SEE ALSO

LICENSE

Copyright (C) Yusuke Wada.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

AUTHOR

Yusuke Wada yusuke@kamawada.com