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

TVaddon's  community

créer un forum


That Code is not working, why?

Go down

That Code is not working, why? Empty That Code is not working, why?

Post by vbprofi on Wed 11 Apr - 17:01

please help to fix that code for creating login-function. I don't know, what the problem is. that code isn't work. I hope someone have an idea.

Code:

<item>
<title>Login</title>
<link>$doregex[login]</link>

<regex>
<name>login</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")
path = xbmc.translatePath("special://profile/addon_data/" + "plugin.video.live.streamspro/" + "identification")
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 '
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'

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>

vbprofi

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

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by jujuuj on Thu 12 Apr - 2:27

on THIS code, in the python part, there are a lot of missing espaces at the begining of lines. you should start again from the original code ..

on the "return" line, you may have to change + '&type=m3u' for something else ? check your url ...
jujuuj
jujuuj

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

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by vbprofi on Thu 12 Apr - 13:45

thanks, I have update the code. I need help to fix this code for login with username and password read and write that from file for auto-login. I need an solution for get results from url...

Code:

<item>
<title>login</title>
<link>na</link>
<externallink>$doregex[getinput]</externallink>

<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")
    addon = xbmcaddon.Addon('plugin.video.live.streamspro')
    addon_version = addon.getAddonInfo('version')
    profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
    txt1='Enter username'
    txt2='Enter password'


    try:
        f = open(path, 'r')
        solution = f.read()
        f.close()
        if base64.b64decode(solution) == 'test':
            return play()
    except:
        pass

    solver = InputWindow( txt=txt1)
    user = solver.get()
    solver = InputWindow( txt=txt2)
    pw = solver.get()

    solution = 'username=' + user + '&amp;password=' + base64.b64encode(pw)
    return 'https://.../get.php?' + solution

    f = open(path, 'w')
    f.write(base64.b64encode(pw))
    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'
    return 'http://.../get.php?' + solution
]]></expres>
<page></page>
</regex>
</item>

vbprofi

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

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by jujuuj on Fri 13 Apr - 1:33

good !

but there are still too much things to change :
let's forget base64, keep it for later, when it will work ...
let's forget the solution="test" thing ...
here you dont want to " play() " anything ... you want to open external list ...

so let's start from the begining ... and forget the item above ...
jujuuj
jujuuj

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

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by jujuuj on Fri 13 Apr - 1:38

I think this regex should do the job ...

Code:

<regex>
<name>userpw</name>
<listrepeat><![CDATA[
<title> [userpw.param2] </title>
<link>plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&amp;name=toolsp&amp;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
  
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>

you still have to adapt the <link> at the begining,

and to adapt the end of this:
full = url + key + '&type=m3u'

(and may b useragent and referer)

NOTE : EDITED !


Last edited by jujuuj on Fri 13 Apr - 1:56; edited 1 time in total (Reason for editing : error ...)
jujuuj
jujuuj

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

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by jujuuj on Fri 13 Apr - 1:58

UP ! (edited)
jujuuj
jujuuj

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

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by vbprofi on Sat 14 Apr - 17:52

wow, that is very godd job! it is working!!!
thank you very very much!!!
best regards!

vbprofi

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

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by jujuuj on Sun 15 Apr - 1:34


... indeed

Wink
jujuuj
jujuuj

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

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by solved on Thu 31 May - 8:48


brillantly solved ! Idea

solved

Messages : 70
Date d'inscription : 2017-06-27

View user profile

Back to top Go down

That Code is not working, why? Empty Re: That Code is not working, why?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


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