We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccbb6f4 commit d5e1cebCopy full SHA for d5e1ceb
lib/WWW/YoutubeViewer.pm
@@ -828,8 +828,16 @@ sub _extract_from_ytdl {
828
foreach my $format (@{$ref->{formats}}) {
829
if (exists($format->{format_id}) and exists($format->{url})) {
830
831
+ my $id = $format->{format_id};
832
+
833
+ # Keep only the default audio track
834
+ if ($id =~ /(^[0-9]+)-[0-9]/) {
835
+ $id = $1;
836
+ $format->{format_note} =~ /\(default\)/ or next;
837
+ }
838
839
my $entry = {
- itag => $format->{format_id},
840
+ itag => $id,
841
url => $format->{url},
842
type => ((($format->{format} // '') =~ /audio only/i) ? 'audio/' : 'video/') . $format->{ext},
843
};
0 commit comments