File::TVShow::Info - Perl meta data extractor from file name for TV Show file.
Version 0.01.0.1
This module is intended to identify and extract nformation in the file name of a TV show. These details can then be accessed by calling the relevant methods. It does NOT attempt to read the contents of the file.
Note: This module will be modelled off https://metacpan.org/pod/Video::Filename created by Behan Webster, but will focus on TV Shows only and with additional features.
If the file name is parsed and can not be identified as a TV show then "is_tv_show" will return 0.
use File::TVShow::Info; my $show = File::TVShow::Info->new('file');
Create a Info object to extract meta information from the file name.
my $show = File::TVShow::Info->new('file');
Attributes may be accessed through $show->{attribute_name} however methods do exist for all required operations.
show_name: Name of the show.
original_show_name: This will contain the show name found in the file name without any modifications. This will only be defined if _isolate_name_year has found a year string within the file name such as name.2019, name.(2019), name 2018, name (2018)
season: Show season
episode: Show episode
episode_name
country
endep: (Naming under consideration) last Episode number found when file name contains SXXEXXEXX
year, month, date: Show date e.g 2019.03.03 This can be accessed using the method "ymd" Note: year will be defined in two cases. One: show name contains year. show_name.yyyy or Two: File name contains YYYY.MM.DD that are identified by date. These are mutually exclusive and no conflict is expected.
source
resolution: Show resolution 480p/720p and so on. This will be '' if not found.
release_group
is_subtitle
subtitle_lang
ext: File extension
Return the show name found in the file name.
Return show_name after removing string delimiters
Return complete show name with year and country in brackets if they exist. Also remove any delimiters, replaced with spaces
Return the original show name.
This method will return the orginal show name if original_show_name is defined. This will be defined if show_name contains a year string (YYYY) or YYYY
If not defined it will return {show_name}
Return the season found in the file name. Return '' if {season} is not defined.
Return season as an integer
Return the episode found in the file name. Return '' if {episode} is not defined.
Return episode as an integer
Return the source of tv show. Return '' if not defined. Yet to be coded.
Return 1 if this is a multi-episode file SXXEXXEXX. Return 0 if false
This is true if {endep} is defined.
Return SXXEXX or SXXEXXEXX for single or multi episode files. Return '' if not created
This would only return an empty string if the show_name is not formated as show_name.SXX.*
Return 1 if year is defined else return 0
Return the year found in the file name. Return '' if {year} is not defined.
Return the month found in the file name. Return '' if {month} is not defined.
Return the date found in the file name. Return '' if {date} is not defined.
Return the complete date string as 'YYYY.MM.DD' Ruturn '' if attributes {year}, {month}, and {date} are not defined.
Return resolution found in the file name. Return '' if {resolution} is not defined.
Return release_group found in the file name. Return '' if {release_group} is not defined.
Return episode_name. Return '' if {extra_meta} is not defined or can not determine episode name.
Note: episode name MUST directly follow SXXEXX or it can not be found.
Return episode name without delimiters.
Return country found in {show_name}. Return '' if not defined
Return file extension. {ext}
Return 1 if identified as a TV Show. Default is 0
Return 1 if the file is a subtitle file, 0 if {is_subtitle} is not defined.
The file must also return true for is_tv_show() or the result is 0
Return 1 if subtitle language was found, Return 0 if {subtitle_lang} is not defined.
Must also return 1 for is_tv_subtitle()
Return the language of the subtitle file: eng or en. Return '' if {subtitle_lang} is not defined.
Return 1 if country was found, Return 0 if {country} is not defined.
Return 1 if by date. Default is 0
This will be true where year, month and date are all defined. show_name.yyyy.mm.dd.ext
Return 1 if by season. Default is 0
Requires {season} and {episode} to be defined.
Adam Spann, <bans at cpan.org>
<bans at cpan.org>
Please report any bugs or feature requests to bug-file-tvshow-info at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-TVShow-Info. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-file-tvshow-info at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc File::TVShow::Info
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=File-TVShow-Info
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/File-TVShow-Info
CPAN Ratings
https://cpanratings.perl.org/d/File-TVShow-Info
Search CPAN
https://metacpan.org/release/File-TVShow-Info
Copyright 2019 Adam Spann.
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 File::TVShow::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::TVShow::Info
CPAN shell
perl -MCPAN -e shell install File::TVShow::Info
For more information on module installation, please visit the detailed CPAN module installation guide.