#!/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
#!/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
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