Magicotr
This script decodes .otrkey files from onlinetvrecorder.com. It asks for username and password once and stores it in a file in your homedirectory. If you assign the command to .otrkey
files, decoding works with a klick.
~/bin/magicotr
#!/bin/bash #defaulvariables #file where username and password will be stored FILE=~/.otrpass #mode for the passwordfile, default 600 (user rw, group and world nothing) FILEMODE=600 #languagestuff ##german username="Benutzername" pass="Passwort" BEGINDECODE="Beginne Dekodierungsvorgang..." ENDDECODE="Dekodierung abgeschlossen. Sie sollten jetzt\neine Datei mit dem gleichen Namen wie die Ursprungsdatei in ihrem Ordner\n vorfinden, bei der nur die Endung .otrkey fehlt." #end language #start real script #check for passwordfile if [ -f $FILE ]; then #ok, now start reading the file EMAIL=$(cat $FILE | grep LOGIN |cut -d'"' -f2) PASSWORD=$(cat $FILE | grep PASSWORD |cut -d'"' -f2) #if no passwordfile, create one and ask user else echo "Keyfile not available, starting configuration" EMAIL=$(kdialog --title 'OTR-DECODER-SCRIPT' --inputbox "$username: (Login onlinetvrecorder.com)") echo LOGIN=\"$EMAIL\" > $FILE PASSWORD=$(kdialog --title 'OTR-DECODER-SCRIPT' --password "$pass:") echo PASSWORD=\"$PASSWORD\" >> $FILE echo "setting restrictions for $FILE to $FILEMODE" chmod $FILEMODE $FILE fi # ok, password and username available, start decoding kdialog --passivepopup "$BEGINDECODE" 5 otrdecoder -e $EMAIL -p $PASSWORD -i $1 kdialog --passivepopup "$ENDDECODE" 5