Esempio n. 1
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)
Esempio n. 2
0
def GetStreams(name,iconimage,channelid):
        UAToken = GetToken('http://uktvnow.net/app2/v3/get_user_agent', Username)
        headers={'User-Agent':'USER-AGENT-UKTVNOW-APP-V2','app-token':UAToken}
        postdata={'User-Agent':'USER-AGENT-UKTVNOW-APP-V2','app-token':UAToken,'version':'5.7'}
        UAPage = net.http_POST('http://uktvnow.net/app2/v3/get_user_agent',postdata, headers).content
	UAString=re.compile('"msg":{".+?":"(.+?)"}}').findall(UAPage)[0]
	#UA=magicness(UAString)
        UA=UAString
	playlist_token = GetToken('http://uktvnow.net/app2/v3/get_valid_link', Username+channelid)
	postdata = {'useragent':UA,'username':Username,'channel_id':channelid,'version':'5.7'}	
	headers={'User-Agent':'USER-AGENT-UKTVNOW-APP-V2','app-token':playlist_token}
	channels = net.http_POST('http://uktvnow.net/app2/v3/get_valid_link',postdata, headers).content
	match=re.compile('"channel_name":"(.+?)","img":".+?","http_stream":"(.+?)","rtmp_stream":"(.+?)"').findall(channels)
	for name,stream1,stream2 in match:	  
		streamname=[]
                streamurl=[]
                streamurl.append( stream1 )
                streamurl.append( stream2 )
                streamname.append( 'Stream 1' )
                streamname.append( 'Stream 2' )
	select = dialog.select(name,streamname)
	if select == -1:return
	else:
		url=streamurl[select]
		url=magicness(url)
		if 'http' in url: url = url+"|User-Agent=EMVideoView 2.5.6 (25600) / Android 6.0.1 / SM-G935F"
		else: url = url+' timeout=10'
		ok=True
		liz=xbmcgui.ListItem(name, iconImage=iconimage,thumbnailImage=iconimage); liz.setInfo( type="Video", infoLabels={ "Title": name } )
		ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
		xbmc.Player().play(url, liz, False)
		return ok
Esempio n. 3
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)
Esempio 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
Esempio n. 5
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
Esempio n. 6
0
def afdah(url):
    url = 'https://m.afdah.org/watch?v=' + url

    loginurl = 'https://m.afdah.org/video_info/html5'

    v = url.split('v=')[1]
    data = {'v': v}
    headers = {
        'host': 'm.afdah.org',
        'origin': 'https://m.afdah.org',
        'referer': url,
        'user-agent':
        'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5',
        'x-requested-with': 'XMLHttpRequest'
    }

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

    link = json.loads(first)
    name = []
    url = []
    for j in link:
        name.append(j.upper())

        url.append(urllib.unquote(link[j][3]))

    THEURL = url[xbmcgui.Dialog().select('Please Select Resolution', name)]
    import requests
    r = requests.get(THEURL, allow_redirects=False, verify=False)

    r = requests.get(str(r.headers['Location']),
                     allow_redirects=False,
                     verify=False)

    return r.headers['location']
Esempio n. 7
0
def afdah(url):
    url= 'https://m.afdah.org/watch?v='+url

    loginurl = 'https://m.afdah.org/video_info/html5'

    v=url.split('v=')[1]
    data={'v': v}
    headers = {'host': 'm.afdah.org','origin':'https://m.afdah.org', 'referer': url,
               'user-agent':'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5','x-requested-with':'XMLHttpRequest'}

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

    link= json.loads(first)
    name=[]
    url=[]
    for j in link:
        name.append(j.upper())
   
        url.append('https://m.afdah.org'+link[j][3]) 

    THEURL= url[xbmcgui.Dialog().select('Please Select Resolution', name)]
    import requests
    r=requests.get(THEURL,allow_redirects=False)

    match=re.compile("(https\://redirector\.googlevideo.*?)'").findall(str(r.headers))[0]

    r = requests.get(match,allow_redirects=False)

    return r.headers['location']
