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]
"
*** Doc. Kodi & PYthon ***
.
.
Python & Modules PY
.
.
.
.
(Video) Cache Kodi
.
.
.
Addons Kodi
.
.
.
Addons Kodi
.
.
*** GITHUB ***
.
.
URLresolver (J.S.) [GIT] +
.
.
.
URLresolver (elD.) [GIT] -
.
.
URLresolver (tvA.) [GIT] -
.
.
.
.
Cloudflare (external) [GIT]
.
.
.
*** 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)
.
.
FRIENDS / PARTNERS

£$π community

créer un forum


Xbmc tool box / Xbmc gui (Kodi)

Page 2 of 3 Previous  1, 2, 3  Next

Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by jujuuj on Sun 4 Jun - 1:01

I need some holidays too Smile
jujuuj
jujuuj

Messages : 249
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>
twogun
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.
jujuuj
jujuuj

Messages : 249
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 : 12
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 !
jujuuj
jujuuj

Messages : 249
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]
jujuuj
jujuuj

Messages : 249
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>
jujuuj
jujuuj

Messages : 249
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
jujuuj
jujuuj

Messages : 249
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 : 22
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
jujuuj
jujuuj

Messages : 249
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.
jujuuj
jujuuj

Messages : 249
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 : 12
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 : 63
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)")
jujuuj
jujuuj

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

View user profile

Back to top Go down

xbmc.gui : Username & Password WITH LOCAL SAVE

Post by jujuuj on Sun 15 Apr - 1:43

Idea xbmc.gui : Username & Password WITH LOCAL SAVE

2 Kodi windows will ask your user and password (example : for xstream-IPTV playlist)
and £$π will save this in your hard disk (for next time).

Code:

<regex>
<name>userpw</name>
<listrepeat><![CDATA[
<title> [userpw.param2] </title>
<link>plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&name=toolsp&url=[userpw.param3]|User-Agent=vlc</link>
<thumbnail>[userpw.param1]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re, requests, xbmc, xbmcaddon, xbmcgui, time
def GetLSProData(page_data,Cookie_Jar,m, txt1='Username?', txt2='Password?'):
 myheaders = {'User-Agent': 'vlc', 'Referer': ''}
 path = xbmc.translatePath("special://profile/addon_data/" + "plugin.video.live.streamspro/" + "usernamepassword.txt")
 addon = xbmcaddon.Addon('plugin.video.live.streamspro')
 addon_version = addon.getAddonInfo('version')
 profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
 url = 'http://1.2.3.4:5000/get.php?'
 
 try:
  f = open(path, 'r')
  key = f.read()
  f.close()
  
 except:
  solver = InputWindow( txt=txt1)
  u = solver.get()
  solver = InputWindow( txt=txt2)
  p = solver.get()
  key = 'username=' + u + '&password=' + p
  f = open(path, 'w')
  f.write(key)
  f.close()

 full = url + key + '&type=m3u'
 return full
 #THIS WILL RETURN THE FULL URL TO PUT IN EXTERNALLINK.
  
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>
jujuuj
jujuuj

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

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by Pibox on Mon 21 May - 3:32

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

Can you fix it please ?



UP

pleaaaaase

Pibox

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

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by jujuuj on Sun 27 May - 1:44

i faced the same problem, and solved it  adding a kind of "patch" to the regex ... I assume there is something wrong propoably in first python lines, but the item will work if you dont remove the "patch" part ...

Code:


 dont remove <item>PATCH dont remove <title>       </title>
<info>YES/NO  BOX is buggy  dont remove</info> dont remove
<link>no</link>
<externallink>$doregex[bug]</externallink>
<regex>
<name>bug</name>
<expres><![CDATA[#$pyFunction
import xbmcgui
def GetLSProData(page_data,Cookie_Jar,m):
]]></expres>
<page></page>
</regex>
</item>
<item>
<title>Ace + 18  YES/NO   </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 = "   WARNING : Explicit SEXual content ...   "  
    line1 = "      Are you"
    line2 = "      Over 18 ?"
    line3 = "      ... and under 80 ? "
    ok = xbmcgui.Dialog().yesno(title, line1, line2, line3)
    if ( not ok ):
     return "http://pastebin.com/raw/83PyMhip"
    else :
     return "http://pastebin.com/raw/  3eMjfuL2"
]]></expres>
<page></page>
</regex>
<fanart></fanart>
</item>
 

