TOOLSP
"
WELCOME !

Please ! Use [CODE] tags for your LINKS and CODE.
Favor usar balisas [CODE] para sus vínculos y código.
Merci d'utiliser les balises [CODE] pour vos liens et code.

[code]http://Thank.you[/code]
"
*** GITHUB ***
.
.
URL Resolver [GIT]
.
.
.
.
Jx Update [REDIRECT]
.
.
*** Associated ***
.
Pastebin Your list online
.
mediafire Upload Files
.
imgur Upload Pics
lyngsat TV logos collection
transparent .png
.
http://hola.org free? VPN
Hola.apk free? VPN App.
.
hidester- free Proxy
.
webgrabplus EPG - Eng
xmltv EPG - Fr
kazer EPG - Fr
.
.wordreference Traduction
.
mail.com (fast sign-in)
.
.
Latest topics
» SportsDevil back on Mega
Yesterday at 14:38 by skyhigh

» SportsDevil back on Mega
Fri 17 Nov - 5:30 by jairoxyz

» youtube playlists
Tue 14 Nov - 2:43 by jujuuj

» afromotion
Thu 9 Nov - 13:59 by doctor4979

» ? works on VLC, but not on kodi ?
Mon 6 Nov - 13:06 by jujuuj

» how make a request.post to get a repond
Tue 31 Oct - 16:01 by jujuuj

» how to play this in kodi
Tue 31 Oct - 15:21 by jujuuj

FRIENDS / PARTNERS

forum

créer un forum


Xbmc tool box / Xbmc gui (Kodi)

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by jujuuj on Sun 4 Jun - 1:01

I need some holidays too Smile
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by twogun on Wed 7 Jun - 7:43

What a weekend.  I've looked in here a couple of times, but haven't had the time to post.  

I've modified Shani's password protected code.  This version will save the password and reuse it.  There is no limit on the reuse of the password.  If for some reason the saved password fails (password changes, wrong password entered, pass file is damaged/deleted, etc)  it will simply ask for the password again and save it again.  The password is encoded with base64.  Not really secure, but at least it isn't human readable.  It is saved in a file called "pass" in the LSP userdata directory.  I have attempted to make this code universal by using xbmc.translatePath.  Hopefully it will work for everyone.


Code:
<item>
<title>Password protected w/ recorded password - Big Buck Bunny (password = test)</title>
<link>$doregex[getinput]</link>

<regex>
<name>getinput</name>

<expres><![CDATA[#$pyFunction
import xbmcgui,xbmc, xbmcaddon, time, base64

def GetLSProData(page_data,Cookie_Jar,m):
    path = xbmc.translatePath("special://profile/addon_data/" + "plugin.video.live.streamspro/pass")
    try:
        f = open(path, 'r')
        solution = f.read()
        f.close()
        if base64.b64decode(solution) == 'test':
            return play()
    except:
        pass
    txt='Enter Password?'
    addon = xbmcaddon.Addon('plugin.video.live.streamspro')
    addon_version = addon.getAddonInfo('version')
    profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))

    solver = InputWindow( txt=txt)
    solution = solver.get()

    f = open(path, 'w')
    f.write(base64.b64encode(solution))
    f.close()

    if solution == 'test':
        return play()
    else:
        return ''

class InputWindow(xbmcgui.WindowDialog):
    def __init__(self, *args, **kwargs):

        self.txt = kwargs.get('txt','')

        xbmcgui.WindowXMLDialog.__init__(self)
        #self.addControl(self.txt)
        path = xbmcaddon.Addon().getAddonInfo('path')
        self.kbd = xbmc.Keyboard()
        self.kbd.setHeading( self.txt)

    def get(self):
        self.show()
        time.sleep(2)
        self.kbd.doModal()
        if (self.kbd.isConfirmed()):
            text = self.kbd.getText()
            self.close()
            return text
        self.close()
        return False

def play():
    return 'http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4'
]]></expres>
<page></page>
</regex>
</item>
avatar
twogun

Messages : 33
Date d'inscription : 2017-04-03

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by jujuuj on Wed 7 Jun - 9:11

Amazing !
I Have to test this !

