diff options
author | trizen <trizen@protonmail.com> | 2020-10-29 20:31:37 +0200 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-11-09 17:25:23 -0500 |
commit | f8c7fc7457537d644d378871a7ec88eb9f031c91 (patch) | |
tree | 92eea1e873934487d49fd7bb0375d7f39d183e80 /lib | |
parent | ef8e41d15f126c2127e830cd9a76a9e55ec4a483 (diff) | |
download | fair-viewer-f8c7fc7457537d644d378871a7ec88eb9f031c91.tar.lz fair-viewer-f8c7fc7457537d644d378871a7ec88eb9f031c91.tar.xz fair-viewer-f8c7fc7457537d644d378871a7ec88eb9f031c91.zip |
Better detection for HFR (High Frame Rate) videos.
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/WWW/FairViewer/Itags.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/WWW/FairViewer/Itags.pm b/lib/WWW/FairViewer/Itags.pm index 9940cee..85473c2 100644 --- a/lib/WWW/FairViewer/Itags.pm +++ b/lib/WWW/FairViewer/Itags.pm @@ -62,7 +62,7 @@ sub get_itags { {value => 299, format => 'mp4', dash => 1, hfr => 1}, # mp4 HFR (v) {value => 248, format => 'webm', dash => 1}, # webm (v) {value => 137, format => 'mp4', dash => 1}, # mp4 (v) - {value => 399, format => 'av1', dash => 1}, # av1 (v) + {value => 399, format => 'av1', dash => 1, hfr => 1}, # av1 (v) {value => 46, format => 'webm'}, # webm (v-a) {value => 37, format => 'mp4'}, # mp4 (v-a) {value => 301, format => 'mp4', live => 1}, # mp4 (live) (v-a) @@ -73,7 +73,7 @@ sub get_itags { {value => 298, format => 'mp4', dash => 1, hfr => 1}, # mp4 HFR (v) {value => 247, format => 'webm', dash => 1}, # webm (v) {value => 136, format => 'mp4', dash => 1}, # mp4 (v) - {value => 398, format => 'av1', dash => 1}, # av1 (v) + {value => 398, format => 'av1', dash => 1, hfr => 1}, # av1 (v) {value => 45, format => 'webm'}, # webm (v-a) {value => 22, format => 'mp4'}, # mp4 (v-a) {value => 300, format => 'mp4', live => 1}, # mp4 (live) (v-a) @@ -166,7 +166,9 @@ sub _find_streaming_url { next if not exists $stream->{$itag->{value}}; - if ($itag->{hfr}) { + my $entry = $stream->{$itag->{value}}; + + if (defined($entry->{fps}) and $entry->{fps} >= 50) { $args{hfr} || next; # skip high frame rate (HFR) videos } @@ -175,6 +177,7 @@ sub _find_streaming_url { } if ($itag->{dash}) { + $args{dash} || next; my $video_info = $stream->{$itag->{value}}; @@ -194,8 +197,6 @@ sub _find_streaming_url { } } - my $entry = $stream->{$itag->{value}}; - # Ignore segmented DASH URLs (they load pretty slow in mpv) if (not $args{dash_segmented}) { next if ($entry->{url} =~ m{/api/manifest/dash/}); |