I use the same "patch" (yes i know, this is not a patch..)
for the OK box that has the same bug ...

If someone can give a better solution, he is very welcome
[the problem is : how to remove the patch and make the item YES/NO works without the patch
jujuuj
jujuuj

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

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by JonnyB on Fri 3 Aug - 12:01

Hi,

Is it possible to send a login data to the site and save it?

Code:
https://mrpiracy.site/

The rest of the regex I think I can do it.

Thanks

JonnyB

Messages : 18
Date d'inscription : 2017-04-18

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by thingy on Tue 11 Sep - 21:43


How do I set an external list password in either pastebin or dropbox? Using £$π can you make an example?

thingy

Messages : 7
Date d'inscription : 2018-04-18

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by vbprofi on Sun 30 Dec - 4:57

Hello,
the refresh feature with OK Box don't work with Kodi 18 on windows 10. If I update the £$π List, and press refesh-item with OK Box the OK Box is show, but after press ok, the list don't refresh/reload with new updates.
have someone an idea?
Code:

<item>
<title>[b]Aktuallisieren[/b]</title>
<thumbnail></thumbnail>
<link>$doregex[openDialog]</link>

<regex>
<name>openDialog</name>
<expres><![CDATA[#$pyFunction
import xbmcaddon
import xbmcgui
import xbmc

def GetLSProData(page_data,Cookie_Jar,m):
#    xbmc.executebuiltin("XBMC.Notification(£$π,Now playing: [COLOR green]Big Buck Bunny.[/COLOR] ,5000)")
    title = "Aktuallisierung der Liste" 
    line1 = "Die Liste wird aktuallisiert."
    line2 = "Bitte klicken sie auf 'ok', um fortzufahren."
    line3 = "..."
#    xbmcgui.Dialog().yesno(title, line1, line2, line3)
    xbmcgui.Dialog().ok(title, line1, line2, line3)
    return null
]]></expres>
<page></page>
</regex>
</item>

vbprofi

Messages : 63
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 Mon 31 Dec - 1:33

it says return null ... so it returns null
and null is ... nothing ... empty ...

so the <link>$doregex[openDialog]</link>
is finally <link></link>  ... or  <link>null</link> if you prefer ...

so it will refresh ... nothing ; it won't try to do anything actually ...
!

what is exactly the thing that you want to refresh ? an xml list ? or a link(item) ?


//////////////

i got this
Code:

<item><title> ADULT  SECTION  +18     YES/NO   </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 = "   WARNING : Explicit content ...   "  
    line1 = "      Are you"
    line2 = "      Over 18 y.o. ?"
    line3 = "      ... and under 80 y.o. ? "
    ok = xbmcgui.Dialog().yesno(title, line1, line2, line3)
    if ( not ok ):
     pass
    else:
     return "http://pastebin.com/raw/XXXXXXXX"
]]></expres>
<page></page>
</regex>
</item>


 
<item>
<title> [color=undefined]   [i] - REFRESH -[/i] [/color] </title>
<thumbnail>https://png.icons8.com/small/1600/refresh.png</thumbnail>
<link>NA</link>
<externallink>http://pastebin.com/raw/XXXXXXXX</externallink>
</item>
jujuuj
jujuuj

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

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by vbprofi on Mon 31 Dec - 1:59

Hi,
thanks for your answer. I will try to refresh the opened list. your example open new same list. If I use your example for open new same list and press back, than I can show the old unfreshed list. My idea is, find a solution for that problem.
do you have idea?

