aboutsummaryrefslogtreecommitdiffstats
path: root/bin/gtk-fair-viewer
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-11-09 15:55:55 -0500
committerJesús <heckyel@hyperbola.info>2020-11-09 15:55:55 -0500
commitad60d6661706d750c45fba098813aa9f02307d55 (patch)
tree2555ac310b301b77083629041a1441347e4d05aa /bin/gtk-fair-viewer
parente320434680fe8e72327b1d4d6f05b3a3e2723149 (diff)
downloadfair-viewer-ad60d6661706d750c45fba098813aa9f02307d55.tar.lz
fair-viewer-ad60d6661706d750c45fba098813aa9f02307d55.tar.xz
fair-viewer-ad60d6661706d750c45fba098813aa9f02307d55.zip
update from upstream
Diffstat (limited to 'bin/gtk-fair-viewer')
-rwxr-xr-xbin/gtk-fair-viewer22
1 files changed, 19 insertions, 3 deletions
diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer
index 593e929..18c52db 100755
--- a/bin/gtk-fair-viewer
+++ b/bin/gtk-fair-viewer
@@ -16,7 +16,7 @@
#-------------------------------------------------------
# GTK Fair Viewer
# Fork: 14 February 2020
-# Edit: 09 September 2020
+# Edit: 05 October 2020
# https://framagit.org/heckyel/fair-viewer
#-------------------------------------------------------
@@ -226,6 +226,10 @@ my %CONFIG = (
fullscreen => 0,
audio_only => 0,
+ # hypervideo support
+ ytdl => 1,
+ ytdl_cmd => undef, # auto-detect
+
tooltips => 1,
tooltip_max_len => 512, # max length of description in tooltips
@@ -737,6 +741,16 @@ foreach my $path ($CONFIG{cache_dir}) {
}
}
+# Locate hypervideo
+if (not defined $CONFIG{ytdl_cmd}) {
+ if (defined(my $path = which_command('hypervideo'))) {
+ $CONFIG{ytdl_cmd} = $path;
+ }
+ else {
+ $CONFIG{ytdl_cmd} = 'hypervideo';
+ }
+}
+
# Locate video player
if (not $CONFIG{video_player_selected}) {
@@ -805,6 +819,8 @@ $CONFIG{fair_viewer} //= which_command('fair-viewer') // 'fair-viewer';
my $yv_obj = WWW::FairViewer->new(
escape_utf8 => 1,
config_dir => $config_dir,
+ ytdl => $CONFIG{ytdl},
+ ytdl_cmd => $CONFIG{ytdl_cmd},
hl => $CONFIG{hl},
env_proxy => $CONFIG{env_proxy},
cache_dir => $CONFIG{cache_dir},
@@ -864,7 +880,7 @@ sub apply_configuration {
videoLicense
region videoCategoryId
debug http_proxy user_agent
- timeout cookie_file
+ timeout cookie_file ytdl ytdl_cmd
)
) {
@@ -3073,7 +3089,7 @@ sub get_player_command {
);
if ($streaming->{streaming}{url} =~ m{^https://www\.youtube\.com/watch\?v=}) {
- $cmd =~ s{ --no-ytdl\b}{ }g;
+ $cmd =~ s{\s*--no-ytdl\b}{ }g;
}
$has_video ? $cmd : join(' ', $cmd, quotemeta($streaming->{streaming}{url}));