WWW::SubDB - Interface to thesubdb.com API
Version 0.01
This module is an interface to http://thesubdb.com API. It allows to search and download subtitles based on movie file hashes.
use WWW::SubDB; my $subdb = WWW::SubDB->new(); ...
my $subdb = WWW::SubDB->new() my $subdb = WWW::SubDB->new( debug => 1 )
Initializes the object, with debug = 1, the sandbox SubDB API will be used
my $lang = $subdb->languages()
Returns the list of languages supported by SubDB. The result is a string with languages separated by (,). Ex: en,es,fr,it,nl,pl,pt,ro,sv,tr
my $file = 'movie.mp4' my $result = $subdb->languages($file [,$versions])
Returns a list of available subtitle languages for a given file. if $versions is set to 1, returns the number of available versions for each language. If there are no subtitles available, it will return undef.
my $file = 'movie.mp4'; my $langs = 'en,pt'; my $subtitle = $subdb->download($file, $langs);
Return the subtitle for a given movie. It will return the first language found according to $langs. Will return undef if not found.
my $file = 'movie.mp4'; my $subtitle = 'movie.srt'; my $uploaded = $subdb->upload($file, $subtitle);
Will upload the subtitle file for the the given movie file.
$subdb->http_status()
Will show the last HTTP status code
$subdb->error()
Will show the last HTTP status line in case there was an error
Bruno Martins, <=bscmartins at gmail.com>
<=bscmartins at gmail.com>
https://twitter.com/b_martins
https://github.com/bmartins
Please report any bugs or feature requests at https://github.com/bmartins/WWW-SubDB
You can find documentation for this module with the perldoc command.
perldoc WWW::SubDB
Copyright 2016 Bruno Martins.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install WWW::SubDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::SubDB
CPAN shell
perl -MCPAN -e shell install WWW::SubDB
For more information on module installation, please visit the detailed CPAN module installation guide.