diff options
author | B. Watson <yalhcru@gmail.com> | 2020-05-25 23:17:10 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-06-01 08:46:39 +0700 |
commit | 16027fe8c543f337c2482b7dc71d5a5ae9a0e53a (patch) | |
tree | bbd9e0093f05f678503ec35167288efd32c33831 /multimedia/straw-viewer/restore_mplayer.diff | |
parent | 768d7de53e75d6f92895a32d09b79e3614472d28 (diff) | |
download | slackbuilds-16027fe8c543f337c2482b7dc71d5a5ae9a0e53a.tar.gz |
multimedia/straw-viewer: Updated for version 0.0.3+20200516_820ebc7.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'multimedia/straw-viewer/restore_mplayer.diff')
-rw-r--r-- | multimedia/straw-viewer/restore_mplayer.diff | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/multimedia/straw-viewer/restore_mplayer.diff b/multimedia/straw-viewer/restore_mplayer.diff new file mode 100644 index 0000000000..e61d01420c --- /dev/null +++ b/multimedia/straw-viewer/restore_mplayer.diff @@ -0,0 +1,95 @@ +diff --git a/bin/gtk-straw-viewer b/bin/gtk-straw-viewer +index c6c17dd..9bd9bd8 100755 +--- a/bin/gtk-straw-viewer ++++ b/bin/gtk-straw-viewer +@@ -161,6 +161,13 @@ my %CONFIG = ( + fs => q{--fullscreen}, + arg => q{--really-quiet --title=*TITLE* --no-ytdl}, + }, ++ mplayer => { ++ cmd => q{mplayer}, ++ srt => q{-sub *SUB*}, ++ audio => q{-audiofile *AUDIO*}, ++ fs => q{-fs}, ++ arg => q{-prefer-ipv4 -really-quiet -title *TITLE*}, ++ }, + smplayer => { + cmd => q{smplayer}, + srt => q{-sub *SUB*}, +@@ -3042,9 +3049,8 @@ sub get_player_command { + my ($streaming, $video) = @_; + + my %MPLAYER; +- +- $MPLAYER{fullscreen} = $CONFIG{fullscreen} ? $CONFIG{video_players}{$CONFIG{video_player_selected}}{fs} : q{}; +- $MPLAYER{arguments} = $CONFIG{video_players}{$CONFIG{video_player_selected}}{arg} // q{}; ++ $MPLAYER{fullscreen} = $CONFIG{fullscreen} ? $CONFIG{video_players}{$CONFIG{video_player_selected}}{fs} : q{}; ++ $MPLAYER{mplayer_arguments} = $CONFIG{video_players}{$CONFIG{video_player_selected}}{arg} // q{}; + + my $cmd = join( + q{ }, +diff --git a/bin/straw-viewer b/bin/straw-viewer +index 9292f7e..5e4d5b2 100755 +--- a/bin/straw-viewer ++++ b/bin/straw-viewer +@@ -19,7 +19,7 @@ + # https://github.com/trizen/straw-viewer + #------------------------------------------------------- + +-# straw-viewer is a command line utility for streaming YouTube videos in mpv/vlc. ++# straw-viewer is a command line utility for streaming YouTube videos in mpv/vlc/mplayer. + + # This is a fork of youtube-viewer: + # https://github.com/trizen/youtube-viewer +@@ -167,11 +167,19 @@ my %CONFIG = ( + arg => q{--really-quiet --title=*TITLE* --no-ytdl}, + novideo => q{--no-video}, + }, ++ mplayer => { ++ cmd => q{mplayer}, ++ srt => q{-sub *SUB*}, ++ audio => q{-audiofile *AUDIO*}, ++ fs => q{-fs}, ++ arg => q{-prefer-ipv4 -really-quiet -title *TITLE*}, ++ novideo => q{-novideo}, ++ }, + }, + + video_player_selected => ( + $constant{win32} +- ? 'vlc' ++ ? 'mplayer' + : undef # auto-defined + ), + +@@ -1769,6 +1777,21 @@ sub apply_input_arguments { + return 1; + } + ++# Get mplayer ++sub get_mplayer { ++ if ($constant{win32}) { ++ my $smplayer = catfile($ENV{ProgramFiles}, qw(SMPlayer mplayer mplayer.exe)); ++ ++ if (not -e $smplayer) { ++ warn "\n\n!!! Please install SMPlayer in order to stream YouTube videos.\n\n"; ++ } ++ ++ return $smplayer; # Windows MPlayer ++ } ++ ++ return 'mplayer'; # *NIX MPlayer ++} ++ + # Get term width + sub get_term_width { + return $term_width if $constant{win32}; +@@ -3319,7 +3342,7 @@ sub get_player_command { + + $MPLAYER{fullscreen} = $opt{fullscreen} ? $opt{video_players}{$opt{video_player_selected}}{fs} // '' : q{}; + $MPLAYER{novideo} = $opt{novideo} ? $opt{video_players}{$opt{video_player_selected}}{novideo} // '' : q{}; +- $MPLAYER{arguments} = $opt{video_players}{$opt{video_player_selected}}{arg} // q{}; ++ $MPLAYER{mplayer_arguments} = $opt{video_players}{$opt{video_player_selected}}{arg} // q{}; + + my $cmd = join( + q{ }, |