the frog is ... K.O.
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by mickydoo on Wed 7 Jun - 15:50

@jujuju @twogun
A real regal your box to dialogs
thanks

mickydoo

Messages : 11
Date d'inscription : 2017-05-10

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by jujuuj on Fri 9 Jun - 2:50

@twogun

Please adapt your password protected and recorded solution
and help me/us with an

DOUBLEusernameANDpassword protected and DOUBLErecorded solution

here is the item we have, please add the "record" option for both username and password : Thanks a lot for your help !

Code:


<item>
<title>( username = ?  password = ? )</title>             
<thumbnail>NA</thumbnail>
<link>NA</link>
<externallink>$doregex[getinput]</externallink>

<regex>
<name>getinput</name>
<expres><![CDATA[#$pyFunction
import xbmcgui,xbmc, xbmcaddon, time
def GetLSProData(page_data, Cookie_Jar,m, txt1='Enter Username?', txt2='Enter Password?'):
    addon = xbmcaddon.Addon('plugin.video.live.streamspro')
    addon_version = addon.getAddonInfo('version')
    profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
    solver = InputWindow( txt=txt1)
    solution1 = solver.get()
    solver = InputWindow( txt=txt2)
    solution2 = solver.get()
    return 'http://hidden.php?username=' + solution1 + '&amp;password=' + solution2

class InputWindow(xbmcgui.WindowDialog):
    def __init__(self, *args, **kwargs):
        self.txt = kwargs.get('txt','')
        xbmcgui.WindowXMLDialog.__init__(self)
        #self.addControl(self.txt)
        path = xbmcaddon.Addon().getAddonInfo('path')
        self.kbd = xbmc.Keyboard()
        self.kbd.setHeading( self.txt)
    def get(self):
        self.show()
        time.sleep(2)
        self.kbd.doModal()
        if (self.kbd.isConfirmed()):
            text = self.kbd.getText()
            self.close()
            return text
        self.close()
        return False
]]></expres>
<page></page>
</regex>
</item>
 
 


Bye all ! Thanks for reading !
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Ahora 10 de verdad / Maintenant 10 pour de vrai (Youtube)

Post by jujuuj on Sat 24 Jun - 2:45

twogun wrote:This next code allow you to search youtube via input window.  It will return the next 10 pages of results (or the max number of pages if it is less then 10 pages)

@jujuuj feel free to use this to search for "Big Buck Bunny"

In all seriousness though.  You could easily edit this to give a second input window asking for the number of pages you wish to limit the search to.

Code:

<item>
<title>xbmc input windows. Youtube Search 10 pages</title>
<link>$doregex[makelist]</link>
<thumbnail>http://vignette3.wikia.nocookie.net/logopedia/images/7/76/Youtube-logo_2005-2009.jpg</thumbnail>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[makelist.param2]</title>
<link>$doregex[resolve]</link>
<thumbnail>https://i.ytimg.com/vi/[makelist.param1]/hqdefault.jpg</thumbnail>
]]></listrepeat>
<expres>u'(.+?)', u'(.+?)'</expres>
<page>$doregex[search]</page>
</regex>

<regex>
<name>resolve</name>
<expres><![CDATA[#$pyFunction
import urlresolver
def GetLSProData(page_data,Cookie_Jar,m):
 url = 'https://www.youtube.com/watch?v=[makelist.param1]'
 streamLink = urlresolver.resolve(url)
 return streamLink
]]></expres>
<page></page>
</regex>