I wish you and all other friends a happy new year!

vbprofi

Messages : 63
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 Tue 1 Jan - 13:09

HNY!

as it is the "BACK" button, It will come back and show the page before (unfreshed) ; logical ... I don't know how to change this.

u may try to re-open £$π (using python), instead of opening an external link , in the item ... That could 'block' the Back action ..?
Code:

if ( not ok ):
     pass
 else:
   xbmc.executebuiltin('ActivateWindow(10502,"plugin://plugin.video.live.streamspro"))
  ##never tested !


or something like that ?? (with the correct number of window?unknown)
Code:

 if ( not ok ):
   pass
 else:
   xbmc.executebuiltin("ActivateWindow(0)")


Personnally I use TWO different pages and xml lists for INTRODUCTION  and HOMEpage
so the user is entering by the intro, and when he clicks on le item "HOMEpage", he automatically get the latest fresh version of my HOME

With this "solution", users still have a trouble of unfreshed intro ; so when i update the intro, I put in my Homepage a "link refresh" pointing to the (renewed) intro ...

This is not exactly what you asked, but this is how I deal with this situation ... Smile
jujuuj
jujuuj

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

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by vbprofi on Wed 2 Jan - 5:27

Hello,
your 'solution' with refreshing the webpage isn't work for me, because I grabb with £$π from other people ;-)
But you give me good idea, to trying.
with the following code Kodi is 'refreshing'. On clicking the refresh-item, that closing £$π or go 2x back and run £$π. But on this 'solution' is a bug. People have to dubble click. On first clicking isn't work, but on 2x clicking it is working and I geht a error.
Code:

04:57:21.254 T:15956  ERROR: Control 50 in window 10025 has been asked to focus, but it can't

Code:

<item>
<title>[b]refresh[/b]</title>
<thumbnail></thumbnail>
<link>no</link>
<externallink>$doregex[openDialog]</externallink>

<regex>
<name>openDialog</name>
<expres><![CDATA[#$pyFunction
import xbmcaddon
import xbmcgui
import xbmc

def GetLSProData(page_data,Cookie_Jar,m):
#    xbmc.executebuiltin("XBMC.Notification(£$π,Now playing: [COLOR green]Big Buck Bunny.[/COLOR] ,5000)")
    title = "Aktuallisierung der Liste" 
    line1 = "Die Liste wird aktuallisiert."
    line2 = "Bitte klicken sie auf 'ja', um fortzufahren oder auf 'nein', um abzubrechen."
    line3 = "..."

    ok = xbmcgui.Dialog().yesno(title, line1, line2, line3)
    if ok:

    xbmc.executebuiltin("Action(Close)")

    xbmc.executebuiltin("Action(Back,%s)" % xbmcgui.getCurrentWindowId())
    xbmc.executebuiltin("Action(ParentDir, %s)" % xbmcgui.getCurrentWindowId())
#    xbmc.sleep(100)
    xbmc.executebuiltin("ActivateWindow(10025)") #try for bug
    xbmc.executebuiltin("ActivateWindow(video, plugin://plugin.video.live.streamspro") #not work
    xbmc.executebuiltin("ActivateWindow(10025)") #try for bug

    xbmc.executebuiltin("RunAddon(plugin.video.live.streamspro)") #working
    xbmc.executebuiltin("ActivateWindow(10025)") #try for bug
#    return 'https://...xml'
    else:
    return '<item><title> ! Aktion wurde abgebrochen !</title><link>no</link></item>'
]]></expres>
<page></page>
</regex>
</item>

Do you have ideas, what the problem is?

vbprofi

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

View user profile

Back to top Go down

Re: Xbmc tool box / Xbmc gui (Kodi)

Post by Sponsored content


Sponsored content


Back to top Go down

Page 2 of 3 Previous  1, 2, 3  Next

Back to top

- Similar topics

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