Exemplo n.º 1
0
def LOGIN_VK(number,password,GET_URL):

                
    
    headers = {}
    headers.update({'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive',
                    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                    'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'en-GB,en-US;q=0.8,en;q=0.6',
                    'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36'})
    
    
    html = net.http_GET('http://vk.com')
    
    
    ip_h = re.search(r'ip_h\"\svalue=\"(.*?)\"', html.content, re.I)
    html = net.http_POST('https://login.vk.com/?act=login', {'act':'login','role':'al_frame','expire':'',
                                                             'captcha_sid':'','_origin':'http://vk.com','ip_h':ip_h.group(1),
                                                             'email':str(number),'pass':str(password)})
    if os.path.exists(cookie_path) == False:
        os.makedirs(cookie_path)
    net.save_cookies(cookie_jar)
    net.set_cookies(cookie_jar)
    
    html = net.http_GET(GET_URL).content.replace('\\','')
    return html
Exemplo n.º 2
0
def LOGIN():
    loginurl = 'http://www.ntv.mx/index.php?c=3&a=4'
    username = ADDON.getSetting('user')
    password = md5(ADDON.getSetting('pass')).hexdigest()

    data = {'email': username, 'psw2': password, 'rmbme': 'on'}
    headers = {
        'Host': 'www.ntv.mx',
        'Origin': 'http://www.ntv.mx',
        'Referer': 'http://www.ntv.mx/index.php?c=3&a=0',
        'User-Agent': UA
    }

    html = net.http_POST(loginurl, data, headers).content
    if 'success' in html:
        if os.path.exists(cookie_path) == False:
            os.makedirs(cookie_path)
        net.save_cookies(cookie_jar)
        ADDON.setSetting(
            'ga_time',
            str(datetime.today() + timedelta(hours=6)).split('.')[0])
        ADDON.setSetting('firstrun', 'true')
    else:
        dialog = xbmcgui.Dialog()
        winput = re.compile('"message":"(.+?)"').findall(html)
        if dialog.yesno("NTV.mx", winput[0], '', 'Please Try Again'):
            SIGNIN()
        else:
            EXIT()
Exemplo n.º 3
0
def solve(url, cookie_file='', wait=True):
    solverregex = re.compile(
        'var t,r,a,f, (.+?)={"(.+?)":(.+?)};.+challenge-form\'\);.*?\n.*?;(.*?);a\.value',
        re.DOTALL)
    vcregex = re.compile(
        '<input type="hidden" name="jschl_vc" value="([^"]+)"/>')
    headers = {
        'User-Agent':
        'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36',
        'Referer': url
    }
    request = requests.get(url, headers=headers).content
    passv = re.compile('<input type="hidden" name="pass" value="([^"]+)"/>'
                       ).findall(request)[0]
    res = solverregex.findall(request)
    if len(res) == 0:
        return False
    res = res[0]
    vc = vcregex.findall(request)
    if len(vc) == 0:
        return False
    vc = vc[0]
    print "VC is ", vc
    varname = (res[0], res[1])
    solved = int(solveEquation(res[2].rstrip()))
    print "Initial value: ", res[2], "Solved:", solved
    for extra in res[3].split(";"):
        extra = extra.rstrip()
        if extra[:len('.'.join(varname))] != '.'.join(varname):
            print "Extra does not start with varname (", extra, ")"
        else:
            extra = extra[len('.'.join(varname)):]
        if extra[:2] == "+=":
            solved += int(solveEquation(extra[2:]))
        elif extra[:2] == "-=":
            solved -= int(solveEquation(extra[2:]))
        elif extra[:2] == "*=":
            solved *= int(solveEquation(extra[2:]))
        elif extra[:2] == "/=":
            solved /= int(solveEquation(extra[2:]))
        else:
            print "Unknown modifier", extra
    http = url.split('//')[0]
    domain1 = url.split('//')[1]
    domain = domain1.split('/')[0]
    solved += len(domain)
    import net
    net = net.Net()
    if wait == True:
        print 'Sleepin'
        xbmc.sleep(6000)
    final = net.http_POST(
        http + "//" + domain +
        "/cdn-cgi/l/chk_jschl?jschl_vc={0}&pass={1}&jschl_answer={2}".format(
            vc, passv, solved),
        '',
        headers=headers)
    if not cookie_file == '':
        net.save_cookies(cookie_file)
    return final.content
Exemplo n.º 4
0
def LOGIN():
    loginurl = 'http://www.ntv.mx/index.php?c=3&a=4'
    username = ADDON.getSetting('user')
    password = md5(ADDON.getSetting('pass')).hexdigest()

    data = {'email': username, 'psw2': password, 'rmbme': 'on'}
    headers = {
        'Host': 'www.ntv.mx',
        'Origin': 'http://www.ntv.mx',
        'Referer': 'http://www.ntv.mx/index.php?c=3&a=0',
        'User-Agent': UA
    }

    html = net.http_POST(loginurl, data, headers).content
    print html
    if 'success' in html:
        if os.path.exists(cookie_path) == False:
            os.makedirs(cookie_path)
        net.save_cookies(cookie_jar)
        ADDON.setSetting(
            'ga_time',
            str(datetime.today() + timedelta(hours=6)).split('.')[0])
        ADDON.setSetting('firstrun', 'true')
    else:
        import firstrun
Exemplo n.º 5
0
def login():
    loginurl = 'https://tvplayer.com/account/login/'
    email = ADDON.getSetting('email')
    password = ADDON.getSetting('password')

    UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'

    headers = {
        'Host': 'tvplayer.com',
        'Connection': 'keep-alive',
        'Cache-Control': 'max-age=0',
        'Origin': 'https://tvplayer.com',
        'Upgrade-Insecure-Requests': '1',
        'User-Agent':
        'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Accept':
        'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
        'Referer': 'https://tvplayer.com/watch',
        'Accept-Encoding': 'gzip, deflate, br',
        'Accept-Language': 'en-US,en;q=0.8'
    }

    link = net.http_GET(loginurl, headers).content
    net.save_cookies(cookie_jar)
    token = re.compile('name="token" value="(.+?)"').findall(link)[0]
    data = {'email': email, 'password': str(password), 'token': token}

    net.set_cookies(cookie_jar)

    net.http_POST(loginurl, data, headers)
    net.save_cookies(cookie_jar)
