From 182346cf80fa75fc9cc091d52e957abf64e49357 Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Wed, 14 Jun 2023 18:39:03 +0200 Subject: [PATCH] =?utf8?q?Dodanie=20nowych=20wersji=20narz=C4=99dzi=20'pl'?= =?utf8?q?=20oraz=20'import=5Fgpgkeys'?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tools/100/import_gpgkeys | 5 ++--- tools/100/pl | 32 ++++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/tools/100/import_gpgkeys b/tools/100/import_gpgkeys index dfb9ff9..29f1e00 100755 --- a/tools/100/import_gpgkeys +++ b/tools/100/import_gpgkeys @@ -1,8 +1,7 @@ #!/bin/bash -if [ -f ~/public.gpg ] && [ -f ~/private.gpg ]; then +if [ -f ~/public.gpg ] && [ -f ~/private.gpg ] && [ -f ~/otrust.txt ]; then gpg --import ~/public.gpg gpg --import ~/private.gpg - userId=$(gpg --list-keys | sed -nr 's/.+<(.*)>$/\1/p'); - gpg --edit-key $userId; + gpg --import-ownertrust ~/otrust.txt fi diff --git a/tools/100/pl b/tools/100/pl index efcd0b0..34efee5 100755 --- a/tools/100/pl +++ b/tools/100/pl @@ -1,16 +1,29 @@ #!/bin/bash -file=$1; +if [ "$1" ] && [ $1 = "--video" ]; then + video=1; + shift; + if [ $# -gt 1 ]; then format=$1; shift; file=$1; + else format="best"; file=$1; fi +else + file=$1; +fi function help() { echo "pl - Play Links. Skrypt to odtwarzania multimediów z listy linków"; echo "morketsmerke.org; COPYLEFT; 2023"; echo; + echo "Opcje:"; + echo; + echo -e "\t--video [format] - możliwość odtwarzania linków jako filmów. Format"; + echo -e "\tjest opcjonalny, w przypadku jego braku, domyślnym formatem jest"; + echo -e "\t'best'."; + echo; echo "Użycie:"; - echo "$ pl sciezka/do/listy/linkow"; + echo -e "\t$ pl sciezka/do/listy/linkow"; echo; echo "Format listy:"; - echo "nazwa linku: https://youtube.com/..."; + echo -e "\tnazwa linku: https://youtube.com/..."; } if [ "$1" ]; then @@ -18,10 +31,17 @@ if [ "$1" ]; then linkNames=$(cut -d ":" -f 1 $1 | sed 's/\ /_/g' | awk '{printf $1" "}') select name in $linkNames; do if [ ! "$name" ]; then break; fi - linkName=$(echo $name | sed 's/_/\ /g'); - link=$(grep "$linkName" $file | cut -d ":" -f 2-); + link=$(grep "$name" $file | cut -d ":" -f 2-); + if [ ! "$link" ]; then + linkName=$(echo $name | sed 's/_/\ /g'); + link=$(grep "$linkName" $file | cut -d ":" -f 2-); + fi if echo $link | grep -q "youtube"; then - ytplay -a $link -f best[height=360]; + if [ "$video" ]; then + ytplay -v $link -f $format; + else + ytplay -a $link -f best[height=360]; + fi else mpv --no-video $link; fi -- 2.39.5