Esempio n. 8
0
def solve(url):
    html = net.http_GET(url)
    import time
    time.sleep(2)
    html = html.content
    postData = {}
    for item in re.finditer(r'\"\sname\=\"(.*?)\"\svalue=\"?(.*?)\"', html,
                            re.I):
        postData.update({str(item.group(1)): str(item.group(2))})

    if postData:
        URL = net.http_POST(
            url,
            postData,
            headers={
                'Content-Type':
                'application/x-www-form-urlencoded',
                'Referer':
                str(url),
                'Origin':
                'http://movreel.com',
                'Accept':
                'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
            }).content

        LINK = URL.split('<a href')
        for p in LINK:
            d = p.split('<')[0]
            if 'download link' in d.lower():
                finalLink = re.compile('="(.+?)"').findall(d)[0]

                if finalLink:
                    return finalLink
Esempio n. 9
0
def resetpass():
    loginurl = 'http://streamtvbox.com/payments/sendpass'
    headers = {
        'Host': 'streamtvbox.com',
        'Origin': 'http://streamtvbox.com',
        'Referer': 'http://streamtvbox.com/payments/login',
        'X-Requested-With': 'XMLHttpRequest'
    }

    get = net.http_POST(loginurl, {
        'login': ADDON.getSetting('user')
    }, headers).content

    message = re.compile('"error":\["(.+?)"\]').findall(get)[0]
    try:
        line1 = message.split('.')[0]
        line2 = message.split('.')[1]
        line3 = ''
        dialog = xbmcgui.Dialog()
        dialog.ok(THESITE.upper(), line1, line2, line3)
        dialog.ok(THESITE.upper(), '', 'Please Check Your Junk Folder', '')
        ADDON.setSetting('resetpass', 'false')
    except:
        line1 = message.split('[')[0]
        line2 = message.split('[')[1]
        line2 = '[COLOR red]' + line2.split(']')[0] + '[/COLOR]'
        line3 = message.split(']')[1]
        dialog = xbmcgui.Dialog()
        dialog.ok(THESITE.upper(), line1, line2, line3)
        EXIT()
        import update
        update.reset()
Esempio n. 10
0
def NEXTPAGE(SPLITME):

    SPLITME = SPLITME.split('#')    

    pagenum = int(SPLITME[2])+1
    currentday = SPLITME[1]
    cat = SPLITME[0]
    
    data ={'action':'infinite_scroll',
        'page':'%s' % str(pagenum),
        'currentday':currentday,
        'order':'DESC'}

    if cat.replace('-','').replace(',','').replace(' ','').isdigit():
            data['query_args[cat]']=cat
    else:
            data['query_args[s]']=cat
            
    link=net.http_POST('http://footballfullmatch.com/?infinity=scrolling',data, headers={'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'}).content.replace('\\','')

    if link != False:

        r= '<div class="post-thumb"><a href="(.+?)" title="(.+?) vs (.+?)">.+?src="(.+?)"' 
        #r='<div class="cover"><a href="(.+?)" rel="bookmark" title="(.+?) vs (.+?)".+?<img src="(.+?)".+? longdate" rel=".+?">(.+?)/(.+?)/(.+?)</p>'
        match=re.compile(r,re.DOTALL).findall(link)

        for url,team_a,team_b,iconimage in match:
            #_date='%s-%s-%s'%(month,day,year)
            _name = '[COLOR ghostwhite]'+team_a+'[/COLOR]  [COLOR deepskyblue]vs[/COLOR]  [COLOR ghostwhite]'+team_b+'[/COLOR]'
            addDir(_name,url,1,iconimage,'')
        addDir('[COLOR deepskyblue]Next Page[/COLOR] [COLOR ghostwhite]>>[/COLOR]','url',2,'',cat+'#'+currentday+'#%s' % str(pagenum))
        setView('movies', 'movie-view')

    else:
        Show_Red_Flag()
Esempio n. 11
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
Esempio 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
Esempio n. 13
0
def resolve(url):
        import net
        net = net.Net()
        web_url = url
        html = net.http_GET(web_url).content
        data = {}
        r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html)
        if r:
            for name, value in r:
                data[name] = value
        import captcha_lib
        data['method_free'] = 'Free Download'
        data.update(captcha_lib.do_captcha(html))
        html = net.http_POST(web_url, data).content
        data = {}
        r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html)
        if r:
            for name, value in r:
                data[name] = value
        data['referer'] = web_url
        headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36' }
        request = urllib2.Request(web_url, data=urllib.urlencode(data), headers=headers)
        try: stream_url = urllib2.urlopen(request).geturl()
        except: return
        return stream_url
