aboutsummaryrefslogtreecommitdiffstats
path: root/lib/WWW/FairViewer/GetCaption.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/WWW/FairViewer/GetCaption.pm')
-rw-r--r--lib/WWW/FairViewer/GetCaption.pm16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/WWW/FairViewer/GetCaption.pm b/lib/WWW/FairViewer/GetCaption.pm
index 710a2af..d919fe9 100644
--- a/lib/WWW/FairViewer/GetCaption.pm
+++ b/lib/WWW/FairViewer/GetCaption.pm
@@ -182,17 +182,6 @@ sub xml2srt {
return join("\n\n", @text);
}
-=head2 get_xml_data($caption_data)
-
-Get the XML content for a given caption data.
-
-=cut
-
-sub get_xml_data {
- my ($self, $url) = @_;
- $self->{yv_obj}->lwp_get($url, simple => 1);
-}
-
=head2 save_caption($video_ID)
Save the caption in a .srt file and return its file path.
@@ -213,8 +202,9 @@ sub save_caption {
return $srt_file if (-e $srt_file);
# Get XML data, then transform it to SubRip data
- my $xml = $self->get_xml_data($info->{baseUrl} // return) // return;
- my $srt = $self->xml2srt($xml) // return;
+ my $url = $info->{baseUrl} // return;
+ my $xml = $self->{yv_obj}->lwp_get($url, simple => 1) // return;
+ my $srt = $self->xml2srt($xml) // return;
# Write the SubRib data to the $srt_file
open(my $fh, '>:utf8', $srt_file) or return;