Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- youtubedown-20151118.pl 2015-11-18 16:14:11.785899942 -0500
- +++ youtubeaudio-20151118.pl 2015-11-18 16:27:18.357897536 -0500
- @@ -2636,7 +2636,7 @@
- } @$S;
- }
- - my $vfmt = undef;
- +# my $vfmt = undef;
- my $afmt = undef;
- my $mfmt = undef;
- @@ -2654,12 +2654,12 @@
- # pre-muxed format.
- #
- if (defined($force_fmt) && $force_fmt eq 'mux') {
- - foreach my $target (@pref_vo) {
- - if ($fmts->{$target}) {
- - $vfmt = $target;
- - last;
- - }
- - }
- +# foreach my $target (@pref_vo) {
- +# if ($fmts->{$target}) {
- +# $vfmt = $target;
- +# last;
- +# }
- +# }
- foreach my $target (@pref_ao) {
- if ($fmts->{$target}) {
- $afmt = $target;
- @@ -2670,40 +2670,40 @@
- # If we got one of the formats and not the other, this isn't going to
- # work. Fall back on pre-muxed.
- #
- - if (($vfmt || $afmt) && !($vfmt && $afmt)) {
- - print STDERR "$progname: $id: found " .
- - ($vfmt ? 'video-only' : 'audio-only') . ' but no ' .
- - ($afmt ? 'video-only' : 'audio-only') . " formats.\n"
- - if ($verbose > 1);
- - $vfmt = undef;
- - $afmt = undef;
- - }
- + # if (($vfmt || $afmt) && !($vfmt && $afmt)) {
- + # print STDERR "$progname: $id: found " .
- + # ($vfmt ? 'video-only' : 'audio-only') . ' but no ' .
- + # ($afmt ? 'video-only' : 'audio-only') . " formats.\n"
- + # if ($verbose > 1);
- + # $vfmt = undef;
- + # $afmt = undef;
- + # }
- # If the best unmuxed format is not better resolution than the best
- # pre-muxed format, just use the pre-muxed version.
- #
- - if ($mfmt &&
- - $vfmt &&
- - $known_formats{$vfmt}->{h} <= $known_formats{$mfmt}->{h}) {
- - print STDERR "$progname: $id: rejecting $vfmt + $afmt (" .
- - $known_formats{$vfmt}->{w} . " x " .
- - $known_formats{$vfmt}->{h} . ") for $mfmt (" .
- - $known_formats{$mfmt}->{w} . " x " .
- - $known_formats{$mfmt}->{h} . ")\n"
- - if ($verbose > 1);
- - $vfmt = undef;
- - $afmt = undef;
- - }
- + # if ($mfmt &&
- + # $vfmt &&
- + # $known_formats{$vfmt}->{h} <= $known_formats{$mfmt}->{h}) {
- + # print STDERR "$progname: $id: rejecting $vfmt + $afmt (" .
- + # $known_formats{$vfmt}->{w} . " x " .
- + # $known_formats{$vfmt}->{h} . ") for $mfmt (" .
- + # $known_formats{$mfmt}->{w} . " x " .
- + # $known_formats{$mfmt}->{h} . ")\n"
- + # if ($verbose > 1);
- + # $vfmt = undef;
- + # $afmt = undef;
- + # }
- # At this point, we're definitely intending to mux.
- # But maybe we can't because there's no ffmpeg -- if so, print
- # a warning, then fall back to a lower resolution stream.
- #
- - if ($vfmt && $afmt && !which ("ffmpeg")) {
- + if ($afmt && !which ("ffmpeg")) {
- print STDERR "$progname: WARNING: $id: \"ffmpeg\" not installed.\n";
- print STDERR "$progname: $id: downloading lower resolution.\n";
- - $vfmt = undef;
- +# $vfmt = undef;
- $afmt = undef;
- }
- }
- @@ -2734,14 +2734,14 @@
- }
- }
- - if ($vfmt && $afmt) {
- + if ($afmt) {
- if ($verbose > 1) {
- - my $d1 = $known_formats{$vfmt}->{desc};
- +# my $d1 = $known_formats{$vfmt}->{desc};
- my $d2 = $known_formats{$afmt}->{desc};
- - foreach ($d1, $d2) { s@ [av]/?o$@@si; }
- - print STDERR "$progname: $id: picked $vfmt + $afmt ($d1 + $d2)\n";
- + foreach ($d2) { s@ [av]/?o$@@si; }
- + print STDERR "$progname: $id: picked $afmt ($d2)\n";
- }
- - return ($vfmt, $afmt);
- + return ($afmt);
- } else {
- # Either not muxing, or muxing not available/necessary.
- my $why = 'picked';
- @@ -3376,6 +3376,7 @@
- # the two originals.
- #
- sub mux_downloaded_files($$$$$$) {
- +return;
- my ($id, $url, $title, $v1, $v2, $muxed_file) = @_;
- my $video_file = $v1->{file};
Add Comment
Please, Sign In to add comment