Kodi Community Forum

Full Version: [RELEASE] Luemmel's DVD-Ripper (Script) for Linux, Mac, and Windows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
Hi Luemmel. Having a problem. I went through the ssh setup but I always have to launch "ssh xbmc@localhost" from terminal to make swiss army knife launch correctly. It doesn't ask me for a password but after I do that I can use your add-on with no problem.

However if I don't do ssh xbmc@localhost manually from terminal I get an error message that says "Local SSH Server not configured correctly".

Any idea why this might be happening?
adave Wrote:Hi Luemmel. Having a problem. I went through the ssh setup but I always have to launch "ssh xbmc@localhost" from terminal to make swiss army knife launch correctly. It doesn't ask me for a password but after I do that I can use your add-on with no problem.

However if I don't do ssh xbmc@localhost manually from terminal I get an error message that says "Local SSH Server not configured correctly".

Any idea why this might be happening?

Ah ha, someone else having the same problem. Look back in this thread and you'll see that I have same problem. It's still not resolved despite Luemmel's and my best efforts. It appears that for some reason, some installs of ssh just won't let you do this trick of creating a keyfile in the way that it is done for SAK. I suggest that you look at the setup script and try to manually set up SSH as per the commands in that script. If that doesn't work then, like me, you are stuck for the moment until it gets resolved. The problem is that without this feature working, it is impossible to run SSH without typing in a password as the SSH program has no facility to pass the password on the command line, or as far as I can determine by redirecting stdin from a file.
hey guys, is there a windows version available for dvd ripping?
fbrea Wrote:hey guys, is there a windows version available for dvd ripping?

google is your friend. There are any number of applications for Windows that will backup DVDs. Most of them paid for - but AnyDVD and its friends work well. Also look at Makemkv. This app of Luemmel's is not for windoze, mainly because the underlying software is not available on that platform.
chippyash Wrote:Ah ha, someone else having the same problem. Look back in this thread and you'll see that I have same problem. It's still not resolved despite Luemmel's and my best efforts. It appears that for some reason, some installs of ssh just won't let you do this trick of creating a keyfile in the way that it is done for SAK. I suggest that you look at the setup script and try to manually set up SSH as per the commands in that script. If that doesn't work then, like me, you are stuck for the moment until it gets resolved. The problem is that without this feature working, it is impossible to run SSH without typing in a password as the SSH program has no facility to pass the password on the command line, or as far as I can determine by redirecting stdin from a file.

Thanks chippyash. I will look into the steps you provided.

I went back on the thread and read that you were getting asked for a password when you ssh xbmc@localhost from terminal. Is that correct? Because in my case I am not being asked for a password.
same problem here with 0.6.18.


I can login from shell without password with ssh [email protected] , but I still can't start the plugin.

Log :

Code:
NOTICE: [swiss-army-knife]: [OSlog]  Current-user      : [xbmc]
  NOTICE: [swiss-army-knife]: [OSlog]  SSH-user expected : [[email protected]]
  NOTICE: [swiss-army-knife]: [OSlog]  current user is listed inside the ssh-command
  NOTICE: [swiss-army-knife]: [OSlog]  Command to log inside ssh:echo "check-ssh.sh " >> /home/xbmc/.xbmc/userdata/addon_data/script.video.swiss.army.knife/log/ssh-log
  NOTICE: [swiss-army-knife]: [OSlog]  OSRun start
  NOTICE: [swiss-army-knife]: [OSlog]  Command to run :ssh [email protected] /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux/check-ssh.sh   > /dev/null 2>&1 &
  NOTICE: [swiss-army-knife]: [OSlog]  status command [ssh [email protected] /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux/check-ssh.sh   > /dev/null 2>&1 &] is rc:=[-1]
  NOTICE: [swiss-army-knife]: [OSlog]  OSRun end
  NOTICE: [swiss-army-knife]: [GUIlog] checking for expired makemkv licence is executed
    INFO: -->Python script returned the following error<--
   ERROR: Error Type: exceptions.UnboundLocalError
   ERROR: Error Contents: local variable 'sshlog' referenced before assignment[/b]
   ERROR: Traceback (most recent call last):
                                              File "/home/xbmc/.xbmc/addons/script.video.swiss.army.knife/default.py", line 2020, in ?
                                                state = OSCheckLicence()
                                              File "/home/xbmc/.xbmc/addons/script.video.swiss.army.knife/resources/lib/Linux.py", line 1863, in OSCheckLicence
                                                OSRun("check-mkv.sh ",False,False)
[b]                                              File "/home/xbmc/.xbmc/addons/script.video.swiss.army.knife/resources/lib/Linux.py", line 389, in OSRun
                                                OSlog("Command to log inside ssh:" + sshlog)
                                            UnboundLocalError: local variable 'sshlog' referenced before assignment[/b]
   INFO: -->End of Python script error report<--
adave Wrote:Thanks chippyash. I will look into the steps you provided.

I went back on the thread and read that you were getting asked for a password when you ssh xbmc@localhost from terminal. Is that correct? Because in my case I am not being asked for a password.

hum, If you are not being asked for a password then you *should* be good to go. It means that your ssh is setup correctly.

log on to XBMC with a terminal and simply type
ssh xbmc@localhost

If you are asked for a password, then you have same problem as me, (assuming you have set up ssh correctly.) If not I suspect then you may have a different problem. Turn xbmc debugging on (in system settings), restart xbmc and then try to fire up SAK. Then look at the log file /home/xbmc/.xbmc/temp/xbmc.log to see if that gives any clues.

if you can open another terminal you can
tail -f /home/xbmc/.xbmc/temp/xbmc.log

and watch the log whilst you try and start SAK. This may/may not give you some idea as to what is going on.
chippyash Wrote:hum, If you are not being asked for a password then you *should* be good to go. It means that your ssh is setup correctly.

log on to XBMC with a terminal and simply type
ssh xbmc@localhost

If you are asked for a password, then you have same problem as me, (assuming you have set up ssh correctly.) If not I suspect then you may have a different problem. Turn xbmc debugging on (in system settings), restart xbmc and then try to fire up SAK. Then look at the log file /home/xbmc/.xbmc/temp/xbmc.log to see if that gives any clues.

if you can open another terminal you can
tail -f /home/xbmc/.xbmc/temp/xbmc.log

and watch the log whilst you try and start SAK. This may/may not give you some idea as to what is going on.

I had this problem but was able to fix it on Ubuntu 10.10 ($ just represents the command prompt, don't type it in).

$ sh-keygen -t rsa
Save without password

Copy and paste the key from ~/.ssh/id_rsa.pub to ~/.ssh/authorized_keys
or
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

Then run:
$ ssh-add
Some more info about my problem.

1/ I can login to ssh without password when logued as xbmc to xbmc@localhost
2/ When i hit this command manually:

Quote:ssh xbmc@localhost /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux/check-ssh.sh > /dev/null 2>&1


It returns to the prompt, i can see with PS there's a ssh session logued in.

[/quote]

Everything should be ok on my side, I don't get why it fails with the plugin with:
Quote:Error Contents: local variable 'sshlog' referenced before assignment
hotlobster Wrote:ssh xbmc@localhost /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux/check-ssh.sh > /dev/null 2>&1

strip the > /dev/null 2>&1
from the command. what does that output?
hotlobster Wrote:Some more info about my problem.

1/ I can login to ssh without password when logued as xbmc to xbmc@localhost
2/ When i hit this command manually:




It returns to the prompt, i can see with PS there's a ssh session logued in.

Everything should be ok on my side, I don't get why it fails with the plugin with:[/quote]

I wonna have a look on this issue ,-)
hotlobster Wrote:same problem here with 0.6.18.


I can login from shell without password with ssh [email protected] , but I still can't start the plugin.

Log :

Code:
NOTICE: [swiss-army-knife]: [OSlog]  Current-user      : [xbmc]
  NOTICE: [swiss-army-knife]: [OSlog]  SSH-user expected : [[email protected]]
  NOTICE: [swiss-army-knife]: [OSlog]  current user is listed inside the ssh-command
  NOTICE: [swiss-army-knife]: [OSlog]  Command to log inside ssh:echo "check-ssh.sh " >> /home/xbmc/.xbmc/userdata/addon_data/script.video.swiss.army.knife/log/ssh-log
  NOTICE: [swiss-army-knife]: [OSlog]  OSRun start
  NOTICE: [swiss-army-knife]: [OSlog]  Command to run :ssh [email protected] /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux/check-ssh.sh   > /dev/null 2>&1 &
  NOTICE: [swiss-army-knife]: [OSlog]  status command [ssh [email protected] /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux/check-ssh.sh   > /dev/null 2>&1 &] is rc:=[-1]
  NOTICE: [swiss-army-knife]: [OSlog]  OSRun end
  NOTICE: [swiss-army-knife]: [GUIlog] checking for expired makemkv licence is executed
    INFO: -->Python script returned the following error<--
   ERROR: Error Type: exceptions.UnboundLocalError
   ERROR: Error Contents: local variable 'sshlog' referenced before assignment[/b]
   ERROR: Traceback (most recent call last):
                                              File "/home/xbmc/.xbmc/addons/script.video.swiss.army.knife/default.py", line 2020, in ?
                                                state = OSCheckLicence()
                                              File "/home/xbmc/.xbmc/addons/script.video.swiss.army.knife/resources/lib/Linux.py", line 1863, in OSCheckLicence
                                                OSRun("check-mkv.sh ",False,False)
[b]                                              File "/home/xbmc/.xbmc/addons/script.video.swiss.army.knife/resources/lib/Linux.py", line 389, in OSRun
                                                OSlog("Command to log inside ssh:" + sshlog)
                                            UnboundLocalError: local variable 'sshlog' referenced before assignment[/b]
   INFO: -->End of Python script error report<--

Did you try xbmc@localhost ?
From the current svn code the ssh-test functions do look like here :

Code:
##############################################
   # Check ssh comunication for addon           #
   ##############################################

   if ( Enable_Startup_Addon == 0):  

       # We have a ssh configuration that should work ....
       # But should working and working properly are two diffrent things ,-)
            
       state_ssh = OSCheckSSH()
       if (state_ssh == 1):
               GUIInfo(0,__language__(33321))
               if (__verbose__ == "true"):        
                   GUIlog ("please do configure ssh-server for login without any passwords")
                   GUIlog ("This addon do not start until ssh communication is working properly for the current user")
                   GUIlog ("Addon do exit now ...")
               Enable_Startup_Addon = Enable_Startup_Addon + 1


And the test istself is very basic ....


Code:
#########################################################
# Function  : OSCheckSSH                                #
#########################################################
# Parameter : none                                      #
#                                                       #
# Returns   :                                           #
#                                                       #
# 1           Test failed                               #
# 0           Test successfull                          #
#                                                       #
#########################################################
def OSCheckSSH():

    global __configLinux__
    global __verbose__

    if (os.path.exists(__configLinux__[39])):
        os.remove(__configLinux__[39])

    OSRun( "check-ssh.sh ",True,False)
    time.sleep(2)

    if (os.path.exists(__configLinux__[39])):
        return 0
    else:
        return 1

#########################################################


This code depends on a few things .....

the user from the settings (example : xbmc) can start any ssh-command without any password.

It does execute the shell-script "check-ssh.sh" and does wait for 2 secounds.

Code:
#!/bin/bash
###########################################################
# scriptname : check_ssh.sh                               #
###########################################################
# This script is part of the addon swiss-army-knife for   #
# xbmc and is licenced under the gpl-licence              #
# http://code.google.com/p/swiss-army-knife/              #
###########################################################
# author     : [email protected]                  #
# parameters : none                                       #
# description :                                           #
# test ssh connection                                     #
###########################################################
SCRIPTDIR="$HOME/.xbmc/addons/script.video.swiss.army.knife/shell-linux"
cd "$SCRIPTDIR"



###########################################################
#                                                         #
# Check that not user root is running this script         #
#                                                         #
###########################################################

if [ "$UID" == 0 ] ; then
   clear
   echo This script should not be executed as user root !
   echo You have to remove this lines to run this script as user
   echo root, what is by the way not recommanded !!
   echo
   echo ----------------------- script rc=254 ---------------------------
   echo -----------------------------------------------------------------
   exit 254
fi

###########################################################



###########################################################
#                                                         #
# We can only run with bash as default shell              #
#                                                         #
###########################################################

SHELLTEST="/bin/bash"
if [ $SHELL != $SHELLTEST ] ; then
   clear
   echo
   echo only bash shell is supported by this shell-script.
   echo It looks like you are using something other than /bin/bash.
   echo
   echo ----------------------- script rc=255 ---------------------------
   echo -----------------------------------------------------------------
   exit 255
fi

###########################################################




###########################################################
#                                                         #
# Show disclaimer / copyright note on top of the screen   #
#                                                         #
###########################################################

clear
echo
echo ----------------------------------------------------------------------------
SCRIPT=$(basename $0)
echo "script    :" $SCRIPT
cat version
echo "copyright : (C) <2010-2011>  <[email protected]>"
cd "$SCRIPTDIR" && echo changed to $SCRIPTDIR
echo ----------------------------------------------------------------------------

###########################################################



###########################################################
#                                                         #
# Definition of files and internal variables              #
#                                                         #
###########################################################

ZERO=0
E_SUID0=254
E_WRONG_SHELL=255

###########################################################



# On startup we do clean the ssh-command directory

rm $HOME/swiss.army.knife/ssh/* > /dev/null 2>&1
rm $HOME/.xbmc/userdata/addon_data/script.video.swiss.army.knife/log/ssh-test > /dev/null 2>&1

echo 1 > $HOME/.xbmc/userdata/addon_data/script.video.swiss.army.knife/log/ssh-test

echo
echo ----------------------- script rc=0 -----------------------------
echo -----------------------------------------------------------------

exit $ZERO

###########################################################


After 2 secounds the file $HOME/.xbmc/userdata/addon_data/script.video.swiss.army.knife/log/ssh-test

If this file do not exist .... there is a problem .-(
Hi

Quote:strip the > /dev/null 2>&1
from the command. what does that output?

Code:
ssh xbmc@localhost /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux/check-ssh.sh
TERM environment variable not set.

----------------------------------------------------------------------------
script    : check-ssh.sh
version   : 0.6.18 [swiss-army-knife addon] [01.02.2011]
copyright : (C) <2010>  <[email protected]>
changed to /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux
----------------------------------------------------------------------------

----------------------- script rc=0 -----------------------------
-----------------------------------------------------------------

As it returns 0 it seems ok here.

Quote:Did you try xbmc@localhost

Sure, I've tryed with 127.0.0.1 just to check something.



Quote:After 2 secounds the file $HOME/.xbmc/userdata/addon_data/script.video.swiss.army.knife/log/ssh-test

If this file do not exist .... there is a problem .-(

I have this file created too. With "1" inside.
hotlobster Wrote:Hi



Code:
ssh xbmc@localhost /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux/check-ssh.sh
TERM environment variable not set.

----------------------------------------------------------------------------
script    : check-ssh.sh
version   : 0.6.18 [swiss-army-knife addon] [01.02.2011]
copyright : (C) <2010>  <[email protected]>
changed to /home/xbmc/.xbmc/addons/script.video.swiss.army.knife/shell-linux
----------------------------------------------------------------------------

----------------------- script rc=0 -----------------------------
-----------------------------------------------------------------

As it returns 0 it seems ok here.



Sure, I've tryed with 127.0.0.1 just to check something.





I have this file created too. With "1" inside.

Could you try to increment the value time.sleep(2) to time.sleep(4)
inside the function "OSCheckSSH".
In a normal case the 2 secounds should be fine and the file do exist.
May your envirmont does need more than the expected 2 secounds to finish
the operation.

I try to implement a new parameter for this setting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44