Esempio n. 14
0
def resolve(url):
    import net
    net = net.Net()
    web_url = url
    html = net.http_GET(web_url).content
    data = {}
    r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html)
    if r:
        for name, value in r:
            data[name] = value
    import captcha_lib
    data['method_free'] = 'Free Download'
    data.update(captcha_lib.do_captcha(html))
    html = net.http_POST(web_url, data).content
    data = {}
    r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html)
    if r:
        for name, value in r:
            data[name] = value
    data['referer'] = web_url
    headers = {
        'User-Agent':
        'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36'
    }
    request = urllib2.Request(web_url,
                              data=urllib.urlencode(data),
                              headers=headers)
    try:
        stream_url = urllib2.urlopen(request).geturl()
    except:
        return
    return stream_url
Esempio n. 15
0
def resetpass():
    loginurl = 'http://streamtvbox.com/payments/sendpass'
    headers  = {'Host':'streamtvbox.com',
                                            'Origin':'http://streamtvbox.com',
                                            'Referer':'http://streamtvbox.com/payments/login',
                                                    'X-Requested-With':'XMLHttpRequest'}
    
    get = net.http_POST(loginurl, {'login':ADDON.getSetting('user')}, headers).content

    message=re.compile('"error":\["(.+?)"\]').findall(get)[0]
    try:
        line1 = message.split('.')[0]
        line2 = message.split('.')[1]
        line3 = ''
        dialog = xbmcgui.Dialog()
        dialog.ok(THESITE.upper(), line1,line2, line3)
        dialog.ok(THESITE.upper(), '','Please Check Your Junk Folder', '')
        ADDON.setSetting('resetpass','false')
    except:
        line1 = message.split('[')[0]
        line2 = message.split('[')[1]
        line2 = '[COLOR red]'+line2.split(']')[0]+'[/COLOR]'
        line3 = message.split(']')[1]      
        dialog = xbmcgui.Dialog()
        dialog.ok(THESITE.upper(), line1,line2, line3)
        EXIT()
        import update
        update.reset()
Esempio n. 16
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()
Esempio n. 17
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()
Esempio n. 18
0
def GetContent():
	token=GetToken('http://uktvnow.net/app2/v3/get_all_channels',Username)
	headers={'User-Agent':'USER-AGENT-UKTVNOW-APP-V2','app-token':token}
	postdata={'username':Username}
	channels = net.http_POST('http://uktvnow.net/app2/v3/get_all_channels',postdata, headers).content
	channels = channels.replace('\/','/')
        match=re.compile('"pk_id":"(.+?)","channel_name":"(.+?)","img":"(.+?)","http_stream":"(.+?)","rtmp_stream":"(.+?)","cat_id":"(.+?)"').findall(channels)
	return match
Esempio n. 19
0
def GetContent():
	
	headers={'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
			 'Accept-Encoding' : 'gzip',
			 'Connection':'Keep-Alive',}
	channels = net.http_POST('aHR0cDovL2Nsb3VkLjYxMzkyNTMtMC5hbG9qYW1pZW50by13ZWIuZXMvZG93bmxvYWQvZnJlZXRvdGFsL2xpc3RhMS8xMDUueG1sP3Jhdz10cnVl'.decode('base64'),headers).content
	channels = channels.replace('aXBob25lcw=='.decode('base64'),'YWxwaGFjcw=='.decode('base64')).replace('YWxmYQ=='.decode('base64'),'dXNlcg=='.decode('base64'))
	channellist=re.compile('"channel_name":"(.+?)","img":"(.+?)","http_stream":"(.+?)","rtmp_stream":"(.+?)","cat_id":"(.+?)"').findall(channels)
	return channellist
Esempio n. 20
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
Esempio n. 21
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
Esempio n. 22
0
def PLAY_STREAM():
    UAToken = GetToken('http://uktvnow.net/app2/v3/get_user_agent', Username)
    headers = {'User-Agent': 'USER-AGENT-UKTVNOW-APP-V2', 'app-token': UAToken}
    postdata = {
        'User-Agent': 'USER-AGENT-UKTVNOW-APP-V2',
        'app-token': UAToken,
        'version': '5.7'
    }
    UAPage = net.http_POST('http://uktvnow.net/app2/v3/get_user_agent',
                           postdata, headers).content
    UAString = re.compile('"msg":{".+?":"(.+?)"}}').findall(UAPage)[0]
    #UA=magicness(UAString)
    UA = UAString
    playlist_token = GetToken('http://uktvnow.net/app2/v3/get_valid_link',
                              Username + channelid)
    postdata = {
        'useragent': UA,
        'username': Username,
        'channel_id': channelid,
        'version': '5.7'
    }
    headers = {
        'User-Agent': 'USER-AGENT-UKTVNOW-APP-V2',
        'app-token': playlist_token
    }
    channels = net.http_POST('http://uktvnow.net/app2/v3/get_valid_link',
                             postdata, headers).content
    match = re.compile(
        '"channel_name":"(.+?)","img":".+?","http_stream":"(.+?)","rtmp_stream":"(.+?)"'
    ).findall(channels)
    for name, stream1, stream2 in match:
        stream1 = magicness(
            stream1
        ) + "|User-Agent=EMVideoView 2.5.6 (25600) / Android 6.0.1 / SM-G935F"
        stream2 = magicness(stream2) + ' timeout=10'
        liz = xbmcgui.ListItem(name,
                               iconImage=iconimage,
                               thumbnailImage=iconimage)
        window.close()
        xbmc.Player().play(stream1, liz, False)
Esempio n. 23
0
def GetContent():
	token=getAPIToken('https://app.uktvnow.net/v1/get_all_channels','goat')
	headers={'User-Agent':'USER-AGENT-UKTVNOW-APP-V1',
			 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
			 'Accept-Encoding' : 'gzip',
			 'app-token':token,
			 'Connection':'Keep-Alive',
			 'Host':'app.uktvnow.net'}
	postdata={'username':'******'}
	channels = net.http_POST('https://app.uktvnow.net/v1/get_all_channels',postdata, headers).content
	channels = channels.replace('\/','/')
	channellist=re.compile('"channel_name":"(.+?)","img":"(.+?)","http_stream":"(.+?)","rtmp_stream":"(.+?)","cat_id":"(.+?)"').findall(channels)
	return channellist
Esempio n. 24
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()
Esempio n. 25
0
    def get_license(self, mpd_url, wv_challenge, token, AWSELB):
        """Acquire the Widevine license from the license server and return it."""
        post_data = {
            'drm_info': [x for x in bytearray(wv_challenge)],  # convert challenge to a list of bytes
            'kid': self.get_kid(mpd_url, AWSELB),
            'token': token
        }

        # log("-GET LICENSE POST DATA: %s" % post_data)

        # wv_license = helper.c.make_request(self.license_url, 'post', payload=json.dumps(post_data))
        wv_license = net.http_POST(self.license_url, json.dumps(post_data), {'Content-Type': 'application/json'}).content

        return wv_license
