.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "WWW::PipeViewer::Utils 3" .TH WWW::PipeViewer::Utils 3 "2025-05-08" "perl v5.34.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" WWW::PipeViewer::Utils \- Various utils. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use WWW::PipeViewer::Utils; \& \& my $yv_utils = WWW::PipeViewer::Utils\->new(%opts); \& \& print $yv_utils\->format_time(3600); .Ve .SH "SUBROUTINES/METHODS" .IX Header "SUBROUTINES/METHODS" .SS "new(%opts)" .IX Subsection "new(%opts)" Options: .ie n .IP "thousand_separator => """"" 4 .el .IP "thousand_separator => ``''" 4 .IX Item "thousand_separator => """"" Character used as thousand separator. .IP "months => []" 4 .IX Item "months => []" Month names for \fI\f(BIformat_date()\fI\fR .ie n .IP "youtube_video_url_format => """"" 4 .el .IP "youtube_video_url_format => ``''" 4 .IX Item "youtube_video_url_format => """"" A video YouTube \s-1URL\s0 format for sprintf(format, videoID). .ie n .IP "youtube_channel_url_format => """"" 4 .el .IP "youtube_channel_url_format => ``''" 4 .IX Item "youtube_channel_url_format => """"" A channel YouTube \s-1URL\s0 format for sprintf(format, channelID). .ie n .IP "youtube_playlist_url_format => """"" 4 .el .IP "youtube_playlist_url_format => ``''" 4 .IX Item "youtube_playlist_url_format => """"" A playlist YouTube \s-1URL\s0 format for sprintf(format, playlistID). .SS "extension($type)" .IX Subsection "extension($type)" Returns the extension format from a given type. .PP From a string like 'video/webm;+codecs=\*(L"vp9\*(R"', it returns 'webm'. .SS "format_time($sec)" .IX Subsection "format_time($sec)" Returns time from seconds. .SS "format_duration($duration)" .IX Subsection "format_duration($duration)" Return seconds from duration (\s-1PT1H20M10S\s0). .SS "format_date($date)" .IX Subsection "format_date($date)" Return string \*(L"04 May 2010\*(R" from \*(L"2010\-05\-04T00:25:55.000Z\*(R" .SS "date_to_age($date)" .IX Subsection "date_to_age($date)" Return the (approximated) age for a given date of the form \*(L"2010\-05\-04T00:25:55.000Z\*(R". .SS "get_entries($result)" .IX Subsection "get_entries($result)" Returns the entries for a given result. .SS "has_entries($result)" .IX Subsection "has_entries($result)" Returns true if a given result has entries. .ie n .SS "normalize_filename($title, $fat32safe)" .el .SS "normalize_filename($title, \f(CW$fat32safe\fP)" .IX Subsection "normalize_filename($title, $fat32safe)" Replace file-unsafe characters and trim spaces. .SS "format_text(%opt)" .IX Subsection "format_text(%opt)" Formats a text with information from streaming and video info. .PP The structure of \f(CW%opt\fR is: .PP .Vb 7 \& ( \& streaming => HASH, \& info => HASH, \& text => STRING, \& escape => BOOL, \& fat32safe => BOOL, \& ) .Ve .SS "set_thousands($num)" .IX Subsection "set_thousands($num)" Return the number with thousand separators. .SS "get_video_id($info)" .IX Subsection "get_video_id($info)" Get videoID. .SS "get_description($info)" .IX Subsection "get_description($info)" Get description. .SS "get_title($info)" .IX Subsection "get_title($info)" Get title. .SS "get_thumbnail($info;$xsize,$ysize)" .IX Subsection "get_thumbnail($info;$xsize,$ysize)" Get smallest thumbnail of at least ${xsize}x${ysize}. .SH "AUTHOR" .IX Header "AUTHOR" Trizen, \f(CW\*(C`\*(C'\fR .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc WWW::PipeViewer::Utils .Ve .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2012\-2020 Trizen. .PP This program is free software; you can redistribute it and/or modify it under the terms of either: the \s-1GNU\s0 General Public License as published by the Free Software Foundation; or the Artistic License. .PP See for more information.