Exemplo n.º 6
0
def karaokanta_LOGIN():

    loginurl = 'http://www.karaokantalive.com/login.php?action=process'
    username = ADDON.getSetting('karaokantaliveuser')
    password = ADDON.getSetting('karaokantalivepass')

    html = net.http_GET('http://www.karaokantalive.com').content
    formid = re.compile('name="formid" value="(.+?)"').findall(html)[0]
    data = {
        'formid': formid,
        'password': password,
        'email_address': username,
        'submit.x': '0',
        'submit.y': '0'
    }
    headers = {
        'Host': 'www.karaokantalive.com',
        'Origin': 'http://www.karaokantalive.com',
        'Referer': 'http://www.karaokantalive.com'
    }

    html = net.http_POST(loginurl, data, headers).content

    if os.path.exists(cookie_path) == False:
        os.makedirs(cookie_path)
    net.save_cookies(cookie_jar)
Exemplo n.º 7
0
def LOGIN_VK(number,password,GET_URL):

                
    
    headers = {}
    headers.update({'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive',
                    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                    'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'en-GB,en-US;q=0.8,en;q=0.6',
                    'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36'})
    
    
    html = net.http_GET('http://vk.com')
    
    
    ip_h = re.search(r'ip_h\"\svalue=\"(.*?)\"', html.content, re.I)
    html = net.http_POST('https://login.vk.com/?act=login', {'act':'login','role':'al_frame','expire':'',
                                                             'captcha_sid':'','_origin':'http://vk.com','ip_h':ip_h.group(1),
                                                             'email':str(number),'pass':str(password)})
    if os.path.exists(cookie_path) == False:
        os.makedirs(cookie_path)
    net.save_cookies(cookie_jar)
    net.set_cookies(cookie_jar)
    
    html = net.http_GET(GET_URL).content.replace('\\','')
    return html
Exemplo n.º 8
0
def checksub():
   print '########################## checking ########################'
   username = ADDON.getSetting(‘snusername’)
   password = ADDON.getSetting(‘snpassword’)
   
   headers={'Host': THESITE,
            'Connection': 'keep-alive',
            'Origin': 'http://'+THESITE,
            'X-Requested-With': 'XMLHttpRequest',
            'User-Agent': 'XBMC',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            'Referer': 'http://'+THESITE+'/payments/login',
            'Accept-Encoding': 'gzip, deflate',
            'Accept-Language': 'en-US,en;q=0.8'}

   TIME = time.time()- 3600
   
   data={'amember_login':username, 'amember_pass':password , 'login_attempt_id': str(TIME)}
   html = net.http_POST('http://sportsmania.eu/payments/login',data,headers).content

   if 'true' in html:
      net.save_cookies(cookie_amember)
      net.set_cookies(cookie_amember)

      html = net.http_GET(‘http://sportsmania.eu/payments/member').content

      try:
         
          match=re.compile('<h2 id="member-main-subscriptions-head">(.+?)</h2><div class="am-block" id="member-main-subscriptions">    <h3>(.+?)</h3>').findall(html)
     
          line1 = match[0][0].strip()
          line2 = match[0][1].strip()
          line3 = ''
          addDir('No ACtive Subscriptions','',2006,'','','','')
          addDir('You need to resign back up or pay','',2006,'','','','')
          addDir('@','',2006,'','','','')
          addDir('WWW.SPORTSMANIA.EU','',2006,'','','','')
    
      except:
         try:
             addDir('My Active Subscriptions','',2006,'','','','')
             match=re.compile('<li><strong>(.+?)</strong>(.+?)</li>',re.DOTALL).findall(html)
             print match
             for sub , expiry in match:
                sub=sub.strip().replace('  ','')
                expiry=expiry.replace('\n',' ').replace('  ','')
                
                addDir('[COLOR white]%s %s[/COLOR]' % (sub,expiry),'',2006,'','','','')
          
         except:     
             dialog = xbmcgui.Dialog()
             if dialog.yesno("Please Check Your Details & Try Again", "Username : "******"Password : "******"[COLOR red]is Wrong Please....Try Again ?[/COLOR]"):
                 ADDON.setSetting('user','')
                 ADDON.setSetting('pass','')
                 os.remove(SETTINGS)

                 TryAgain()
             else:
                EXIT()
Exemplo n.º 9
0
def getData(url,headers={}):
    net.save_cookies(cookie_jar)
    req = urllib2.Request(url)
    req.add_header('User-Agent', USER_AGENT)
    response = urllib2.urlopen(req)
    data=response.read()
    response.close()
    return data
Exemplo n.º 10
0
def getData(url, headers={}):
    net.save_cookies(cookie_jar)
    req = urllib2.Request(url)
    req.add_header('User-Agent', USER_AGENT)
    response = urllib2.urlopen(req)
    data = response.read()
    response.close()
    return data
Exemplo n.º 11
0
def tvplayer(url):
    if ADDON.getSetting('premium')== 'true':
        login()
    net.set_cookies(cookie_jar)
    headers={'Host': 'tvplayer.com',
            'Connection': 'keep-alive',
            'Origin': 'http://tvplayer.com',
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            'Accept': '*/*',
            'Accept-Encoding': 'gzip, deflate',
            'Accept-Language': 'en-US,en;q=0.8'}

    html=net.http_GET('http://tvplayer.com/watch/', headers).content
    
    DATA_TOKEN=re.compile('data-token="(.+?)"').findall(html)[0]
 
    URL='https://tvplayer.com/watch/context?resource=%s&gen=%s' % (url,DATA_TOKEN)
  
    html=net.http_GET(URL, headers).content

    VALIDATE=re.compile('"validate":"(.+?)"').findall(html)[0]
    
    
    if ADDON.getSetting('premium')== 'true':
         TOKEN=re.compile('"token":"(.+?)"').findall(html)[0]
    else:TOKEN='null'
    
    data={'service':'1',
          'platform':'chrome',
          'id':url,
          'token':TOKEN,
          'validate':VALIDATE}

         
    POSTURL='http://api.tvplayer.com/api/v2/stream/live'
    headers={'Host': 'api.tvplayer.com',
            'Connection': 'keep-alive',
            'Origin': 'http://api.tvplayer.com',
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            'Accept': '*/*',
            'Accept-Encoding': 'gzip, deflate',
            'Accept-Language': 'en-US,en;q=0.8'}
    try:
            LINK=net.http_POST(POSTURL, data,headers=headers).content
            net.save_cookies(cookie_jar)
         
            return re.compile('stream":"(.+?)"').findall(LINK)[0].replace(' ','')
    except Exception as e:
                if '401' in str(e):
                    add='Please Sign up for free account and enter details in addon settings'
                else:
                    add=''
                dialog = xbmcgui.Dialog()
                dialog.ok("TV Player", '',str(e), add)
                return None
Exemplo n.º 12
0
def solve(url, cookie_file="", wait=True):
    solverregex = re.compile(
        'var t,r,a,f, (.+?)={"(.+?)":(.+?)};.+challenge-form\'\);.*?\n.*?;(.*?);a\.value', re.DOTALL
    )
    vcregex = re.compile('<input type="hidden" name="jschl_vc" value="([^"]+)"/>')
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36",
        "Referer": url,
    }
    request = requests.get(url, headers=headers).content
    passv = re.compile('<input type="hidden" name="pass" value="([^"]+)"/>').findall(request)[0]
    res = solverregex.findall(request)
    if len(res) == 0:
        return False
    res = res[0]
    vc = vcregex.findall(request)
    if len(vc) == 0:
        return False
    vc = vc[0]
    print "VC is ", vc
    varname = (res[0], res[1])
    solved = int(solveEquation(res[2].rstrip()))
    print "Initial value: ", res[2], "Solved:", solved
    for extra in res[3].split(";"):
        extra = extra.rstrip()
        if extra[: len(".".join(varname))] != ".".join(varname):
            print "Extra does not start with varname (", extra, ")"
        else:
            extra = extra[len(".".join(varname)) :]
        if extra[:2] == "+=":
            solved += int(solveEquation(extra[2:]))
        elif extra[:2] == "-=":
            solved -= int(solveEquation(extra[2:]))
        elif extra[:2] == "*=":
            solved *= int(solveEquation(extra[2:]))
        elif extra[:2] == "/=":
            solved /= int(solveEquation(extra[2:]))
        else:
            print "Unknown modifier", extra
    http = url.split("//")[0]
    domain1 = url.split("//")[1]
    domain = domain1.split("/")[0]
    solved += len(domain)
    import net

    net = net.Net()
    if wait == True:
        print "Sleepin"
        xbmc.sleep(6000)
    final = net.http_POST(
        http + "//" + domain + "/cdn-cgi/l/chk_jschl?jschl_vc={0}&pass={1}&jschl_answer={2}".format(vc, passv, solved),
        "",
        headers=headers,
    )
    if not cookie_file == "":
        net.save_cookies(cookie_file)
    return final.content
