Skip to content

Commit

Permalink
When there are no non-split URLs available, return split URLs.
Browse files Browse the repository at this point in the history
Previously, with `split_videos => 0`, it returned just the audio URL for some videos, which was incorrect.
  • Loading branch information
trizen committed Jan 7, 2024
1 parent 107006a commit 7ed397b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/WWW/YoutubeViewer/Itags.pm
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@ sub find_streaming_url {
if (not defined $streaming) {
foreach my $res (@{$resolutions}) {

if ($res eq 'audio' and $resolution ne 'audio' and !$args{split_videos}) {
return $self->find_streaming_url(%args, split_videos => 1);
}

$streaming = $self->_find_streaming_url(%args, resolution => $res);

if (defined($streaming)) {
Expand Down

0 comments on commit 7ed397b

Please sign in to comment.