Esempio n. 26
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
Esempio n. 27
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
Esempio n. 28
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()
Esempio n. 29
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')
Esempio n. 30
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')
Esempio n. 31
0
def GetContent():
	user = selfAddon.getSetting('username')
	passw = selfAddon.getSetting('password')

	if user == '' or passw == '':
		dialog.ok(addon_id, 'Please be aware that you will get authorization errors if you do remember to open context/settings menu on live i4atv and clear cache then reload if it dont work repeat the process. Please consider making donations to keep this addon alive and you can find the donation link in the settings of this addon. Thank You.')
		dialog.ok(addon_id, 'For the i4atv extra part of the i4atv addon credit should be given to mettlekettle for the code. Thank You!')
		ret = dialog.yesno('I4ATV EXTRA', 'Please enter inside4ndroid for both','','','Cancel','Login')
		if ret == 1:
			keyb = xbmc.Keyboard('', 'Enter Username')
			keyb.doModal()
			if (keyb.isConfirmed()):
				search = keyb.getText()
				username=search
				keyb = xbmc.Keyboard('', 'Enter Password:'******'username',username)
					selfAddon.setSetting('password',password)
		else:quit()
	
	user = selfAddon.getSetting('username')
	passw = selfAddon.getSetting('password')
	headers={'VXNlci1BZ2VudA=='.decode('base64'):'QXBhY2hlLUh0dHBDbGllbnQvVU5BVkFJTEFCTEUgKGphdmEgMS40KQ=='.decode('base64'),
			 'Q29udGVudC1UeXBl'.decode('base64'):'YXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVk'.decode('base64'),
			 'YXBwLXNlc3Npb24='.decode('base64'):'Mjc1ZjI2ZTMyMTcyNmI5YTk5ZThkOTVjM2VmZTg4YWI='.decode('base64'),
			 'Q29ubmVjdGlvbg=='.decode('base64'):'S2VlcC1BbGl2ZQ=='.decode('base64'),
			 'SG9zdA=='.decode('base64'):'dWt0dm5vdy5kZXNpc3RyZWFtcy50dg=='.decode('base64')}
	net.http_POST('aHR0cDovL3VrdHZub3cuZGVzaXN0cmVhbXMudHYvRGVzaVN0cmVhbXMvaW5kZXgyMDIucGhwP3RhZz1sb2dpbiZ1c2VybmFtZT0='.decode('base64')+user+'&password='******'',headers=headers)
	net.http_POST('aHR0cDovL3VrdHZub3cuZGVzaXN0cmVhbXMudHYvRGVzaVN0cmVhbXMvaW5kZXgyMDIucGhwP3RhZz1nZXRfcGFja2FnZV9uYW1l'.decode('base64'),'',headers=headers)
	net.http_POST('aHR0cDovL3VrdHZub3cuZGVzaXN0cmVhbXMudHYvRGVzaVN0cmVhbXMvaW5kZXgyMDIucGhwP3RhZz1nZXRfYW5ub3Vj'.decode('base64'),'',headers=headers)
	net.http_POST('aHR0cDovL3VrdHZub3cuZGVzaXN0cmVhbXMudHYvRGVzaVN0cmVhbXMvaW5kZXgyMDIucGhwP3RhZz1nZXRfcGFja2FnZV9uYW1l'.decode('base64'),'',headers=headers)
	response=net.http_POST('aHR0cDovL3VrdHZub3cuZGVzaXN0cmVhbXMudHYvRGVzaVN0cmVhbXMvaW5kZXgyMDIucGhwP3RhZz1nZXRfYWxsX2NoYW5uZWwmdXNlcm5hbWU9'.decode('base64')+user,'',headers=headers)
	response=response.content.replace('none','Ch')
	channels=json.loads(response)
	return channels
Esempio n. 32
0
def SportsOnDemand(url):

       ADDME=[]
       data ={'sportsmania':'1'}
       a=net.http_POST(url,data,headers={'User-Agent':'XBMC'}).content
       import json
       link=json.loads(a)
       data=link['vod_channels']
       for field in data:
           id= str(field['channel_url'])
           name= field['channel_title'].encode("utf-8")
           if '(' in name:
              date='('+name.split('(')[1]
              name=name.split('(')[0]
              NAME='[COLOR white]%s[/COLOR] - [COLOR yellow]%s[/COLOR]' % (name,date)
           else:
              NAME='[COLOR white]%s[/COLOR]' % (name)
           addDir(NAME,id,2004,'','','','')   
Esempio n. 33
0
def GetContent():
    token = getAPIToken('https://app.uktvnow.net/v1/get_all_channels', 'goat')
    headers = {
        'User-Agent': 'USER-AGENT-UKTVNOW-APP-V1',
        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
        'Accept-Encoding': 'gzip',
        'app-token': token,
        'Connection': 'Keep-Alive',
        'Host': 'app.uktvnow.net'
    }
    postdata = {'username': '******'}
    channels = net.http_POST('https://app.uktvnow.net/v1/get_all_channels',
                             postdata, headers).content
    channels = channels.replace('\/', '/')
    channellist = re.compile(
        '"channel_name":"(.+?)","img":"(.+?)","http_stream":"(.+?)","rtmp_stream":"(.+?)","cat_id":"(.+?)"'
    ).findall(channels)
    return channellist
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)
Esempio n. 35
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()
Esempio n. 36
0
def tvplayer(url):
	if plugin.getSetting('premium')== 'true':
		login()
		net.setCookies(cookieJar)
	headers   = {'Host': 'tvplayer.com','Connection': 'keep-alive','Origin': 'http://tvplayer.com','User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 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
	dataToken = re.compile('data-token="(.+?)"').findall(html)[0]
	getURL    = 'http://tvplayer.com/watch/context?resource=%s&gen=%s' % (url,dataToken)
	html      = net.http_GET(getURL, headers).content
	validate  = re.compile('"validate":"(.+?)"').findall(html)[0]
	if plugin.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; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 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'}
	LINK      = net.http_POST(postURL, data,headers=headers).content
	net.saveCookies(cookieJar)
	return re.compile('stream":"(.+?)"').findall(LINK)[0]
Esempio n. 37
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()
Esempio n. 38
0
def CreateUser():
	import random
	import string
       	token=getAPIToken('http://app.uktvnow.net/v1/signup','')
       	d_id = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(16)])
       	username = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
       	email = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
     	email2 = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(4)])
       	email=email+'@'+email2+'.com'
       	password=''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(9)])
       	headers={'User-Agent':'USER-AGENT-UKTVNOW-APP-V1',
			 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
			 'Accept-Encoding' : 'gzip',
			 'app-token':token,
			 'Connection':'Keep-Alive',
			 'Host':'app.uktvnow.net'}
       	postdata={'email': email,
		  'username' : username,
		  'password' : password,
		  'device_id' : d_id}
       	channels = net.http_POST('http://app.uktvnow.net/v1/signup',postdata, headers).content
	return username
