WWW::P...Caption(3pm)
π 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
π LICENSE AND COPYRIGHT π
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
- alpine 3.24: pipe-viewer-doc 0.5.3-r0 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms