From d10903c9fc65daaf0cbdf99dac8ace71542b1fdd Mon Sep 17 00:00:00 2001 From: trizen Date: Mon, 30 Nov 2020 19:58:44 +0200 Subject: [PATCH] Allow setting the video player title to *ID* or *URL* in the configuration file. (https://github.com/trizen/youtube-viewer/issues/348) --- bin/gtk-pipe-viewer | 12 +++--------- bin/pipe-viewer | 6 +++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/bin/gtk-pipe-viewer b/bin/gtk-pipe-viewer index c7d895a..b994081 100755 --- a/bin/gtk-pipe-viewer +++ b/bin/gtk-pipe-viewer @@ -151,21 +151,15 @@ my %CONFIG = ( srt => q{--sub-file=*SUB*}, audio => q{--input-slave=*AUDIO*}, fs => q{--fullscreen}, - arg => q{--quiet --play-and-exit --no-video-title-show --input-title-format=*TITLE*}, + arg => q{--quiet --play-and-exit --no-video-title-show --input-title-format=*TITLE* *VIDEO*}, }, mpv => { cmd => q{mpv}, srt => q{--sub-file=*SUB*}, audio => q{--audio-file=*AUDIO*}, fs => q{--fullscreen}, - arg => q{--really-quiet --force-media-title=*TITLE* --no-ytdl}, + arg => q{--really-quiet --force-media-title=*TITLE* --no-ytdl *VIDEO*}, }, - smplayer => { - cmd => q{smplayer}, - srt => q{-sub *SUB*}, - fs => q{-fullscreen}, - arg => q{-close-at-end -media-title *TITLE* *URL*}, - }, }, video_player_selected => undef, # autodetect it later @@ -3044,7 +3038,7 @@ sub get_player_command { ) ); - my $has_video = $cmd =~ /\*(?:VIDEO|URL|ID)\*/; + my $has_video = $cmd =~ /(?:^|\s)\*(?:VIDEO|URL)\*(?:\s|\z)/; $cmd = $yv_utils->format_text( streaming => $streaming, diff --git a/bin/pipe-viewer b/bin/pipe-viewer index 2258c1f..008e8e2 100755 --- a/bin/pipe-viewer +++ b/bin/pipe-viewer @@ -144,7 +144,7 @@ my %CONFIG = ( srt => q{--sub-file=*SUB*}, audio => q{--input-slave=*AUDIO*}, fs => q{--fullscreen}, - arg => q{--quiet --play-and-exit --no-video-title-show --input-title-format=*TITLE*}, + arg => q{--quiet --play-and-exit --no-video-title-show --input-title-format=*TITLE* *VIDEO*}, novideo => q{--intf=dummy --novideo}, }, mpv => { @@ -152,7 +152,7 @@ my %CONFIG = ( srt => q{--sub-file=*SUB*}, audio => q{--audio-file=*AUDIO*}, fs => q{--fullscreen}, - arg => q{--really-quiet --force-media-title=*TITLE* --no-ytdl}, + arg => q{--really-quiet --force-media-title=*TITLE* --no-ytdl *VIDEO*}, novideo => q{--no-video}, }, }, @@ -3355,7 +3355,7 @@ sub get_player_command { ) ); - my $has_video = $cmd =~ /\*(?:VIDEO|URL|ID)\*/; + my $has_video = $cmd =~ /(?:^|\s)\*(?:VIDEO|URL)\*(?:\s|\z)/; $cmd = $yv_utils->format_text( streaming => $streaming,