def getChannelVideo(item): host = item.get('title') url = item.get('url') video = '' if 'static.u-pro.fr' in host: data = 'src="%s"' % url video = mydecode.decode(url, data) elif 'iklub.net' in host: from iklub import _getUrl video = _getUrl(url) elif 'looknij.in' in host: from looknijin import getChannelVideo video = getChannelVideo(url) video = video[0].get('url', '') elif 'wizja.tv' in host: from wizjatv import getChannelVideo video = getChannelVideo(url) video = video[0].get('url', '') elif 'tele-wizja' in host: data = getUrl(url) video = mydecode.decode(url, data) elif 'www.tvp.pl' in host: from tvpstream import _getUrl video = _getUrl(url) video = video[0].get('url', '') return video
def getChannelVideo(item): host = item.get('title') url = item.get('url') video='' if 'static.u-pro.fr' in host: data='src="%s"'%url video = mydecode.decode(url,data) elif 'iklub.net' in host: from iklub import _getUrl video = _getUrl(url) elif 'looknij.in' in host: from looknijin import getChannelVideo video = getChannelVideo(url) video = video[0].get('url','') elif 'wizja.tv' in host: from wizjatv import getChannelVideo video = getChannelVideo(url) video = video[0].get('url','') elif 'tele-wizja' in host: data = getUrl(url) video = mydecode.decode(url,data) elif 'www.tvp.pl' in host: from tvpstream import _getUrl video = _getUrl(url) video = video[0].get('url','') return video
def getChannelVideo(url='http://polon-tv.blogspot.com/p/tvn.html'): #rtmp://50.7.115.2/stream/<playpath>2111L <swfUrl>http://p.jwpcdn.com/6/12/jwplayer.flash.swf <pageUrl>http://filterup.blogspot.com/p/tp2.html video=[] if 'blogspot' in url: content = getUrl(url) s_hex = re.compile('document.write\(unescape\(\'(.*?)\'\)').findall(content) s_hex = urllib.unquote(s_hex[0]) if s_hex else '' src = re.compile('src="(.*?)"',re.IGNORECASE).findall(s_hex) if src: data = getUrl(src[0]) rtmp = re.compile('{"file":"(.*?)"').findall(data) swfUrl='http://p.jwpcdn.com/6/12/jwplayer.flash.swf' pageUrl = re.compile('<meta content=["\'](.*?)["\'] property=["\']og:url["\']/>').findall(data) if rtmp and pageUrl: href = rtmp[0]+ ' swfUrl=%s pageUrl=%s live=1 timeout=10'%(swfUrl,pageUrl[0]) video=[{'url':href}] else: iframe = re.compile('<iframe(.*?)</iframe>',re.DOTALL|re.IGNORECASE).findall(data) if iframe: connection = re.compile('netConnection=(rtmp.*?)"').findall(iframe[0]) if connection: source = re.compile('source=([^&]+)').findall(connection[0]) if source: href = source[0] + ' swfUrl=%s pageUrl=%s live=1 timeout=10'%(swfUrl,pageUrl[0]) video=[{'url':href}] else: href = mydecode.decode(pageUrl[0],iframe[0]) if href : video=[{'url':href}] return video
def getSElink(url): out = [] url2 = url.split('|')[0] query = urlparse.urlparse(url2).query co = 1 if 'sch' in url.split('|')[1]: url3 = '%s/streams/ss/ss%s.html' % (BASEURL, query) html = getUrl(url3, BASEURL) xbmc.sleep(2000) stream = mydecode.decode(url3, html) if stream: out.append({'href': stream, 'title': 'Link %d' % co}) return out else: url = '%s/streams/misc/%s.html' % (BASEURL, query) html = getUrl(url, BASEURL) links = re.findall('id="link\d+" class="class_.+?" href="(.+?)"', html, re.DOTALL) for link in links: link = BASEURL + link if link.startswith('/') else link query = urlparse.urlparse(link).query if not query: query = link #if not query out.append({'href': query, 'title': 'Link %d' % co}) co += 1 return out
def decode_url(url='http://telewizja-live.com/canalsport.html'): vido_url = '' content = getUrl(url) iframe = re.compile('<iframe(.*?)</iframe>', re.DOTALL).findall(content) if iframe: pageUrl = re.compile('src="(http.*?)"').findall(iframe[0]) if pageUrl: data = getUrl(pageUrl[0]) vido_url = mydecode.decode(pageUrl[0], data) return vido_url
def getStreamLiveSport(url): headers = { 'Host': 'stream.livesport.ws', 'User-Agent': UA, 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'pl,en-US;q=0.7,en;q=0.3', 'DNT': '1', 'Upgrade-Insecure-Requests': '1', } html = sess.get(url, headers=headers, verify=False, timeout=30).text iframe = parseDOM(html, 'iframe', ret='src')[0] if 'vamosplay' in iframe: headers = { 'User-Agent': UA, 'Accept': '*/*', 'Accept-Language': 'pl,en-US;q=0.7,en;q=0.3', 'Connection': 'keep-alive', 'Referer': iframe, } html = sess.get('http://vamosplay.tech/js/config-stream.js', headers=headers, verify=False, timeout=30).text html = html.replace("\'", '"') servers = re.findall('var servers\s*=\s*"([^"]+)"', html) headers = { 'User-Agent': UA, 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Accept-Language': 'pl,en-US;q=0.7,en;q=0.3', 'Origin': 'http://vamosplay.tech', 'Connection': 'keep-alive', 'Referer': iframe, } response = sess.get(servers[0], headers=headers, verify=False, timeout=30).json() stream_adr = response['data']['url'] rodzaj = re.findall('(\/\w+)', iframe)[-1] source = 'http://' + stream_adr + '/channels' + rodzaj + '/stream.m3u8' else: source = mydecode.decode(url, html) return source
def decode_url(url='http://i-htv.net/tvp1.html'): vido_url='' if 'i-htv.net' in url: content = getUrl(url) iframes = re.compile('<iframe(.*?)</iframe>').findall(content) if iframes: pageUrl = re.compile('src="(.*?)"').findall(iframes[0]) if pageUrl: data=getUrl(pageUrl[0]) vido_url = mydecode.decode(pageUrl[0],data) print '@@@@@',vido_url return vido_url
def getChannelVideo(url='http://tele-wizja.com/tvn.html'): video=[] content = getUrl(url) iframes = re.compile('<iframe(.*?)</iframe>',re.DOTALL).findall(content) for iframe in iframes: pageUrl = re.compile('src="(.*?)"').findall(iframe) if pageUrl: data = getUrl(pageUrl[0]) vido_url = mydecode.decode(url,data) print '$$$$$$$$$$$$$$$$$$$$$$$',vido_url if vido_url: video.append({'url':vido_url,'titile':'Live','resolved':1}) return video
def decode_url(url='http://cinema-tv.xyz/muzyczne/polotv/'): vido_url='' if 'cinema-tv' in url: content = getUrl(url) idx1=content.find('<div class="entry-content clearfix">') idx2=content.find('<div class="NavHead">') if idx1>-1: data=content[idx1:idx2] else: data=content iframes = re.compile('<iframe(.*?)</iframe>').findall(data) if iframes: pageUrl = re.compile('src="(.*?)"').findall(iframes[0]) if pageUrl: pageUrl=pageUrl[0].replace(' ','%20') data=getUrl(pageUrl) vido_url = new_decode(pageUrl,data) if vido_url=='': vido_url = mydecode.decode(pageUrl,data) elif 'src' in content: vido_url = mydecode.decode(url,data) return vido_url
def getChannelVideo(url='http://www.typertv.com.pl/tvn'): video=[] if 'typertv' in url: content = getUrl(url) iframe = re.compile('<iframe(.*?)</iframe>').findall(content) if iframe: src = re.compile('src="(.*?)"',re.IGNORECASE).findall(iframe[0]) if src: data = getUrl(src[0]) if file : rtmp = file[0].split('&')[0] href = rtmp + ' swfUrl=%s live=1 timeout=10 pageUrl=%s'%(src[0],url) video=[{'url':href}] else: vido_url = mydecode.decode(url,s_hex) if vido_url: video=[{'url':vido_url}] return video
def decode_url(url='http://pol-xtv.blogspot.com/p/comedy-central.html'): vido_url='' content = getUrl(url) idx1 = content.find('<div id=\'summary') idx2 = content[idx1:].find('createSummaryAndThumb("summary') data=content[idx1:idx1+idx2] if data.find('document.write(unescape(')>-1: s_hex = re.compile('unescape\(\'(.*?)\'\)').findall(data) data = s_hex[0].replace('%','').decode('hex') vido_url = mydecode.decode(url,data) return vido_url ## # out=get_root() # for o in out: # print o['title'] # print decode_url( o['url']),'\n'
def getChannelVideo(url='http://tele-wizja.com/tvn.html'): video = [] content = getUrl(url) iframes = re.compile('<iframe(.*?)</iframe>', re.DOTALL).findall(content) for iframe in iframes: pageUrl = re.compile('src="(.*?)"').findall(iframe) if pageUrl: data = getUrl(pageUrl[0]) vido_url = mydecode.decode(url, data) print '$$$$$$$$$$$$$$$$$$$$$$$', vido_url if vido_url: video.append({ 'url': vido_url, 'titile': 'Live', 'resolved': 1 }) return video
def getChannelVideo(url='http://psa-tv.blogspot.be/p/tvp-1.html'): video=[] if 'psa-tv.blogspot' in url: content = getUrl(url) s_hex = re.compile('document.write\(unescape\(\'(.*?)\'\)').findall(content) s_hex = urllib.unquote(s_hex[0]) if s_hex else '' src = re.compile('src="(.*?)"',re.IGNORECASE).findall(s_hex) if src: file = re.compile('\?file=(.*?)$').findall(src[0]) if file : rtmp = file[0].split('&')[0] href = rtmp + ' swfUrl=%s live=1 timeout=10 pageUrl=%s'%(src[0],url) video=[{'url':href}] else: vido_url = mydecode.decode(url,s_hex) if vido_url: video=[{'url':vido_url}] return video
def getChannelVideo(url='http://psa-tv.blogspot.be/p/tvp-1.html'): video = [] if 'psa-tv.blogspot' in url: content = getUrl(url) s_hex = re.compile('document.write\(unescape\(\'(.*?)\'\)').findall( content) s_hex = urllib.unquote(s_hex[0]) if s_hex else '' src = re.compile('src="(.*?)"', re.IGNORECASE).findall(s_hex) if src: file = re.compile('\?file=(.*?)$').findall(src[0]) if file: rtmp = file[0].split('&')[0] href = rtmp + ' swfUrl=%s live=1 timeout=10 pageUrl=%s' % ( src[0], url) video = [{'url': href}] else: vido_url = mydecode.decode(url, s_hex) if vido_url: video = [{'url': vido_url}] return video
def decode_url(url='http://pol-xtv.blogspot.com/p/comedy-central.html'): vido_url = '' content = getUrl(url) idx1 = content.find('<div id=\'summary') idx2 = content[idx1:].find('createSummaryAndThumb("summary') data = content[idx1:idx1 + idx2] if data.find('document.write(unescape(') > -1: s_hex = re.compile('unescape\(\'(.*?)\'\)').findall(data) data = s_hex[0].replace('%', '').decode('hex') vido_url = mydecode.decode(url, data) return vido_url ## # out=get_root() # for o in out: # print o['title'] # print decode_url( o['url']),'\n'
def decode_url(url='http://delta-live.pro/28,pl,tvpsporthd.html'): vido_url='' if 'delta-live' in url: content = getUrl(url) iframes = re.compile('<iframe(.*?)</iframe>').findall(content) if iframes: pageUrl = re.compile('src="(.*?)"').findall(iframes[0]) if pageUrl: data=getUrl(pageUrl[0]) vido_url = mydecode.decode(pageUrl[0],data) if 'static.u-pro.fr' in data and not vido_url: source = re.compile('src=["\'](http.*?)["\']').findall(data) if source: source = re.compile('source=(rtmp.*?[^&]*)').findall(source[0]) if source: vido_url = source[0] print '@@@@@',vido_url return vido_url
def getChannelVideo(url='http://polon-tv.blogspot.com/p/tvn.html'): #rtmp://50.7.115.2/stream/<playpath>2111L <swfUrl>http://p.jwpcdn.com/6/12/jwplayer.flash.swf <pageUrl>http://filterup.blogspot.com/p/tp2.html video = [] if 'blogspot' in url: content = getUrl(url) s_hex = re.compile('document.write\(unescape\(\'(.*?)\'\)').findall( content) s_hex = urllib.unquote(s_hex[0]) if s_hex else '' src = re.compile('src="(.*?)"', re.IGNORECASE).findall(s_hex) if src: data = getUrl(src[0]) rtmp = re.compile('{"file":"(.*?)"').findall(data) swfUrl = 'http://p.jwpcdn.com/6/12/jwplayer.flash.swf' pageUrl = re.compile( '<meta content=["\'](.*?)["\'] property=["\']og:url["\']/>' ).findall(data) if rtmp and pageUrl: href = rtmp[0] + ' swfUrl=%s pageUrl=%s live=1 timeout=10' % ( swfUrl, pageUrl[0]) video = [{'url': href}] else: iframe = re.compile('<iframe(.*?)</iframe>', re.DOTALL | re.IGNORECASE).findall(data) if iframe: connection = re.compile( 'netConnection=(rtmp.*?)"').findall(iframe[0]) if connection: source = re.compile('source=([^&]+)').findall( connection[0]) if source: href = source[ 0] + ' swfUrl=%s pageUrl=%s live=1 timeout=10' % ( swfUrl, pageUrl[0]) video = [{'url': href}] else: href = mydecode.decode(pageUrl[0], iframe[0]) if href: video = [{'url': href}] return video
def resolvingCR(url, ref): html = getUrl(url, ref) iframes = parseDOM(html, 'iframe', ret='src') #[0] for iframe in iframes: if 'unblocked.is' in iframe: if 'nullrefer.com' in iframe or 'href.li/' in iframe: iframe = urlparse.urlparse(iframe).query html2 = getUrl(iframe, url) stream = getUnblocked(html2) return stream elif 'nullrefer.com' in iframe or 'href.li/' in iframe: iframe = urlparse.urlparse(iframe).query html = getUrl(iframe, url) url = iframe break if html.find("eval(unescape('") > 0: html = unescapeHtml(html) vido_url = re.findall("""['"](rtmp:.+?)['"]""", html, re.DOTALL) if vido_url: vido_url = vido_url[0] else: vido_url = re.findall("""source:\s*['"](.+?)['"]""", html, re.DOTALL) vido_url = vido_url[0] if vido_url else mydecode.decode(url, html) return vido_url
def _getUrl(url): video_url='' content=getUrl(url) fun_hex = re.compile('eval\(unescape\(\'(.*?)\'\)\);\n').findall(content) code = re.search('\+ \'(.*?)\' \+',content) code = urllib.unquote(code.group(1)) if code else '' decoded = '' if fun_hex and code: fun = urllib.unquote(fun_hex[0]) _split = re.compile('s\.split\(["\'](.*?)["\']').findall(fun)[0] _add1 = re.compile('unescape\(tmp\[1\] \+ ["\'](.*?)["\']\)').findall(fun)[0] _add2 = re.compile('charCodeAt\(i\)\)\+(.*?)\)\;').findall(fun)[0] tmp = code.split(str(_split)) tk = tmp[1] + str(_add1) table=[] for i in range(0, len(code)): a = ord(code[i]) b = int(tk[i % len(tk)]) table.append((b ^ a) + int(_add2)) decoded = ''.join(map(chr, table)) src = re.search('src="(.*?)"',decoded) if src: src=src.group(1) if src.startswith('//'): src='http:'+src else: src='' if decoded.find('var a =')>0: a=int(re.search('a = ([0-9]+)',decoded).group(1)) b=int(re.search('b = ([0-9]+)',decoded).group(1)) c=int(re.search('c = ([0-9]+)',decoded).group(1)) d=int(re.search('d = ([0-9]+)',decoded).group(1)) f=int(re.search('f = ([0-9]+)',decoded).group(1)) v_part = re.search('v_part = \'(.*?)\';',decoded).group(1) link = 'rtmp://%d.%d.%d.%d/'%(a/f,b/f,c/f,d/f) + v_part.split('/')[1]+'/'+' playpath='+v_part.split('/')[-1] swfUrl=re.compile('src="(.*?)"').findall(decoded)[-1] swfUrl=swfUrl.replace('.js','.flash.swf').replace('_remote','') video_url = link + ' swfUrl='+swfUrl + ' swfVfy=1 live=1 timeout=13 pageUrl='+url #rtmp://31.220.0.201/privatestream/<playpath>tvvvppspportch <swfUrl>http://privatestream.tv/js/jwplayer.flash.swf <pageUrl>http://iklub.net/tvpsportl.html elif 'static.u-pro.fr' in src: source = re.compile('source=(rtmp.*?[^&]*)').findall(src) if source: video_url=source[0] else: data = getUrl(src) vido_url = mydecode.decode(src,decoded.replace('\\','')) if vido_url: video_url=vido_url elif data: idx = data.find('Initialize player') if idx<0: src = re.search('src="(.*?)"',data) if src: src=src.group(1) if src.startswith('//'): src='http:'+src data = getUrl(src) idx = data.find('Initialize player') data = data[idx:] swfUrl = re.search('"flashplayer": "(.*?)"',data) if swfUrl: swfUrl=swfUrl.group(1) if swfUrl.startswith('//'): swfUrl='http:'+swfUrl file = re.search('"file": "(.*?)",[\n\t ]+"type"',data) if file: file=file.group(1) if file.endswith('m3u8'): video_url = file else: video_url = file + ' swfUrl='+swfUrl + ' swfVfy=1 live=1 timeout=13 pageUrl='+url return video_url
def resolvingCR(url, ref): html = getUrl(url, ref) iframes = parseDOM(html, 'iframe', ret='src') #[0] dal = '' for iframe in iframes: if 'unblocked.is' in iframe: if 'nullrefer.com' in iframe or 'href.li/' in iframe: iframe = urlparse.urlparse(iframe).query html2 = getUrl(iframe, url) stream = getUnblocked(html2) return stream #elif 'twitch.tv' in iframe: # return iframe elif 'nullrefer.com' in iframe or 'href.li/' in iframe: iframe = urlparse.urlparse(iframe).query html = getUrl(iframe, url) url = iframe break elif 'sportsbay.org' in iframe: if iframe.startswith('//'): iframe = 'https:' + iframe html = getUrl(iframe, url) url = iframe dal = iframe break elif 'daddylive.live' in iframe: if iframe.startswith('//'): iframe = 'https:' + iframe html = getUrl(iframe, url) url = iframe dal = iframe break elif 'strimstv.eu' in iframe: if iframe.startswith('//'): iframe = 'https:' + iframe html = getUrl(iframe, url) url = iframe dal = iframe break if html.find("eval(unescape('") > 0: try: html = unescapeHtml(html) except: pass vido_url = re.findall("""['"](rtmp:.+?)['"]""", html, re.DOTALL) if vido_url: vido_url = vido_url[0] else: vido_url = re.findall("""source:\s*['"](.+?)['"]""", html, re.DOTALL) vido_url = vido_url[ 0] + '|User-Agent=' + UA + '&Referer=' + dal if vido_url else mydecode.decode( url, html) if vido_url: if 'about:blank' in vido_url: vido_url = mydecode.decode(url, html) return vido_url
def decode_url(url='http://i-htv.net/tvp1.html'): vido_url = '' if 'i-htv.net' in url: content = getUrl(url) iframes = re.compile('<iframe(.*?)</iframe>').findall(content) if iframes: pageUrl = re.compile('src="(.*?)"').findall(iframes[0]) if pageUrl: data = getUrl(pageUrl[0]) vido_url = mydecode.decode(pageUrl[0], data) print '@@@@@', vido_url # header={'User-Agent':UA, # 'Host':'wizja.tv', # 'Referer':url, # 'Upgrade-Insecure-Requests':'1', # 'Cookie':'PHPSESSID=1'} return vido_url ## # reload(mydecode) ## # out=get_root() # # for o in out: # # print 'url="%s"'%o.get('url') # print '"%s"'%o.get('title') # # url=out[0].get('url') # # url="http://i-htv.net/tvp1.html" # url="http://i-htv.net/tvp2.html" # url="http://i-htv.net/tvphd.html" # url="http://i-htv.net/tvn.html" # url="http://i-htv.net/tvn7.html" # url="http://i-htv.net/tvpuls.html" # url="http://i-htv.net/tvn24.html" # url="http://i-htv.net/tvpinfo.html" # url="http://i-htv.net/tvrepublika.html" # url="http://i-htv.net/canal.html" # url="http://i-htv.net/canalfilm.html" # url="http://i-htv.net/canalfamily.html" # url="http://i-htv.net/axn.html" # url="http://i-htv.net/hbo.html" # url="http://i-htv.net/hbo2.html" # url="http://i-htv.net/hbo3.html" # url="http://i-htv.net/fox.html" # url="http://i-htv.net/kinopolska.html" # url="http://i-htv.net/canalsport.html" # url="http://i-htv.net/canalsport2.html" # url="http://i-htv.net/nsport.html" # url="http://i-htv.net/eurosport.html" # url="http://i-htv.net/eurosport2.html" # url="http://i-htv.net/tvpsport.html" # url="http://i-htv.net/eleven.html" # url="http://i-htv.net/elevensport.html" # url="http://i-htv.net/animalplanet.html" # url="http://i-htv.net/discovery.html" # url="http://i-htv.net/discoveryhistoria.html" # url="http://i-htv.net/history.html" # url="http://i-htv.net/h2.html" # url="http://i-htv.net/natgeo.html" # url="http://i-htv.net/natgeowild.html" # url="http://i-htv.net/tvnturbo.html" # url="http://i-htv.net/tvnstyle.html" # url="http://i-htv.net/tlc.html" # url="http://i-htv.net/eskatv.html" # url="http://i-htv.net/mtv.html" # link=decode_url(url) # print link
def decode_url(url='http://iklub.net/tvphd/'): vido_urls = [] if 'iklub.net' in url: urlpl = getUrl(url) iframes = re.compile('<iframe(.*?)</iframe>').findall(urlpl) zapas = re.compile( '<a href="(.*?)"><img src=".*?" alt="Zapasowy Player"').findall( urlpl) if zapas: urlpl2 = getUrl(zapas[0]) iframe2 = re.compile('<iframe(.*?)</iframe>').findall(urlpl2) if iframe2: iframes.extend(iframe2) #iframe= iframes[0] for iframe in iframes: pageUrl = re.compile('src="(.*?)"').findall(iframe) if pageUrl: content = getUrl(pageUrl[0]) fun_hex = re.compile( 'eval\(unescape\(\'(.*?)\'\)\);\n').findall(content) if fun_hex: fun = fun_hex[0].replace('%', '').decode('hex') fun_name = re.search('function (.*?)\(', fun) code = re.search('\+ \'(.*?)\' \+', content) if fun_name and code: fun_name = fun_name.group(1) code = code.group(1) try: ctx = execjs.compile(fun) decoded = ctx.call(fun_name, code) except: context = js2py.EvalJs() context.execute( 'pyimport urllib;' + fun.replace('\t', '').replace('\n', ''). replace('unescape(', 'urllib.unquote(')) decoded = getattr(context, fun_name)(code) else: decoded = fun else: fun_hex = re.compile('write\(\'(.*?)\'\);').findall( content) if fun_hex: decoded = fun_hex[0].decode('unicode-escape') else: decoded = '' src = re.search('src="(.*?)"', decoded) if src: src = src.group(1) if src.startswith('//'): src = 'http:' + src else: src = '' if decoded.find('var a =') > 0: a = int(re.search('a = ([0-9]+)', decoded).group(1)) b = int(re.search('b = ([0-9]+)', decoded).group(1)) c = int(re.search('c = ([0-9]+)', decoded).group(1)) d = int(re.search('d = ([0-9]+)', decoded).group(1)) f = int(re.search('f = ([0-9]+)', decoded).group(1)) v_part = re.search('v_part = \'(.*?)\';', decoded).group(1) link = 'rtmp://%d.%d.%d.%d/' % ( a / f, b / f, c / f, d / f) + v_part.split('/')[ 1] + '/' + ' playpath=' + v_part.split('/')[-1] swfUrl = re.compile('src="(.*?)"').findall(decoded)[-1] swfUrl = swfUrl.replace('.js', '.flash.swf').replace( '_remote', '') vido_url = link + ' swfUrl=' + swfUrl + ' swfVfy=1 live=1 timeout=13 pageUrl=' + pageUrl[ 0] vido_urls.append(vido_url) #rtmp://31.220.0.201/privatestream/<playpath>tvvvppspportch <swfUrl>http://privatestream.tv/js/jwplayer.flash.swf <pageUrl>http://iklub.net/tvpsportl.html elif 'static.u-pro.fr' in src: source = re.compile('source=(rtmp.*?[^&]*)').findall(src) if source: vido_urls.append(source[0]) else: data = getUrl(src) vido_url = mydecode.decode(url, decoded.replace('\\', '')) if vido_url: vido_urls.append(vido_url) elif data: idx = data.find('Initialize player') if idx < 0: src = re.search('src="(.*?)"', data) if src: src = src.group(1) if src.startswith('//'): src = 'http:' + src data = getUrl(src) idx = data.find('Initialize player') data = data[idx:] swfUrl = re.search('"flashplayer": "(.*?)"', data) if swfUrl: swfUrl = swfUrl.group(1) if swfUrl.startswith('//'): swfUrl = 'http:' + swfUrl file = re.search('"file": "(.*?)",[\n\t ]+"type"', data) if file: file = file.group(1) if file.endswith('m3u8'): vido_url = file else: #link = file.replace('live/','live/ playpath=') vido_url = file + ' swfUrl=' + swfUrl + ' swfVfy=1 live=1 timeout=13 pageUrl=' + pageUrl[ 0] vido_urls.append(vido_url) #rtmp://212.47.226.36/live/<playpath>1 swfUrl=http://ssl.p.jwpcdn.com/player/v/7.4.2/jwplayer.flash.swf pageUrl=http://iklub.net/tvp1i.html #rtmp://31.220.0.201/privatestream/<playpath>tvvppdwahd <swfUrl>http://privatestream.tv/js/jwplayer.flash.swf <pageUrl>http://iklub.net/tvp2l.html return vido_urls
def _getUrl(url): video_url = '' content = getUrl(url) fun_hex = re.compile('eval\(unescape\(\'(.*?)\'\)\);\n').findall(content) code = re.search('\+ \'(.*?)\' \+', content) code = urllib.unquote(code.group(1)) if code else '' decoded = '' if fun_hex and code: fun = urllib.unquote(fun_hex[0]) _split = re.compile('s\.split\(["\'](.*?)["\']').findall(fun)[0] _add1 = re.compile('unescape\(tmp\[1\] \+ ["\'](.*?)["\']\)').findall( fun)[0] _add2 = re.compile('charCodeAt\(i\)\)\+(.*?)\)\;').findall(fun)[0] tmp = code.split(str(_split)) tk = tmp[1] + str(_add1) table = [] for i in range(0, len(code)): a = ord(code[i]) b = int(tk[i % len(tk)]) table.append((b ^ a) + int(_add2)) decoded = ''.join(map(chr, table)) src = re.search('src="(.*?)"', decoded) if src: src = src.group(1) if src.startswith('//'): src = 'http:' + src else: src = '' if decoded.find('var a =') > 0: a = int(re.search('a = ([0-9]+)', decoded).group(1)) b = int(re.search('b = ([0-9]+)', decoded).group(1)) c = int(re.search('c = ([0-9]+)', decoded).group(1)) d = int(re.search('d = ([0-9]+)', decoded).group(1)) f = int(re.search('f = ([0-9]+)', decoded).group(1)) v_part = re.search('v_part = \'(.*?)\';', decoded).group(1) link = 'rtmp://%d.%d.%d.%d/' % ( a / f, b / f, c / f, d / f) + v_part.split( '/')[1] + '/' + ' playpath=' + v_part.split('/')[-1] swfUrl = re.compile('src="(.*?)"').findall(decoded)[-1] swfUrl = swfUrl.replace('.js', '.flash.swf').replace('_remote', '') video_url = link + ' swfUrl=' + swfUrl + ' swfVfy=1 live=1 timeout=13 pageUrl=' + url #rtmp://31.220.0.201/privatestream/<playpath>tvvvppspportch <swfUrl>http://privatestream.tv/js/jwplayer.flash.swf <pageUrl>http://iklub.net/tvpsportl.html elif 'static.u-pro.fr' in src: source = re.compile('source=(rtmp.*?[^&]*)').findall(src) if source: video_url = source[0] else: data = getUrl(src) vido_url = mydecode.decode(src, decoded.replace('\\', '')) if vido_url: video_url = vido_url elif data: idx = data.find('Initialize player') if idx < 0: src = re.search('src="(.*?)"', data) if src: src = src.group(1) if src.startswith('//'): src = 'http:' + src data = getUrl(src) idx = data.find('Initialize player') data = data[idx:] swfUrl = re.search('"flashplayer": "(.*?)"', data) if swfUrl: swfUrl = swfUrl.group(1) if swfUrl.startswith('//'): swfUrl = 'http:' + swfUrl file = re.search('"file": "(.*?)",[\n\t ]+"type"', data) if file: file = file.group(1) if file.endswith('m3u8'): video_url = file else: video_url = file + ' swfUrl=' + swfUrl + ' swfVfy=1 live=1 timeout=13 pageUrl=' + url return video_url
def decode_url(url='http://i-htv.net/tvp1.html'): vido_url='' if 'i-htv.net' in url: content = getUrl(url) iframes = re.compile('<iframe(.*?)</iframe>').findall(content) if iframes: pageUrl = re.compile('src="(.*?)"').findall(iframes[0]) if pageUrl: data=getUrl(pageUrl[0]) vido_url = mydecode.decode(pageUrl[0],data) print '@@@@@',vido_url # header={'User-Agent':UA, # 'Host':'wizja.tv', # 'Referer':url, # 'Upgrade-Insecure-Requests':'1', # 'Cookie':'PHPSESSID=1'} return vido_url ## # reload(mydecode) ## # out=get_root() # # for o in out: # # print 'url="%s"'%o.get('url') # print '"%s"'%o.get('title') # # url=out[0].get('url') # # url="http://i-htv.net/tvp1.html" # url="http://i-htv.net/tvp2.html" # url="http://i-htv.net/tvphd.html" # url="http://i-htv.net/tvn.html" # url="http://i-htv.net/tvn7.html" # url="http://i-htv.net/tvpuls.html" # url="http://i-htv.net/tvn24.html" # url="http://i-htv.net/tvpinfo.html" # url="http://i-htv.net/tvrepublika.html" # url="http://i-htv.net/canal.html" # url="http://i-htv.net/canalfilm.html" # url="http://i-htv.net/canalfamily.html" # url="http://i-htv.net/axn.html" # url="http://i-htv.net/hbo.html" # url="http://i-htv.net/hbo2.html" # url="http://i-htv.net/hbo3.html" # url="http://i-htv.net/fox.html" # url="http://i-htv.net/kinopolska.html" # url="http://i-htv.net/canalsport.html" # url="http://i-htv.net/canalsport2.html" # url="http://i-htv.net/nsport.html" # url="http://i-htv.net/eurosport.html" # url="http://i-htv.net/eurosport2.html" # url="http://i-htv.net/tvpsport.html" # url="http://i-htv.net/eleven.html" # url="http://i-htv.net/elevensport.html" # url="http://i-htv.net/animalplanet.html" # url="http://i-htv.net/discovery.html" # url="http://i-htv.net/discoveryhistoria.html" # url="http://i-htv.net/history.html" # url="http://i-htv.net/h2.html" # url="http://i-htv.net/natgeo.html" # url="http://i-htv.net/natgeowild.html" # url="http://i-htv.net/tvnturbo.html" # url="http://i-htv.net/tvnstyle.html" # url="http://i-htv.net/tlc.html" # url="http://i-htv.net/eskatv.html" # url="http://i-htv.net/mtv.html" # link=decode_url(url) # print link