-
-
Save bonelifer/318ec4ae12ac4711f7d8ae0fd363c9ed to your computer and use it in GitHub Desktop.
Generate mediasources.xml for Kodi using https://github.com/AquilaIrreale/urlencode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFS= read -rp 'Server name: ' server_name < /dev/tty | |
IFS= read -rp 'Username: ' username < /dev/tty | |
IFS= read -rsp 'Password: ' password < /dev/tty | |
echo 1>&2 | |
password_encoded=$(urlencode -bc $' "#$%&\'*+,/:;<=>?@[\\]^`{|}~' <<< "$password") | |
tee "$HOME/.kodi/userdata/mediasources.xml" <<EOF | |
<mediasources> | |
<network> | |
<location id="0">davs://${username}:${password_encoded}@${server_name}</location> | |
</network> | |
</mediasources> | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment