WWW::P...Caption(3pm)

πŸ“¦ version 0.5.3, in alpine 3.24

🌈 NAME 🌈

okay bestie, welcome to the manual page for WWW::PipeViewer::GetCaption β€” it's filed under the manual name WWW::P...Caption(3pm) in the User Contributed Perl Documentation, and it does one iconic thing: saves YouTube closed captions as .srt files for a videoID. periodt. πŸ’–


✨ SYNOPSIS ✨

like, here's the whole setup:

use WWW::PipeViewer::GetCaption;

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

πŸŽ€ SUBROUTINES/METHODS πŸŽ€

πŸ’… new(%opts) πŸ’…

okay so you make a fresh object with new(%opts) and hand it some options. the options are giving very specific vibes:

Options:

  • captions => [] β€” the captions data. that's it, that's the data.
  • captions_dir => "." β€” where to save the closed captions. default is literally ".". πŸ“
  • languages => [qw(en es ro jp)] β€” preferred languages. first found is saved and returned. no cap.

πŸ”Ž find_caption_data() πŸ”Ž

finds a caption data, based on the preferred languages. lowkey straightforward.

⏰ sec2time(@seconds) ⏰

converts a list of seconds to .srt times. cute.

🧚 xml2srt($xml_string) 🧚

converts the XML data to SubRip format. slay.

πŸ’Ύ save_caption($video_ID) πŸ’Ύ

saves the caption in a .srt file and returns its file path. main character energy, honestly. πŸ‘‘


πŸ‘‘ AUTHOR πŸ‘‘

Trizen, "<echo dHJpemVuQHByb3Rvbm1haWwuY29tCg== | base64 -d>" β€” that's the author line, encoded bestie and all. 🫢


🫢 SUPPORT 🫢

you can find documentation for this module with the perldoc command. just run:

perldoc WWW::PipeViewer::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.


mwah πŸ’‹ this page is from perl v5.42.2, dated 2024-09-28, and the manual name is WWW::P...Caption(3pm). bye bestie! 🌸

πŸ“¦ where this page comes from