forked from LBRYCommunity/lbry-sdk
20 lines
369 B
Bash
Executable file
20 lines
369 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
urlencode() {
|
|
local LANG=C
|
|
local length="${#1}"
|
|
for (( i = 0; i < length; i++ )); do
|
|
local c="${1:i:1}"
|
|
case $c in
|
|
[a-zA-Z0-9.~_-]) printf "$c" ;;
|
|
*) printf '%%%02X' "'$c" ;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
ARG=${1:-}
|
|
NAME=$(urlencode "$(echo "$ARG" | cut -c 8-)")
|
|
|
|
/usr/bin/xdg-open http://localhost:5279/view?name="$NAME"
|