<regex>
<name>search</name>
<expres><![CDATA[#$pyFunction
import requests,xbmcgui,xbmc, re,time, xbmcaddon
def GetLSProData(page_data,Cookie_Jar,m):

 text=takeInputFortext('Enter search string')
 url = 'https://www.youtube.com/results?q=' + text.replace(' ', '+')
 req = requests.get(url)
 list1 = re.findall('yt-lockup-c.+?a\shref=".watch.v=([^"]+)".+?\s\stitle="([^"]+)"\s', req.text)

 count = 10
 while count > 1:
   try:
     url = 'https://www.youtube.com' + re.findall('a href="([^"]+)".+Next', req.text)[0]
   except:
     return list1
   req = requests.get(url)
   list2 = re.findall('yt-lockup-c.+?a\shref=".watch.v=([^"]+)".+?\s\stitle="([^"]+)"\s', req.text)
   list1 = list1 + list2
   count = count - 1
 return list1

def takeInputFortext(txt):
 addon = xbmcaddon.Addon('plugin.video.live.streamspro')
 addon_version = addon.getAddonInfo('version')
 profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
 
 solver = InputWindow( txt=txt)
 solution = solver.get()
 return solution

class InputWindow(xbmcgui.WindowDialog):
    def __init__(self, *args, **kwargs):
        
        self.txt = kwargs.get('txt','')

        xbmcgui.WindowXMLDialog.__init__(self)
        #self.addControl(self.txt)
        path = xbmcaddon.Addon().getAddonInfo('path')
        self.kbd = xbmc.Keyboard()
        self.kbd.setHeading( self.txt)

    def get(self):
        self.show()
        time.sleep(2)
        self.kbd.doModal()
        if (self.kbd.isConfirmed()):
            text = self.kbd.getText()
            self.close()
            return text
        self.close()
        return False
]]></expres>
<page></page>
</regex>
</item>


After watching 12 versions of the movie big buck bunny, in the item  "Youtube Search (10 pages)", I realized that it was only showing 1 page and not the 10 promised by twogun ...
... and there were a very simple reason : my youtube is not English, my youtube is of a FOREIGN LANGUAGE ; so I checked in source code and ... where it should be written "Next" , it is in fact "Siguiente" or "Suivante".   So you will have to adapt the code depending on language :
change the word ' Next  '  in the code
    url = 'https://www.youtube.com' + re.findall('a href="([^"]+)".+Next', req.text)[0]
    url = 'https://www.youtube.com' + re.findall('a href="([^"]+)".+Siguiente', req.text)[0]
    url = 'https://www.youtube.com' + re.findall('a href="([^"]+)".+Suivante', req.text)[0]
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Youtube Search 10 pages (any language)

Post by jujuuj on Sun 25 Jun - 1:40

This one will work, no matter your language :

Code:

<item>
<title>xbmc input windows. Youtube Search 10 pages  (by twogun)</title>
<link>$doregex[makelist]</link>
<thumbnail>http://vignette3.wikia.nocookie.net/logopedia/images/7/76/Youtube-logo_2005-2009.jpg</thumbnail>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[makelist.param2]</title>
<link>$doregex[resolve]</link>
<thumbnail>https://i.ytimg.com/vi/[makelist.param1]/hqdefault.jpg</thumbnail>
]]></listrepeat>
<expres>u'(.+?)', u'(.+?)'</expres>
<page>$doregex[search]</page>
</regex>

<regex>
<name>resolve</name>
<expres><![CDATA[#$pyFunction
import urlresolver
def GetLSProData(page_data,Cookie_Jar,m):
 url = 'https://www.youtube.com/watch?v=[makelist.param1]'
 streamLink = urlresolver.resolve(url)
 return streamLink
]]></expres>
<page></page>
</regex>

<regex>
<name>search</name>
<expres><![CDATA[#$pyFunction
import requests,xbmcgui,xbmc, re,time, xbmcaddon
def GetLSProData(page_data,Cookie_Jar,m):

 text=takeInputFortext('Enter search string')
 url = 'https://www.youtube.com/results?q=' + text.replace(' ', '+')
 req = requests.get(url)
 list1 = re.findall('yt-lockup-c.+?a\shref=".watch.v=([^"]+)".+?\s\stitle="([^"]+)"\s', req.text)

 count = 10
 while count > 1:
   try:
     url = 'https://www.youtube.com' + re.findall('a href="([^"]+)".+<\/a>\n <\/div>', req.text)[0]
   except:
     return list1
   req = requests.get(url)
   list2 = re.findall('yt-lockup-c.+?a\shref=".watch.v=([^"]+)".+?\s\stitle="([^"]+)"\s', req.text)
   list1 = list1 + list2
   count = count - 1
 return list1

def takeInputFortext(txt):
 addon = xbmcaddon.Addon('plugin.video.live.streamspro')
 addon_version = addon.getAddonInfo('version')
 profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
 
 solver = InputWindow( txt=txt)
 solution = solver.get()
 return solution

class InputWindow(xbmcgui.WindowDialog):
    def __init__(self, *args, **kwargs):
        
        self.txt = kwargs.get('txt','')

        xbmcgui.WindowXMLDialog.__init__(self)
        #self.addControl(self.txt)
        path = xbmcaddon.Addon().getAddonInfo('path')
        self.kbd = xbmc.Keyboard()
        self.kbd.setHeading( self.txt)

    def get(self):
        self.show()
        time.sleep(2)
        self.kbd.doModal()
        if (self.kbd.isConfirmed()):
            text = self.kbd.getText()
            self.close()
            return text
        self.close()
        return False
]]></expres>
<page></page>
</regex>
</item>
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by jujuuj on Wed 28 Jun - 15:04

