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

πŸ“¦ version 3.11.6, in alpine 3.24

🌸 NAME 🌸

okay so bestie, this is the WWW::YoutubeViewer::GetCaption page from User Contributed Perl Documentation β€” yup, the one your man viewer files under WWW::Y...aption(3pm). Its whole thing is saving YouTube closed captions as .srt files for a videoID. That's the vibe. πŸ’…


✨ SYNOPSIS ✨

use WWW::YoutubeViewer::GetCaption;

my $yv_cap = WWW::YoutubeViewer::GetCaption->new(%opts);
my $file = $yv_cap->save_caption($videoID);

πŸ¦‹ SUBROUTINES/METHODS πŸ¦‹

new(%opts)

okay so you make a new one with %opts, and here are the options, bestie:

πŸŽ€ Options πŸŽ€

  • captions => [] β€” the captions data. It looks like this:
[
 # ...
   {
     baseUrl => "https://...",
     isTranslatable => '...',
     languageCode => "ru",
     name => { simpleText => "Russian" },
     vssId => ".ru",
   },
 # ...
]
  • captions_dir => "." β€” where to save the closed captions.
  • languages => [qw(en es ro jp)] β€” preferred languages. First found is saved and returned. periodt.

find_caption_data()

Finds a caption data, based on the preferred languages. 🧚

sec2time(@seconds)

Converts a list of seconds to .srt times. ⏱️✨

xml2srt($xml_string)

Converts the XML data to SubRip format. πŸ’…

save_caption($video_ID)

Saves the caption in a .srt file and returns its file path. 🫢

πŸ‘‘ AUTHOR πŸ‘‘

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

🌈 SUPPORT 🌈

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

perldoc WWW::YoutubeViewer::GetCaption

Copyright 2012-2015 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.


xoxo, your Perl bestie 🫢 β€” this was served up by perl v5.42.2, dated 2026-02-15, under the WWW::Y...aption(3pm) label. slay. πŸ’–βœ¨

πŸ“¦ where this page comes from