Esempio n. 39
0
def CreateUser():
    import random
    import string
    token = getAPIToken('http://app.uktvnow.net/v1/signup', '')
    d_id = ''.join([
        random.choice(string.ascii_letters + string.digits) for n in xrange(16)
    ])
    username = ''.join([
        random.choice(string.ascii_letters + string.digits) for n in xrange(10)
    ])
    email = ''.join([
        random.choice(string.ascii_letters + string.digits) for n in xrange(10)
    ])
    email2 = ''.join([
        random.choice(string.ascii_letters + string.digits) for n in xrange(4)
    ])
    email = email + '@' + email2 + '.com'
    password = ''.join([
        random.choice(string.ascii_letters + string.digits) for n in xrange(9)
    ])
    headers = {
        'User-Agent': 'USER-AGENT-UKTVNOW-APP-V1',
        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
        'Accept-Encoding': 'gzip',
        'app-token': token,
        'Connection': 'Keep-Alive',
        'Host': 'app.uktvnow.net'
    }
    postdata = {
        'email': email,
        'username': username,
        'password': password,
        'device_id': d_id
    }
    channels = net.http_POST('http://app.uktvnow.net/v1/signup', postdata,
                             headers).content
    return username
Esempio n. 40
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
Esempio n. 41
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()
Esempio n. 42
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()
Esempio n. 43
0
def solve(url):
    html = net.http_GET(url)
    import time
    time.sleep(2)
    html=html.content
    postData = {}
    for item in re.finditer(r'\"\sname\=\"(.*?)\"\svalue=\"?(.*?)\"',html,re.I):
        postData.update({str(item.group(1)):str(item.group(2))})

    if postData:
        URL=net.http_POST(url,postData,headers={'Content-Type':'application/x-www-form-urlencoded',
                                                   'Referer':str(url),'Origin':'http://movreel.com',
                                                   'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'}).content
       
        LINK=URL.split('<a href')
        for p in LINK:
            d =p.split('<')[0]
            if 'download link' in d.lower():
                finalLink=re.compile('="(.+?)"').findall(d)[0]
               

                
                if finalLink:
                    return finalLink
Esempio n. 44
0
	net=net.Net()
	datapath = xbmc.translatePath(ADDON.getAddonInfo('profile'))
	cookie_path = os.path.join(datapath, 'cookies')
	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")
Esempio n. 45
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,'','','','')
Esempio n. 46
0
def getURLNoCache(url, data, headers, agent=None, tidy=True):
    import net
    net = net.Net()
    link = net.http_POST(url, data, headers=headers).content

    return link
Esempio n. 47
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, '', '', '', '')
Esempio n. 48
0
def getURLNoCache(url,data,headers, agent=None, tidy=True):
    import net
    net=net.Net()
    link = net.http_POST(url,data,headers=headers).content
    
    return link
Esempio n. 49
0
datapath = xbmc.translatePath(ADDON.getAddonInfo('profile'))
cookie_path = os.path.join(datapath, 'cookies')

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'
}

#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)

duration = sys.argv[4]
cat = sys.argv[1]
title = sys.argv[5]


def Numeric():
    dialog = xbmcgui.Dialog()