I am going to add  an historic to this youtube item ...
now that I know I can (in the code of an ITEM) save some data, and then reuse it latter ...
____ with that : ____
  f = open(path, 'w')
f.write(solution)
f.close()
____ and that : ____
       f = open(path, 'r')
       solution = f.read()
       f.close()
       return solution
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by Jason on Sat 1 Jul - 3:08

hello Guys

it is possible to play automatically a video when entering LiveStreamsPro? When video finished, then displayed my channel list?

It is possible?

thank u Guys


Jason

Jason

Messages : 14
Date d'inscription : 2017-06-18

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by jujuuj on Sun 2 Jul - 1:46

@jason, > NO Neutral
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

correction ...

Post by jujuuj on Sun 2 Jul - 1:55

jujuuj wrote:not a bad idea ...  not sure it's possible though ..

that would be like that ?  (... never tried...)
Code:

    ret = dialog.select('Choose a regex ?', ['the regex 1', 'the regex 2'])
    RegexS = ['$doregex[One]','$doregex[Two]']
    return RegexS[ret]


After checking,  you can NOT put the entire term '$doregex[One]'  in the RegexS list  (because it would run the regex (assuming there are some opening windows inside or direct PY orders, it will cause disorder)

But, you can do it without the $ :
Code:

    ret = dialog.select('Choose a regex ?', ['the regex 1', 'the regex 2'])
    RegexS = ['doregex[One]','doregex[Two]']
    return RegexS[ret]
and then you can run the regex just adding the $ before ...
the link would be <link>$[makelistChoose.param2] </link>     ... to run regex one or two, depending on choice.
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by oxus on Mon 18 Sep - 18:16

Youtube pagination is not working anymore.
Can you help us with this?
Thanks!
jujuuj wrote:This one will work, no matter your language :

Code:

<item>
<title>xbmc input windows. Youtube Search 10 pages  (by twogun)</title>
<link>$doregex[makelist]</link>
<thumbnail>http://vignette3.wikia.nocookie.net/logopedia/images/7/76/Youtube-logo_2005-2009.jpg</thumbnail>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[makelist.param2]</title>
<link>$doregex[resolve]</link>
<thumbnail>https://i.ytimg.com/vi/[makelist.param1]/hqdefault.jpg</thumbnail>
]]></listrepeat>
<expres>u'(.+?)', u'(.+?)'</expres>
<page>$doregex[search]</page>
</regex>

<regex>
<name>resolve</name>
<expres><![CDATA[#$pyFunction
import urlresolver
def GetLSProData(page_data,Cookie_Jar,m):
 url = 'https://www.youtube.com/watch?v=[makelist.param1]'
 streamLink = urlresolver.resolve(url)
 return streamLink
]]></expres>
<page></page>
</regex>