Exemplo n.º 13
0
def login():
    header_dict = {}
    header_dict['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
    header_dict['Host'] = 'www.filmon.com'
    header_dict['Referer'] = 'http://www.filmon.com/'
    header_dict['User-Agent'] = 'Mozilla/5.0 (Linux; <Android Version>; <Build Tag etc.>) AppleWebKit/<WebKit Rev>(KHTML, like Gecko) Chrome/<Chrome Rev> Safari/<WebKit Rev>'
    header_dict['Content-Type'] = 'application/x-www-form-urlencoded'
    header_dict['Connection'] = 'keep-alive'
    form_data = ({'login': email, 'password': password,'remember': '1'})	
    net.set_cookies(cookie_jar)
    login = net.http_POST('http://www.filmon.com/user/login', form_data=form_data, headers=header_dict)
    net.save_cookies(cookie_jar)
    keep_alive()
Exemplo n.º 14
0
def LOGIN():
	utils.log('firstrun.py','LOGIN')
	loginurl = definition.getBASEURL() + '/index.php?' + recordings.referral()+ 'c=3&a=4'
	username =ADDON.getSetting('user')
	password =md5(ADDON.getSetting('pass')).hexdigest()

	data     = {'email': username,
											'psw2': password,
											'rmbme': 'on'}
	headers  = {'Host':definition.getBASEURL().replace('http://',''),
											'Origin':definition.getBASEURL(),
											'Referer':definition.getBASEURL() + '/index.php?' + recordings.referral()+ 'c=3&a=0','User-Agent' : UA}
											
	html = net.http_POST(loginurl, data, headers).content
	#if os.path.exists(cookie_path) == False:
	#		os.makedirs(cookie_path)
	#net.save_cookies(cookie_jar)
	#ADDON.setSetting('firstrun','true')
        
#def EXIT():
#        xbmc.log('firstrun.py: EXIT')
#        xbmc.executebuiltin("XBMC.Container.Update(path,replace)")
#        xbmc.executebuiltin("XBMC.ActivateWindow(Home)")
#            
#def AUTH():
#	xbmc.log('firstrun.py: AUTH')
#        try:
#            os.remove(cookie_jar)
#        except:
#            pass
        username =ADDON.getSetting('user')
        password =md5(ADDON.getSetting('pass')).hexdigest()
        url = definition.getBASEURL() + '/?' + recordings.referral() + 'c=3&a=4&email=%s&psw2=%s&rmbme=on'%(username,password)
        html = net.http_GET(url).content
        if 'success' in html and '@' in username:
		## 3.4.6  LOGIN()
		if os.path.exists(cookie_path) == False:
			os.makedirs(cookie_path)
		net.save_cookies(cookie_jar)
		ADDON.setSetting('ga_time',str(datetime.today()+ timedelta(hours=6)).split('.')[0])
		ADDON.setSetting('firstrun','true')
        else:
            dialog = xbmcgui.Dialog()
            winput=re.compile('"message":"(.+?)"').findall(html)
            if dialog.yesno(ADDON.getAddonInfo('name'), winput[0],'', 'Please Try Again'):
                SIGNIN()
            else:
                EXIT()
Exemplo n.º 15
0
def createCookie(url,cj=None,agent='Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0'):
    urlData=''
    try:
        import urlparse,cookielib,urllib2
        class NoRedirection(urllib2.HTTPErrorProcessor):    
            def http_response(self, request, response):
                return response
        def parseJSString(s):
            try:
                offset=1 if s[0]=='+' else 0
                val = int(eval(s.replace('!+[]','1').replace('!![]','1').replace('[]','0').replace('(','str(')[offset:]))
                return val
            except:
                pass
        if cj==None:
            cj = cookielib.CookieJar()
        headers={'User-Agent' : agent,'Referer' : url}       
        result = requests.get(url,headers=headers).content
        jschl = re.compile('name="jschl_vc" value="(.+?)"/>').findall(result)[0]
        init = re.compile('setTimeout\(function\(\){\s*.*?.*:(.*?)};').findall(result)[0]
        builder = re.compile(r"challenge-form\'\);\s*(.*)a.v").findall(result)[0]
        decryptVal = parseJSString(init)
        lines = builder.split(';')
        for line in lines:
            if len(line)>0 and '=' in line:
                sections=line.split('=')
                line_val = parseJSString(sections[1])
                decryptVal = int(eval(str(decryptVal)+sections[0][-1]+str(line_val)))
        answer = decryptVal + len(urlparse.urlparse(url).netloc)
        http=url.split('//')[0]
        domain1=url.split('//')[1]
        domain=domain1.split('/')[0]
        u=http+'//'+domain
        query = '%s/cdn-cgi/l/chk_jschl?jschl_vc=%s&jschl_answer=%s' % (u, jschl, answer)

        if 'type="hidden" name="pass"' in result:
            passval=re.compile('name="pass" value="(.*?)"').findall(result)[0]
            query = '%s/cdn-cgi/l/chk_jschl?pass=%s&jschl_vc=%s&jschl_answer=%s' % (u,urllib.quote_plus(passval), jschl, answer)
            xbmc.sleep(4*1000) ##sleep so that the call work
        import net
        net = net.Net()
        final = net.http_POST(query,'',headers=headers)
        if not cj == '':
            net.save_cookies(cj)   
        return final.content
    except:
        traceback.print_exc(file=sys.stdout)
        return urldata
Exemplo n.º 16
0
def createCookie(url,cj=None,agent='Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0'):
    urlData=''
    try:
        import urlparse,cookielib,urllib2
        class NoRedirection(urllib2.HTTPErrorProcessor):    
            def http_response(self, request, response):
                return response
        def parseJSString(s):
            try:
                offset=1 if s[0]=='+' else 0
                val = int(eval(s.replace('!+[]','1').replace('!![]','1').replace('[]','0').replace('(','str(')[offset:]))
                return val
            except:
                pass
        if cj==None:
            cj = cookielib.CookieJar()
        headers={'User-Agent' : agent,'Referer' : url}       
        result = requests.get(url,headers=headers).content
        jschl = re.compile('name="jschl_vc" value="(.+?)"/>').findall(result)[0]
        init = re.compile('setTimeout\(function\(\){\s*.*?.*:(.*?)};').findall(result)[0]
        builder = re.compile(r"challenge-form\'\);\s*(.*)a.v").findall(result)[0]
        decryptVal = parseJSString(init)
        lines = builder.split(';')
        for line in lines:
            if len(line)>0 and '=' in line:
                sections=line.split('=')
                line_val = parseJSString(sections[1])
                decryptVal = int(eval(str(decryptVal)+sections[0][-1]+str(line_val)))
        answer = decryptVal + len(urlparse.urlparse(url).netloc)
        http=url.split('//')[0]
        domain1=url.split('//')[1]
        domain=domain1.split('/')[0]
        u=http+'//'+domain
        query = '%s/cdn-cgi/l/chk_jschl?jschl_vc=%s&jschl_answer=%s' % (u, jschl, answer)

        if 'type="hidden" name="pass"' in result:
            passval=re.compile('name="pass" value="(.*?)"').findall(result)[0]
            query = '%s/cdn-cgi/l/chk_jschl?pass=%s&jschl_vc=%s&jschl_answer=%s' % (u,urllib.quote_plus(passval), jschl, answer)
            xbmc.sleep(4*1000) ##sleep so that the call work
        import net
        net = net.Net()
        final = net.http_POST(query,'',headers=headers)
        if not cj == '':
            net.save_cookies(cj)   
        return final.content
    except:
        traceback.print_exc(file=sys.stdout)
        return urldata
Exemplo n.º 17
0
def LOGIN():
        loginurl = 'http://www.ntv.mx/index.php?c=3&a=4'
        username    =ADDON.getSetting('user')
        password =md5(ADDON.getSetting('pass')).hexdigest()

        data     = {'email': username,
                                                'psw2': password,
                                                'rmbme': 'on'}
        headers  = {'Host':'www.ntv.mx',
                                                'Origin':'http://www.ntv.mx',
                                                'Referer':'http://www.ntv.mx/index.php?c=3&a=0','User-Agent' : UA}
                                                
        html = net.http_POST(loginurl, data, headers).content
        if os.path.exists(cookie_path) == False:
                os.makedirs(cookie_path)
        net.save_cookies(cookie_jar)
        ADDON.setSetting('firstrun','true')
Exemplo n.º 18
0
def LOGIN():
        loginurl = 'http://www.wliptv.com/index.php?c=3&a=4'
        username    =ADDON.getSetting('user')
        password =md5(ADDON.getSetting('pass')).hexdigest()

        data     = {'email': username,
                                                'psw2': password,
                                                'rmbme': 'on'}
        headers  = {'Host':'www.wliptv.com',
                                                'Origin':'http://www.wliptv.com',
                                                'Referer':'http://www.wliptv.com/index.php?c=3&a=0','User-Agent' : UA}
                                                
        html = net.http_POST(loginurl, data, headers).content
        if os.path.exists(cookie_path) == False:
                os.makedirs(cookie_path)
        net.save_cookies(cookie_jar)
        ADDON.setSetting('firstrun','true')
def LOGIN():
    loginurl = "http://www.ntv.mx/index.php?c=3&a=4"
    username = ADDON.getSetting("user")
    password = md5(ADDON.getSetting("pass")).hexdigest()

    data = {"email": username, "psw2": password, "rmbme": "on"}
    headers = {
        "Host": "www.ntv.mx",
        "Origin": "http://www.ntv.mx",
        "Referer": "http://www.ntv.mx/index.php?c=3&a=0",
        "User-Agent": "NTV-XBMC-2.0",
    }

    html = net.http_POST(loginurl, data, headers).content
    if "success" in html:
        if os.path.exists(cookie_path) == False:
            os.makedirs(cookie_path)
        net.save_cookies(cookie_jar)
Exemplo n.º 20
0
def Login():
    print '###############    LOGIN TO STVB   #####################'
    loginurl = 'http://' + THESITE + '/payments/login'
    username = ADDON.getSetting('user')
    password = ADDON.getSetting('pass')
    import time
    TIME = time.time() - 3600

    data = {
        'amember_login': username,
        'amember_pass': password,
        'login_attempt_id': str(TIME).split('.')[0],
        'remember_login': '******'
    }

    headers = {
        'Accept': '*/*',
        'Accept-Encoding': 'gzip,deflate,sdch',
        'Accept-Language': 'en-US,en;q=0.8',
        'Connection': 'keep-alive',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Host': THESITE,
        'Origin': 'http://' + THESITE,
        'Referer': 'http://' + THESITE + '/payments/login',
        'User-Agent':
        'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36',
        'X-Requested-With': 'XMLHttpRequest'
    }

    html = net.http_POST(loginurl, data, headers).content

    if os.path.exists(cookie_path) == False:
        os.makedirs(cookie_path)
    add_ontapp = ontapp1 + 1
    ADDON.setSetting('ontapp_id_1', str(add_ontapp))
    net.save_cookies(cookie_jar)
    net.set_cookies(cookie_jar)
    a = net.http_GET('http://' + THESITE + '/payments/api/matrix/channels',
                     headers={
                         'User-Agent': UA
                     }).content
    f = open(channeljs, mode='w')
    f.write(a)
    f.close()
Exemplo n.º 21
0
def Login():
    print '###############    LOGIN TO OSS   #####################'
    loginurl = 'http://'+THESITE+'/site/wp-login.php'
    username = ADDON.getSetting('user')
    password = ADDON.getSetting('pass')

    data     = {'pwd': password,
                                            'log': username,
                                            'wp-submit': 'Log In','redirect_to':'http://'+THESITE+'/site','testcookie':'1','rememberme':'forever'}




    headers  = {'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                'Accept-Encoding':'gzip, deflate',
                'Accept-Language':'en-US,en;q=0.8',
                'Cache-Control':'no-cache',
                'Connection':'keep-alive',
                'Content-Type':'application/x-www-form-urlencoded',
                'Host':'offsidestreams.com',
                'Origin':'http://'+THESITE,
                'Pragma':'no-cache',
                'Referer':'http://'+THESITE+'/site/wp-login.php',
                'Upgrade-Insecure-Requests':'1',
                'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36'}


    html = net.http_POST(loginurl, data, headers).content
  
    print html
    if os.path.exists(cookie_path) == False:
            os.makedirs(cookie_path)
    add_ontapp = ontapp1 + 1        
    ADDON.setSetting('ontapp_id_1',str(add_ontapp))       
    net.save_cookies(cookie_jar)
    net.set_cookies(cookie_jar)
    a=net.http_GET('http://'+THESITE+'/site/api/matrix/channels',headers={'User-Agent' :UA}).content
    f = open(channeljs, mode='w')
    f.write(a)
    f.close()
Exemplo n.º 22
0
def LOGIN_VK(number, password, GET_URL):

    headers = {}
    headers.update(
        {
            "Content-Type": "application/x-www-form-urlencoded",
            "Connection": "keep-alive",
            "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
            "Accept-Encoding": "gzip,deflate,sdch",
            "Accept-Language": "en-GB,en-US;q=0.8,en;q=0.6",
            "User-Agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36",
        }
    )

    html = net.http_GET("http://vk.com")

    ip_h = re.search(r"ip_h\"\svalue=\"(.*?)\"", html.content, re.I)
    html = net.http_POST(
        "https://login.vk.com/?act=login",
        {
            "act": "login",
            "role": "al_frame",
            "expire": "",
            "captcha_sid": "",
            "_origin": "http://vk.com",
            "ip_h": ip_h.group(1),
            "email": str(number),
            "pass": str(password),
        },
    )
    if os.path.exists(cookie_path) == False:
        os.makedirs(cookie_path)
    net.save_cookies(cookie_jar)
    net.set_cookies(cookie_jar)

    html = net.http_GET(GET_URL).content.replace("\\", "")
    return html
Exemplo n.º 23
0
def Login():
    print '###############    LOGIN TO Sports Mania   #####################'
    loginurl = 'http://'+THESITE+'/site/login'
    username = ADDON.getSetting('snusername')
    password = ADDON.getSetting('snpassword')
  

    data     = {'pwd': password,
                                            'log': username,
                                            'submit': 'Log In','redirect_to':'http://'+THESITE+'/site','action':'login'}

    headers  = {'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
                'Accept-Encoding':'gzip, deflate',
                'Accept-Language':'en-US,en;q=0.8',
                'Cache-Control':'no-cache',
                'Connection':'keep-alive',
                'Content-Type':'application/x-www-form-urlencoded',
                'Host':'sportsmania.eu',
                'Origin':'http://sportsmania.eu',
                'Pragma':'no-cache',
                'Referer':'http://sportsmania.eu/site/login/',
                'Upgrade-Insecure-Requests':'1',
                'User-Agent':'XBMC'}

    html = net.http_POST(loginurl, data, headers).content
   
   
    if os.path.exists(cookie_path) == False:
            os.makedirs(cookie_path)
    add_ontapp = ontapp1 + 1        
    ADDON.setSetting('ontapp_id_1',str(add_ontapp))       
    net.save_cookies(cookie_jar)
    net.set_cookies(cookie_jar)
    a=net.http_GET('http://'+THESITE+'/site/api/matrix/channels',headers={'User-Agent' :UA}).content
    f = open(channeljs, mode='w')
    f.write(a)
    f.close()
Exemplo n.º 24
0
def Login():
    print '###############    LOGIN TO STVB   #####################'
    loginurl = 'http://'+THESITE+'/payments/login'
    username = ADDON.getSetting('user')
    password = ADDON.getSetting('pass')
    import time
    TIME = time.time()- 3600
    
    data={'amember_login':username,'amember_pass':password,'login_attempt_id':str(TIME).split('.')[0],'remember_login':'******'} 
  

    headers={'Accept':'*/*',
    'Accept-Encoding':'gzip,deflate,sdch',
    'Accept-Language':'en-US,en;q=0.8',
    'Connection':'keep-alive',
    'Content-Type':'application/x-www-form-urlencoded',
    'Host':THESITE,
    'Origin':'http://'+THESITE,
    'Referer':'http://'+THESITE+'/payments/login',
    'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36',
    'X-Requested-With':'XMLHttpRequest'}

    html = net.http_POST(loginurl, data, headers).content
    

     
    if os.path.exists(cookie_path) == False:
            os.makedirs(cookie_path)
    add_ontapp = ontapp1 + 1        
    ADDON.setSetting('ontapp_id_1',str(add_ontapp))       
    net.save_cookies(cookie_jar)
    net.set_cookies(cookie_jar)
    a=net.http_GET('http://'+THESITE+'/payments/api/matrix/channels',headers={'User-Agent' :UA}).content
    f = open(channeljs, mode='w')
    f.write(a)
    f.close()
Exemplo n.º 25
0
	loginurl = definition.getBASEURL() + '/index.php?' + recordings.referral()+ 'c=3&a=0'
	username    =ADDON.getSetting('user')
	password = md5(ADDON.getSetting('pass')).hexdigest()
	data     = {'email': username,
											'psw2': password,
											'rmbme': 'on'}
	headers  = {'Host':definition.getBASEURL().replace('http://',''),
											'Origin':definition.getBASEURL(),
											'Referer':definition.getBASEURL() + '/index.php?' + recordings.referral()+ 'c=3&a=0'}
											
	#create cookie
	html = net.http_POST(loginurl, data, headers)
	cookie_jar = os.path.join(cookie_path, "ntv.lwp")
	if os.path.exists(cookie_path) == False:
			os.makedirs(cookie_path)
	net.save_cookies(cookie_jar)
	#set cookie to grab url
	net.set_cookies(cookie_jar)
	imageUrl=definition.getBASEURL() + '/res/content/tv/'
	CatUrl=definition.getBASEURL() + '/res/content/categories/'    
	site=definition.getBASEURL() + '/index.php?' + recordings.referral()+ 'c=6&a=0'
	datapath = xbmc.translatePath(ADDON.getAddonInfo('profile'))
	cookie_path = os.path.join(datapath, 'cookies')
	cookie_jar = os.path.join(cookie_path, "ntv.lwp")
	findrecursive.RecursiveRecordingsPlanned('Timed')
	#xbmc.executebuiltin("Container.Refresh")

	lockDescription = '*Stop Recording*.flv'
	recordingLock = os.path.join(ADDON.getSetting('record_path'),lockDescription)
	LockFiles = glob.glob(recordingLock)
	#print 'findrecursivetimed.py: recordingLock= %s' % (repr(LockFiles))
Exemplo n.º 26
0
def checksub():
   print '########################## checking ########################'
   username = ADDON.getSetting('user')
   password = ADDON.getSetting('pass')
   try:os.remove(cookie_jar)
   except:pass
   headers={'Host': THESITE,
            'Connection': 'keep-alive',
            'Origin': 'http://'+THESITE,
            'X-Requested-With': 'XMLHttpRequest',
            'User-Agent': 'XBMC',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            'Referer': 'http://'+THESITE+'/payments/login',
            'Accept-Encoding': 'gzip, deflate',
            'Accept-Language': 'en-US,en;q=0.8'}

   TIME = time.time()- 3600
   
   data={'amember_login':username, 'amember_pass':password , 'login_attempt_id': str(TIME)}
   html = net.http_POST('http://streamtvbox.com/payments/login',data,headers).content

   if 'true' in html:
      ADDON.setSetting('resetpass','false')
      net.save_cookies(cookie_amember)
      net.set_cookies(cookie_amember)

      html = net.http_GET('http://streamtvbox.com/payments/member').content

      try:
         
          match=re.compile('<h2 id="member-main-subscriptions-head">(.+?)</h2><div class="am-block" id="member-main-subscriptions">    <h3>(.+?)</h3>').findall(html)
     
          line1 = match[0][0].strip()
          line2 = match[0][1].strip()
          line3 = ''
          addDir('No Active Subscriptions','',2006,'','','','')
          addDir('Please Login And Pay For Subscription','',2006,'','','','')
          addDir('@','',2006,'','','','')
          addDir('WWW.STREAMTVBOX.COM/PAYMENTS/MEMBER','',2006,'','','','')
          addDir('','',2006,'','','','')
          addDir('[COLOR red]Automatic Recurring Payments Has Now Finished[/COLOR]','',2006,'','','','')
    
      except:
            
          try:os.remove(cookie_jar)
          except:pass         
          addDir('My Active Subscriptions','',2006,'','','','')
          link=html.split('>Active Subscriptions<')[1]
          link=link.split('</ul>')[0]
          match=re.compile('<li>(.+?)-(.+?)</li>',re.DOTALL).findall(link)
          for sub , expiry in match:
             sub=sub.strip().replace('  ','').replace('<strong>','').replace('</strong>','')
             expiry=expiry.replace('\n',' ').replace('  ','')
             if 'expires' in expiry:
                expiry='[COLOR red]%s[/COLOR]' % expiry
             else:
                expiry='[COLOR green]%s[/COLOR]' % expiry                
             addDir('[COLOR white]%s - %s[/COLOR]' % (sub,expiry),'',2006,'','','','')
          
   else:
    if 'please contact website administator' in html:
       
       addDir("------>>>>>> [COLOR red]Please Contact Admin To Unlock Your Account[/COLOR] <<<<<<-----",'',2006,'','','','')
       addDir('','',2006,'','','','')
       addDir("------>>>>>> [COLOR red]Your Account is Locked For Some Reason[/COLOR] <<<<<<-----",'',2006,'','','','')
       addDir('','',2006,'','','','')
       addDir('Visit Below Website','',2006,'','','','')
       addDir('------>>>>>> [COLOR cyan]HTTP://STREAMTVBOX.CHATANGO.COM[/COLOR] <<<<<<-----','',2006,'','','','')
       addDir('','',2006,'','','','')
    else:    
       dialog = xbmcgui.Dialog()
       dialog.ok("Please Check Your Details", "Username : "******"Password : "******"[COLOR red]is Wrong ...[/COLOR]")
       addDir("Doesn't Seem You Have an Account OR Details",'',2006,'','','','')
       addDir('Are Incorrect','',2006,'','','','')
       addDir('','',2006,'','','','')
       addDir('------>>>>>> [COLOR red]RESET PASSWORD [/COLOR]<<<<<<-----','url',2007,'','','','')
       addDir('OR','',2006,'','','','')
       addDir('------>>>>>>   [COLOR green]Try AGAIN    [/COLOR]<<<<<<-----','url',2008,'','','','')
Exemplo n.º 27
0
datapath = xbmc.translatePath(ADDON.getAddonInfo('profile'))
cookie_path = os.path.join(datapath, 'cookies')
cookie_jar = os.path.join(cookie_path, "football.lwp")

VERSION = "1.0.2"
PATH = "Football Replays"
UATRACK = "UA-35537758-1"
USER_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'

datapath = xbmc.translatePath(ADDON.getAddonInfo('profile'))
cookie_path = os.path.join(datapath, 'cookies')
cookie_jar = os.path.join(cookie_path, "football.lwp")

if os.path.exists(cookie_path) == False:
    os.makedirs(cookie_path)
    net.save_cookies(cookie_jar)


def CATEGORIES():
    addDir('Full Matches', 'url', 3, '', '1')
    addDir('Search Team', 'url', 4, '', '1')
    addDir('Highlights', 'url', 5, '', '1')
    setView('movies', 'main')
    #setView is setting the automatic view.....first is what section "movies"......second is what you called it in the settings xml


def CATEGORIES2():
    link = OPEN_URL('http://livefootballvideo.com/fullmatch')
    r = '<div class="cover"><a href="(.+?)" rel="bookmark" title="(.+?)">.+?<img src="(.+?)".+?<p class="postmetadata longdate" rel=".+?">(.+?)/(.+?)/(.+?)</p>'
    match = re.compile(r, re.DOTALL).findall(link)
    print match
Exemplo n.º 28
0
def checksub():
    print '########################## checking ########################'
    username = ADDON.getSetting('user')
    password = ADDON.getSetting('pass')
    try:
        os.remove(cookie_jar)
    except:
        pass
    headers = {
        'Host': THESITE,
        'Connection': 'keep-alive',
        'Origin': 'http://' + THESITE,
        'X-Requested-With': 'XMLHttpRequest',
        'User-Agent': 'XBMC',
        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
        'Referer': 'http://' + THESITE + '/payments/login',
        'Accept-Encoding': 'gzip, deflate',
        'Accept-Language': 'en-US,en;q=0.8'
    }

    TIME = time.time() - 3600

    data = {
        'amember_login': username,
        'amember_pass': password,
        'login_attempt_id': str(TIME)
    }
    html = net.http_POST('http://streamtvbox.com/payments/login', data,
                         headers).content

    if 'true' in html:
        ADDON.setSetting('resetpass', 'false')
        net.save_cookies(cookie_amember)
        net.set_cookies(cookie_amember)

        html = net.http_GET('http://streamtvbox.com/payments/member').content

        try:

            match = re.compile(
                '<h2 id="member-main-subscriptions-head">(.+?)</h2><div class="am-block" id="member-main-subscriptions">    <h3>(.+?)</h3>'
            ).findall(html)

            line1 = match[0][0].strip()
            line2 = match[0][1].strip()
            line3 = ''
            addDir('No Active Subscriptions', '', 2006, '', '', '', '')
            addDir('Please Login And Pay For Subscription', '', 2006, '', '',
                   '', '')
            addDir('@', '', 2006, '', '', '', '')
            addDir('WWW.STREAMTVBOX.COM/PAYMENTS/MEMBER', '', 2006, '', '', '',
                   '')
            addDir('', '', 2006, '', '', '', '')
            addDir(
                '[COLOR red]Automatic Recurring Payments Has Now Finished[/COLOR]',
                '', 2006, '', '', '', '')

        except:

            try:
                os.remove(cookie_jar)
            except:
                pass
            addDir('My Active Subscriptions', '', 2006, '', '', '', '')
            link = html.split('>Active Subscriptions<')[1]
            link = link.split('</ul>')[0]
            match = re.compile('<li>(.+?)-(.+?)</li>', re.DOTALL).findall(link)
            for sub, expiry in match:
                sub = sub.strip().replace('  ',
                                          '').replace('<strong>', '').replace(
                                              '</strong>', '')
                expiry = expiry.replace('\n', ' ').replace('  ', '')
                if 'expires' in expiry:
                    expiry = '[COLOR red]%s[/COLOR]' % expiry
                else:
                    expiry = '[COLOR green]%s[/COLOR]' % expiry
                addDir('[COLOR white]%s - %s[/COLOR]' % (sub, expiry), '',
                       2006, '', '', '', '')

    else:
        if 'please contact website administator' in html:

            addDir(
                "------>>>>>> [COLOR red]Please Contact Admin To Unlock Your Account[/COLOR] <<<<<<-----",
                '', 2006, '', '', '', '')
            addDir('', '', 2006, '', '', '', '')
            addDir(
                "------>>>>>> [COLOR red]Your Account is Locked For Some Reason[/COLOR] <<<<<<-----",
                '', 2006, '', '', '', '')
            addDir('', '', 2006, '', '', '', '')
            addDir('Visit Below Website', '', 2006, '', '', '', '')
            addDir(
                '------>>>>>> [COLOR cyan]HTTP://STREAMTVBOX.CHATANGO.COM[/COLOR] <<<<<<-----',
                '', 2006, '', '', '', '')
            addDir('', '', 2006, '', '', '', '')
        else:
            dialog = xbmcgui.Dialog()
            dialog.ok("Please Check Your Details",
                      "Username : "******"Password : "******"[COLOR red]is Wrong ...[/COLOR]")
            addDir("Doesn't Seem You Have an Account OR Details", '', 2006, '',
                   '', '', '')
            addDir('Are Incorrect', '', 2006, '', '', '', '')
            addDir('', '', 2006, '', '', '', '')
            addDir(
                '------>>>>>> [COLOR red]RESET PASSWORD [/COLOR]<<<<<<-----',
                'url', 2007, '', '', '', '')
            addDir('OR', '', 2006, '', '', '', '')
            addDir(
                '------>>>>>>   [COLOR green]Try AGAIN    [/COLOR]<<<<<<-----',
                'url', 2008, '', '', '', '')
Exemplo n.º 29
0
def play_filmon(name,url,iconimage,description):
    streamerlink = net.http_GET(url).content.encode("utf-8").rstrip()
    net.save_cookies(cookie_jar)
    swfplay = 'http://www.filmon.com' + regex_from_to(streamerlink, '"streamer":"', '",').replace("\/", "/")

    name = name.replace('[COLOR cyan]','').replace('[/COLOR]','')
    dp = xbmcgui.DialogProgress()
    dp.create('Opening ' + name.upper())
    utc_now = datetime.datetime.now()
    channel_name=name
    net.set_cookies(cookie_jar)
    url='http://www.filmon.com/channel/%s' % (description)
    link = net.http_GET(url,headers={'Accept':'application/json, text/javascript, */*; q=0.01'}).content
    link = json.loads(link)
    link = str(link)
	
    next_p = regex_from_to(link, "next_playing'", "u'title")
    try:
        n_start_time = datetime.datetime.fromtimestamp(int(regex_from_to(next_p, "startdatetime': u'", "',")))
        n_end_time = datetime.datetime.fromtimestamp(int(regex_from_to(next_p, "enddatetime': u'", "',")))
        n_programme_name = regex_from_to(next_p, "programme_name': u'", "',")
        n_start_t = n_start_time.strftime('%H:%M')
        n_end_t = n_end_time.strftime('%H:%M')
        n_p_name = "[COLOR cyan]Next: %s (%s-%s)[/COLOR]" % (n_programme_name, n_start_t, n_end_t)
    except:
        n_p_name = ""
		
    now_p = regex_from_to(link, "now_playing':", "u'tvguide")
    try:
        start_time = datetime.datetime.fromtimestamp(int(regex_from_to(now_p, "startdatetime': u'", "',")))
        end_time = datetime.datetime.fromtimestamp(int(regex_from_to(now_p, "enddatetime': u'", "',")))
        programme_name = regex_from_to(now_p, "programme_name': u'", "',")
        description = ""
        start_t = start_time.strftime('%H:%M')
        end_t = end_time.strftime('%H:%M')
        p_name = "%s (%s-%s)" % (programme_name, start_t, end_t)
        dp.update(50, p_name)
    except:
        try:
            p_name = programme_name
        except:
            p_name = name
    streams = regex_from_to(link, "streams'", "u'tvguide")
    hl_streams = regex_get_all(streams, '{', '}')
    if ADDON.getSetting('res') == '1':
        url = regex_from_to(hl_streams[0], "url': u'", "',")
        name = regex_from_to(hl_streams[0], "name': u'", "',")
    else:
        url = regex_from_to(hl_streams[1], "url': u'", "',")
        name = regex_from_to(hl_streams[1], "name': u'", "',")      
    try:
        timeout = regex_from_to(hl_streams[1], "watch-timeout': u'", "',")
    except:
        timeout = '86500'



    playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
    playlist.clear()
    handle = str(sys.argv[1])
    try:
        listitem = xbmcgui.ListItem(p_name + ' ' + n_p_name, iconImage=iconimage, thumbnailImage=iconimage, path=url)
        if handle != "-1":	
            listitem.setProperty("IsPlayable", "true")
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
        else:
            xbmcPlayer = xbmc.Player()
            xbmcPlayer.play(url,listitem)
    except:
        listitem = xbmcgui.ListItem(channel_name, iconImage=iconimage, thumbnailImage=iconimage, path=url)
        if handle != "-1":
            listitem.setProperty("IsPlayable", "true")
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
        else:
            xbmcPlayer = xbmc.Player()
            xbmcPlayer.play(url,listitem)
    dp.close()