From a825bb90dd4548008c0aeeacea868f35c7f1c21f Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Thu, 20 Jan 2022 10:40:10 +0100 Subject: Small fixes --- download_yt_playlist | 2 +- gromo | 9 ++++++--- multiplayerctl | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/download_yt_playlist b/download_yt_playlist index 3f35e59..09f2edb 100755 --- a/download_yt_playlist +++ b/download_yt_playlist @@ -5,4 +5,4 @@ if [ $# -ne 1 ]; then exit 1 fi -exec youtube-dl -o '%(playlist_uploader)s - %(playlist_title)s [%(playlist_id)s]/%(playlist_index)s %(title)s.%(ext)s' "https://www.youtube.com/playlist?list=$1" +exec youtube-dl -ixo '%(playlist_uploader)s - %(playlist_title)s [%(playlist_id)s]/%(playlist_index)s %(title)s.%(ext)s' "https://www.youtube.com/playlist?list=$1" diff --git a/gromo b/gromo index d85030b..e083e60 100755 --- a/gromo +++ b/gromo @@ -109,9 +109,12 @@ EOF out+="\n" done - while IFS=$FS read -r task dur gromos; do - echo -e "$task\n\t$gromos gromos, $(pp_seconds $dur)" - done <<<$(echo -e "$out" | sort -t $FS -k 2 -rn) + sortedout=$(printf "$out" | sort -t $FS -k 2 -rn) + if [ -n "$sortedout" ]; then + while IFS=$FS read -r task dur gromos; do + echo -e "$task\n\t$gromos gromos, $(pp_seconds $dur)" + done <<<$sortedout + fi fi fi } diff --git a/multiplayerctl b/multiplayerctl index 011c7bc..d86d833 100755 --- a/multiplayerctl +++ b/multiplayerctl @@ -1,4 +1,6 @@ #!/usr/bin/env perl +# +# Deps: bash, playerctl my $TMPFILE = '/tmp/multiplayerctl'; -- cgit v1.2.3