<regex>
<name>search</name>
<expres><![CDATA[#$pyFunction
import requests,xbmcgui,xbmc, re,time, xbmcaddon
def GetLSProData(page_data,Cookie_Jar,m):

 text=takeInputFortext('Enter search string')
 url = 'https://www.youtube.com/results?q=' + text.replace(' ', '+')
 req = requests.get(url)
 list1 = re.findall('yt-lockup-c.+?a\shref=".watch.v=([^"]+)".+?\s\stitle="([^"]+)"\s', req.text)

 count = 10
 while count > 1:
   try:
     url = 'https://www.youtube.com' + re.findall('a href="([^"]+)".+<\/a>\n <\/div>', req.text)[0]
   except:
     return list1
   req = requests.get(url)
   list2 = re.findall('yt-lockup-c.+?a\shref=".watch.v=([^"]+)".+?\s\stitle="([^"]+)"\s', req.text)
   list1 = list1 + list2
   count = count - 1
 return list1

def takeInputFortext(txt):
 addon = xbmcaddon.Addon('plugin.video.live.streamspro')
 addon_version = addon.getAddonInfo('version')
 profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
 
 solver = InputWindow( txt=txt)
 solution = solver.get()
 return solution

class InputWindow(xbmcgui.WindowDialog):
    def __init__(self, *args, **kwargs):
        
        self.txt = kwargs.get('txt','')

        xbmcgui.WindowXMLDialog.__init__(self)
        #self.addControl(self.txt)
        path = xbmcaddon.Addon().getAddonInfo('path')
        self.kbd = xbmc.Keyboard()
        self.kbd.setHeading( self.txt)

    def get(self):
        self.show()
        time.sleep(2)
        self.kbd.doModal()
        if (self.kbd.isConfirmed()):
            text = self.kbd.getText()
            self.close()
            return text
        self.close()
        return False
]]></expres>
<page></page>
</regex>
</item>

oxus

Messages : 8
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by Pibox on Wed 27 Sep - 23:54

Thank you guys for all your tips. very instructive. But YES/NO BOX don't work.

Can you fix it please ?


Code:
<item>
<title>YES/NO  BOX  </title>
<thumbnail></thumbnail>
<link>non</link>
<externallink>$doregex[openDialog]</externallink>
<regex>
<name>openDialog</name>
<expres><![CDATA[#$pyFunction
import xbmcaddon
import xbmcgui
def GetLSProData(page_data,Cookie_Jar,m):
    title = "      Question      " 
    line1 = "Do you think"
    line2 = "that Twogun "
    line3 = "is crazy ?"
  ok = xbmcgui.Dialog().yesno(title, line1, line2, line3)
    if ( not ok ):
    return "http://pastebin.com/raw/83PyMhip"
    else :
    return "http://pastebin.com/raw/Jr7stQp3"
]]></expres>
<page></page>
</regex>
<fanart></fanart>
</item>

Pibox

Messages : 10
Date d'inscription : 2017-04-16

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by vbprofi on Fri 20 Oct - 17:02

hi,
have someone finished this code to combine it with the solution of twogun's code?

I'm interested on an solution to save true username and Password in localfile and read it for autoLogin.

best regards


jujuuj wrote:@twogun

Please adapt your password protected and recorded solution
and help me/us with an

DOUBLEusernameANDpassword protected and DOUBLErecorded solution

here is the item we have, please add the "record" option for both username and password :  Thanks a lot for your help !

Code:


<item>
<title>( username = ?  password = ? )</title>              
<thumbnail>NA</thumbnail>
<link>NA</link>
<externallink>$doregex[getinput]</externallink>

<regex>
<name>getinput</name>
<expres><![CDATA[#$pyFunction
import xbmcgui,xbmc, xbmcaddon, time
def GetLSProData(page_data, Cookie_Jar,m, txt1='Enter Username?', txt2='Enter Password?'):
    addon = xbmcaddon.Addon('plugin.video.live.streamspro')
    addon_version = addon.getAddonInfo('version')
    profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
    solver = InputWindow( txt=txt1)
    solution1 = solver.get()
    solver = InputWindow( txt=txt2)
    solution2 = solver.get()
    return 'http://hidden.php?username=' + solution1 + '&password=' + solution2

class InputWindow(xbmcgui.WindowDialog):
    def __init__(self, *args, **kwargs):
        self.txt = kwargs.get('txt','')
        xbmcgui.WindowXMLDialog.__init__(self)
        #self.addControl(self.txt)
        path = xbmcaddon.Addon().getAddonInfo('path')
        self.kbd = xbmc.Keyboard()
        self.kbd.setHeading( self.txt)
    def get(self):
        self.show()
        time.sleep(2)
        self.kbd.doModal()
        if (self.kbd.isConfirmed()):
            text = self.kbd.getText()
            self.close()
            return text
        self.close()
        return False
]]></expres>
<page></page>
</regex>
</item>
  
  


