WWW::Y...::Utils(3pm)

πŸ“¦ version 3.11.6, in alpine 3.24

🌸 NAME 🌸

okay so this is the WWW::Y...::Utils(3pm) page β€” User Contributed Perl Documentation, bestie β€” for WWW::YoutubeViewer::Utils, and it is literally Various utils. That’s the whole vibe: little helper routines doing their thing.


✨ SYNOPSIS ✨

The starter pack is exactly this:

use WWW::YoutubeViewer::Utils;

my $yv_utils = WWW::YoutubeViewer::Utils->new(%opts);

print $yv_utils->format_time(3600);

No cap, that print is serving format_time(3600) realness. πŸ’…


πŸŽ€ SUBROUTINES/METHODS πŸŽ€

πŸ’– new(%opts)

The new(%opts) situation comes with these options:

  • thousand_separator => "" β€” character used as thousand separator.
  • months => [] β€” month names for format_date().
  • youtube_url_format => "" β€” a youtube URL format for sprintf(format, videoID).

πŸ“¦ extension($type)

Returns the extension format from a given type.

Like, hand it a string like 'video/webm;+codecs="vp9"' and it returns 'webm' β€” just the extension part, periodt.

⏰ format_time($sec)

Returns time from seconds. That’s the whole thing. The synopsis uses 3600, iykyk.

πŸ•°οΈ format_duration($duration)

Return time (01:20:10) from duration (PT1H20M10S). So yeah: duration string in, time string out.

πŸ“… format_date($date)

Return string "04 May 2010" from "2010-05-04T00:25:55.000Z". It’s giving date glow-up. ✨

πŸ§“ date_to_age($date)

Return the (approximated) age for a given date of the form "2010-05-04T00:25:55.000Z".

βœ… has_entries($result)

Returns true if a given result has entries. Simple vibe check.

🧼 normalize_filename($title, $fat32safe)

Replace file-unsafe characters and trim spaces. That’s the cleanup era, bestie.

πŸ“ format_text(%opt)

Formats a text with information from streaming and video info.

The structure of %opt is:

(
    streaming => HASH,
    info      => HASH,
    text      => STRING,
    escape    => BOOL,
    fat32safe => BOOL,
)

πŸ”’ set_thousands($num)

Return the number with thousand separators.

🎬 get_video_id($info)

Get videoID.

πŸ“„ get_description($info)

Get description.

🏷️ get_title($info)

Get title.

πŸ–ΌοΈ get_thumbnail_url($info;$type='default')

Get thumbnail URL.


🫢 AUTHOR 🫢

Author: Trizen, "<echo dHJpemVuQHByb3Rvbm1haWwuY29tCg== | base64 -d>".


πŸ’œ SUPPORT πŸ’œ

You can find documentation for this module with the perldoc command.

perldoc WWW::YoutubeViewer::Utils

Copyright 2012-2020 Trizen.

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 <https://dev.perl.org/licenses/> for more information.


cute sign-off: this page is from perl v5.42.2, dated 2026-02-15, and it’s the WWW::Y...::Utils(3pm) manual. byeee, bestie πŸ’…πŸ’–

πŸ“¦ where this page comes from