How to login using xot-uzg framework
#1
Question 
Hi everyone,

I'm working on a script which parses a website which offers videos after logging in. I use the xot-uzg Framework and wonder how it is possible to tell the script how to login.

Iknow that there is a LogOn method, but as allthe scripts delivered with xot-uzg don't use logins I don't know how to use it.

Can anyone explain how I can implement the login?

Kind regards
Larry_Lobster
Reply
#2
Larry,

As the author of the XOT Framework I might be able to help you. You need to do 2 things:

in the InitialiseVariables of your channel add:
self.requiresLogon = False

then create method Logon(self, *args) that does the login. Here is an example taken from the chn_class.Channel class (the base class for all the channels):

Code:
def LogOn(self, *args):
        """
        Logs on to a website, using an url. Returns True on success
        """
        if not self.requiresLogon:
            logFile.info("No login required of %s", self.channelName)
            return True
        
        if self.loggedOn:
            logFile.info("Already logged in")
            return True
        
        _rtrn = False
        _passWord = args["userName"]
        _userName = args["passWord"]
        
        # Logon code goes here and returns true if logged on.
        
        return _rtrn
Reply
#3
Hi Basje,

hanks for your quick response. I will try to implement it. Btw. is there a way to configure parameters? Of course, I don't want to hardcode the username and the password in my script.

Kind regards
Larry_Lobster
Reply
#4
Larry_Lobster Wrote:Hi Basje,

hanks for your quick response. I will try to implement it. Btw. is there a way to configure parameters? Of course, I don't want to hardcode the username and the password in my script.

Kind regards
Larry_Lobster

It's up to you what to code! I usually have the user set them in an XML file and read that one from Python. But you could also create a XBMC Password Dialog.
Reply

Logout Mark Read Team Forum Stats Members Help
How to login using xot-uzg framework0