Bye all ! Thanks for reading !

vbprofi

Messages : 17
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by jujuuj on Fri 27 Oct - 14:25

Hello,

It should be possible to do this,

As our PY guru had to go ,.. and I wish he was here ...  No
we will have to do this ourselves

basically we will have  check if a file called "identification" is existing in our local disk,
if yes open it and read it
if not, create it (empty)
if empty , it should ask for username and password
and, then, open list with user and pasword ...

wow ...

in that regex, we have something similar ...

Code:


<regex>
  <name>texte</name>      
  <expres><![CDATA[#$pyFunction
import urllib, re, requests, xbmcgui, xbmc, xbmcaddon, time
def GetLSProData(page_data,Cookie_Jar,m):
  
  myheaders = {'User-Agent': 'Mozilla/5.0 (X11; Linux i686; rv:34.0) Gecko/20100101 Firefox/34.0', 'Referer': ''}
  path = xbmc.translatePath("special://profile/addon_data/" + "plugin.video.live.streamspro/IPTV-MEMORY.1")
  addon = xbmcaddon.Addon('plugin.video.live.streamspro')
  addon_version = addon.getAddonInfo('version')
  profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
  txt='Enter URL ?  http://  ...  &type=m3u '
    
  try:
 f = open(path, 'r')
 solution = f.read()
 f.close()
 
 
  except:
 solver = InputWindow( txt=txt)
 solution = solver.get()
 f = open(path, 'w')
 f.write(solution)
 f.close()

  expres = '(http:\/\/.*?username.*?password.*?type=m3u)'.replace('&amp;','&')
  return re.findall(expres, solution)
  
class InputWindow(xbmcgui.WindowDialog):
    def __init__(self, *args, **kwargs):
        self.txt = kwargs.get('txt','')
        xbmcgui.WindowXMLDialog.__init__(self)
        #self.addControl(self.txt)
        path = xbmcaddon.Addon().getAddonInfo('path')
        self.kbd = xbmc.Keyboard()
        self.kbd.setHeading( self.txt)

    def get(self):
        self.show()
        time.sleep(2)
        self.kbd.doModal()
        if (self.kbd.isConfirmed()):
            text = self.kbd.getText()
            self.close()
            return text
        self.close()
        return False

]]></expres>
<page></page>
</regex>
  

and this is the interesting part :
 
Code:

try:
 f = open(path, 'r')
 solution = f.read()
 f.close()
 
 
  except:
 solver = InputWindow( txt=txt)
 solution = solver.get()
 f = open(path, 'w')
 f.write(solution)
 f.close()
  


we can modificate it like that :

Code:

...
...
  path = xbmc.translatePath("special://profile/addon_data/" + "plugin.video.live.streamspro/" + "identification")
 ...

  txt1='Enter username'
  txt2='Enter password'
    
  try:
 f = open(path, 'r')
 solution = f.read()
 f.close()
 
  except:
 solver = InputWindow( txt=txt1)
 user = solver.get()
 
 solver = InputWindow( txt=txt2)
 pass = solver.get()
 
 solution = 'username=' + user + '&password=' pass
 f = open(path, 'w')
 
 
 f.write(solution)
 f.close()
 
  return 'http://hidden.php?' + solution + '&type=m3u'

... that will create a file called "identification" in your disk, in .kodi repertory, :  /addon_data/plugin.video.live.streamspro/identification


Then u'll need to erase this data when user/passw will die ...
or by delelting the content, or with another item full of PY ...

this is how I do it ... (erase)
Code:

    newcontent = ''
    f = open(path, 'w')
    f.write(newcontent)
    f.close()
    xbmc.executebuiltin("XBMC.Notification(Done !, Memory cleared !, 2000)")
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum