def find_link(url, html=''): global limit limit+=1 log('Finding in : %s'%url) try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0] except: referer = 'http://' + urlparse.urlparse(url).netloc host = urlparse.urlparse(url).netloc headers = {'Referer':referer, 'Host':host, 'User-Agent' : client.agent(), 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language' : 'en-US,en;q=0.5'} if html=='': url = manual_url_fix(url) html = client.request(url, headers=headers) html = manual_html_fix(url,html,headers) ref=url fs=list(globals().copy()) for f in fs: if 'finder' in f: resolved = eval (f+"(html,ref)") if resolved: log('Resolved with %s: %s'%(f,resolved)) return resolved break return
def finder1(html,url): global limit ref=url try: urls = re.findall('<i?frame.+?src=(?:\'|\")(.+?)(?:\'|\")',html) try: urls.append(re.findall("playStream\('iframe', '(.+?)'\)",html)[0]) except: pass for url in urls: if 'c4.zedo' in url: continue if "micast" in url or 'turbocast' in url: return finder47(html,ref) rr = resolve_it(url) if rr: return rr uri = manual_fix(url,ref) if limit>=25: log("Exiting - iframe visit limit reached") return resolved = find_link(uri) if resolved: break headers = {'User-Agent': client.agent(), 'Referer': ref} if '.m3u8' in resolved and '|' not in resolved: headers.update({'X-Requested-With':'ShockwaveFlash/20.0.0.228', 'Host':urlparse.urlparse(resolved).netloc, 'Connection':'keep-alive'}) resolved += '|%s' % urllib.urlencode(headers) return resolved except: return
def find_link(url, html=''): log('Finding in : %s'%url) try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0] except: referer = 'http://' + urlparse.urlparse(url).netloc host = urlparse.urlparse(url).netloc headers = {'Referer':referer, 'Host':host, 'User-Agent' : client.agent(), 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language' : 'en-US,en;q=0.5'} if html=='' or html is None: url = manual_url_fix(url) html = client.request(url, headers=headers) if 'livetvcdn' in url or 'shadow' in url or 'blog' in url and 'goto/' not in url: import requests s = requests.Session() r = s.get(url,headers=headers) html = r.text ref=url fs=list(globals().copy()) for f in fs: if 'finder' in f: resolved = eval (f+"(html,ref)") if resolved: log('Resolved with %s: %s'%(f,resolved)) return resolved break return
def resolve_it(url, title='Video', icon='x'): if '.m3u8' in url or 'rtmp:' in url or '.flv' in url or '.mp4' in url or '.ts' in url or url.startswith( 'plugin://'): if '.m3u8' in url and '|' not in url: url += '|%s' % urllib.urlencode({'User-Agent': client.agent()}) if '.ts' in url: url = 'plugin://plugin.video.f4mTester/?name=%s&iconImage=%s&streamtype=TSDOWNLOADER&url=' % ( urllib.quote(title), urllib.quote(icon)) + urllib.quote(url) return url if '.f4m' in url: from resolvers import f4m resolved = f4m.resolve(url) return resolved if url.startswith('acestream://') or url.startswith( 'sop://') or '.acelive' in url: from resolvers import sop_ace resolved = sop_ace.resolve(url, title) return resolved netloc = prepare(urlparse.urlparse(url).netloc) if netloc in resolver_dict.keys(): resolver = resolver_dict[netloc] log("Calling resolver: " + resolver) exec "from resolvers import %s" % resolver resolved = eval(resolver + ".resolve(url)") return resolved else: return
def find_link(url, html=''): log('Finding in : %s' % url) try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0] except: referer = 'http://' + urlparse.urlparse(url).netloc host = urlparse.urlparse(url).netloc headers = { 'Referer': referer, 'Host': host, 'User-Agent': client.agent(), 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.5' } if html == '' or html is None: url = manual_url_fix(url) html = client.request(url, headers=headers) if 'livetvcdn' in url or 'shadow' in url or 'blog' in url and 'goto/' not in url: import requests s = requests.Session() r = s.get(url, headers=headers) html = r.text ref = url fs = list(globals().copy()) for f in fs: if 'finder' in f: resolved = eval(f + "(html,ref)") if resolved: log('Resolved with %s: %s' % (f, resolved)) return resolved break return
def resolve_it(url, title='Video'): if '.m3u8' in url or 'rtmp:' in url or '.flv' in url or '.mp4' in url or '.ts' in url or url.startswith('plugin://'): if '.m3u8' in url and '|' not in url: url += '|%s' % urllib.urlencode({'User-Agent': client.agent()}) return url if '.f4m' in url: from resolvers import f4m resolved = f4m.resolve(url) return resolved if url.startswith('acestream://') or url.startswith('sop://') or '.acelive' in url: from resolvers import sop_ace resolved = sop_ace.resolve(url, title) return resolved netloc = prepare(urlparse.urlparse(url).netloc) if netloc in resolver_dict.keys(): resolver = resolver_dict[netloc] log("Calling resolver: " + resolver) exec "from resolvers import %s"%resolver resolved = eval(resolver+".resolve(url)") return resolved else: return
def find_link(url, html=''): log('Finding in : %s' % url) try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0] except: referer = 'http://' + urlparse.urlparse(url).netloc host = urlparse.urlparse(url).netloc headers = { 'Referer': referer, 'Host': host, 'User-Agent': client.agent(), 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.5' } if html == '': url = manual_url_fix(url) html = client.request(url, headers=headers) html = manual_html_fix(url, html, headers) ref = url fs = list(globals().copy()) for f in fs: if 'finder' in f: resolved = eval(f + "(html,ref)") if resolved: log('Resolved with %s: %s' % (f, resolved)) return resolved break return
def resolve_it(url): if '.m3u8' in url or 'rtmp:' in url or '.flv' in url or '.mp4' in url or '.ts' in url or url.startswith( 'plugin://'): if '.m3u8' in url and '|' not in url: url += '|%s' % urllib.urlencode({'User-Agent': client.agent()}) return url if '.f4m' in url: from resolvers import f4m resolved = f4m.resolve(url) return resolved if url.startswith('acestream://') or url.startswith( 'sop://') or '.acelive' in url: from resolvers import sop_ace resolved = sop_ace.resolve(url, 'Video') return resolved netloc = prepare(urlparse.urlparse(url).netloc) if netloc in resolver_dict.keys(): resolver = resolver_dict[netloc] log("Calling resolver: " + resolver) exec "from resolvers import %s" % resolver resolved = eval(resolver + ".resolve(url)") return resolved else: return
def resolve_it(url, title='Video',icon='x'): if '.m3u8' in url or 'rtmp:' in url or '.flv' in url or '.mp4' in url or '.ts' in url or url.startswith('plugin://'): if '.m3u8' in url and '|' not in url: url += '|%s' % urllib.urlencode({'User-Agent': client.agent()}) if '.ts' in url: url = 'plugin://plugin.video.f4mTester/?name=%s&iconImage=%s&streamtype=TSDOWNLOADER&url='%(urllib.quote(title),urllib.quote(icon)) + urllib.quote(url) return url if '.f4m' in url: from resolvers import f4m resolved = f4m.resolve(url) return resolved if url.startswith('acestream://') or url.startswith('sop://') or '.acelive' in url: from resolvers import sop_ace resolved = sop_ace.resolve(url, title) return resolved netloc = prepare(urlparse.urlparse(url).netloc) if netloc in resolver_dict.keys(): resolver = resolver_dict[netloc] log("Calling resolver: " + resolver) exec "from resolvers import %s"%resolver resolved = eval(resolver+".resolve(url)") return resolved else: return
def finder1(html,url): html = html.replace('/adplus/adplus.html?id=','') try:html = urllib.unquote(html) except:pass global limit limit+=1 ref=url try: urls = re.findall('<i?frame\s*.+?src=(?:\'|\")(.+?)(?:\'|\")',html,flags=re.IGNORECASE) urly = client.parseDOM(html, "iframe", ret="src") urlc = re.findall('top.location.href\s*=\s*[\'\"](.+?axe-tv[^\'\"]+)[\'\"]',html) for url in urlc: if 'sky-sports-1' not in url and 'fox1ushd' not in url: urls.append(url) urls += urly try: urls.append(re.findall("playStream\('iframe', '(.+?)'\)",html)[0]) except: pass urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]',html) urls += re.findall('(http://www.hdmyt.info/(?:channel|player).php\?file=[^"\']+)["\']',html) from random import shuffle for url in urls: url = url.replace('https','http') if 'c4.zedo' in url or 'ProtectFile.File' in url or 'adServe' in url or 'facebook' in url or 'banner' in url: continue elif "micast" in url or 'turbocast' in url: return finder47(html,ref) elif 'lshstream' in url: return finder2(url,url) rr = resolve_it(url) if rr: return rr uri = manual_fix(url,ref) if limit>=25: log("Exiting - iframe visit limit reached") return resolved = find_link(uri) if resolved: break headers = {'User-Agent': client.agent(), 'Referer': ref} if '.m3u8' in resolved and '|' not in resolved: headers.update({'X-Requested-With':constants.get_shockwave(), 'Host':urlparse.urlparse(resolved).netloc, 'Connection':'keep-alive'}) resolved += '|%s' % urllib.urlencode(headers) return resolved except: return
def finder100(html, ref): #try: if 'Blowfish' not in html: return if 'wib' in ref: log('yes') key = re.findall('new Blowfish\([\"\'](.+?)[\"\']\)', html)[0] if len(key) > 56: key = key[:56] crypted = re.findall('.decrypt\([\"\'](.+?)[\"\']\)', html)[0] from modules import blowfish cipher = blowfish.Blowfish(key) decrypted = cipher.decrypt(crypted) log(decrypted) return find_link(ref, html=decrypted)
def finder100(html,ref): #try: if 'Blowfish' not in html: return if 'wib' in ref: log('yes') key = re.findall('new Blowfish\([\"\'](.+?)[\"\']\)',html)[0] if len(key)>56: key=key[:56] crypted = re.findall('.decrypt\([\"\'](.+?)[\"\']\)',html)[0] from modules import blowfish cipher = blowfish.Blowfish(key) decrypted = cipher.decrypt(crypted) log(decrypted) return find_link(ref,html=decrypted)
def resolve(url, cache_timeout=3, html=None, title='Video'): #try: log("Resolver called with url: " + url) resolved=None if html==None: resolved=resolve_it(url,title=title) if resolved==None: if html==None and cache_timeout!=0: #semi-cached resolving url=cache.get(find_link,cache_timeout,url) else: url = find_link(url,html=html) resolved=url url=resolve_it(url,title=title) if url!=None: resolved=url log("Resolved url: " + resolved) return resolved
def finder1(html, url): global limit limit += 1 ref = url try: urls = re.findall('<i?frame.+?src=(?:\'|\")(.+?)(?:\'|\")', html) try: urls.append(re.findall("playStream\('iframe', '(.+?)'\)", html)[0]) except: pass urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]', html) urls += re.findall( 'src=["\'](http://www.hdmyt.info/channel.php\?file=[^"\']+)["\']', html) from random import shuffle for url in urls: if 'c4.zedo' in url or 'ProtectFile.File' in url or 'adServe' in url or 'facebook' in url or 'banner' in url: continue if "micast" in url or 'turbocast' in url: return finder47(html, ref) rr = resolve_it(url) if rr: return rr uri = manual_fix(url, ref) if limit >= 25: log("Exiting - iframe visit limit reached") return resolved = find_link(uri) if resolved: break headers = {'User-Agent': client.agent(), 'Referer': ref} if '.m3u8' in resolved and '|' not in resolved: headers.update({ 'X-Requested-With': constants.get_shockwave(), 'Host': urlparse.urlparse(resolved).netloc, 'Connection': 'keep-alive' }) resolved += '|%s' % urllib.urlencode(headers) return resolved except: return
def finder1(html, url): global limit limit += 1 ref = url try: urls = re.findall('<i?frame.+?src=(?:\'|\")(.+?)(?:\'|\")', html) try: urls.append(re.findall("playStream\('iframe', '(.+?)'\)", html)[0]) except: pass urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]', html) from random import shuffle shuffle(urls) for url in urls: if 'c4.zedo' in url: continue if "micast" in url or 'turbocast' in url: return finder47(html, ref) rr = resolve_it(url) if rr: return rr uri = manual_fix(url, ref) if limit >= 25: log("Exiting - iframe visit limit reached") return resolved = find_link(uri) if resolved: break headers = {'User-Agent': client.agent(), 'Referer': ref} if '.m3u8' in resolved and '|' not in resolved: headers.update({ 'X-Requested-With': 'ShockwaveFlash/20.0.0.286', 'Host': urlparse.urlparse(resolved).netloc, 'Connection': 'keep-alive' }) resolved += '|%s' % urllib.urlencode(headers) return resolved except: return
def finder1(html,url): global limit limit+=1 ref=url try: urls = re.findall('<i?frame.+?src=(?:\'|\")(.+?)(?:\'|\")',html,flags=re.IGNORECASE) try: urls.append(re.findall("playStream\('iframe', '(.+?)'\)",html)[0]) except: pass urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]',html) urls += re.findall('(http://www.hdmyt.info/(?:channel|player).php\?file=[^"\']+)["\']',html) from random import shuffle for url in urls: if 'c4.zedo' in url or 'ProtectFile.File' in url or 'adServe' in url or 'facebook' in url or 'banner' in url: continue if "micast" in url or 'turbocast' in url: return finder47(html,ref) rr = resolve_it(url) if rr: return rr uri = manual_fix(url,ref) if limit>=25: log("Exiting - iframe visit limit reached") return resolved = find_link(uri) if resolved: break headers = {'User-Agent': client.agent(), 'Referer': ref} if '.m3u8' in resolved and '|' not in resolved: headers.update({'X-Requested-With':constants.get_shockwave(), 'Host':urlparse.urlparse(resolved).netloc, 'Connection':'keep-alive'}) resolved += '|%s' % urllib.urlencode(headers) return resolved except: return
def resolve(url): try: log("Resolver called with url: " + url) resolved=resolve_it(url) if resolved==None: #semi-cached resolving url=cache.get(find_link,3600*3,url) resolved=url url=resolve_it(url) if url!=None: resolved=url log("Resolved url: " + resolved) return resolved except: log("Failed to find link.") return url
def resolve(url, cache_timeout=3, html=None): try: log("Resolver called with url: " + url) resolved=None if html==None: resolved=resolve_it(url) if resolved==None: if html==None: #semi-cached resolving url=cache.get(find_link,cache_timeout,url) else: url = find_link(url,html=html) resolved=url url=resolve_it(url) if url!=None: resolved=url log("Resolved url: " + resolved) return resolved except: log("Failed to find link.") return url
def resolve(url, cache_timeout=3, html=None): try: log("Resolver called with url: " + url) resolved = None if html == None: resolved = resolve_it(url) if resolved == None: if html == None: #semi-cached resolving url = cache.get(find_link, cache_timeout, url) else: url = find_link(url, html=html) resolved = url url = resolve_it(url) if url != None: resolved = url log("Resolved url: " + resolved) return resolved except: log("Failed to find link.") return url
def resolve(url, cache_timeout=3, html=None, title='Video', icon='x'): try: log("Resolver called with url: " + url) resolved = None if html == None: resolved = resolve_it(url, title=title) if resolved == None: if html == None and cache_timeout != 0: #semi-cached resolving url = cache.get(find_link, cache_timeout, url) else: url = find_link(url, html=html) resolved = url url = resolve_it(url, title=title, icon=icon) if url != None: resolved = url log("Resolved url: " + resolved) return resolved except: log("Failed to find link.") return url
def finder1(html, url): html = html.replace('/adplus/adplus.html?id=', '') try: html = urllib.unquote(html) except: pass global limit limit += 1 ref = url try: urls = re.findall('<i?frame\s*.+?src=(?:\'|\")(.+?)(?:\'|\")', html, flags=re.IGNORECASE) urly = client.parseDOM(html, "iframe", ret="src") urlc = re.findall( 'top.location.href\s*=\s*[\'\"](.+?axe-tv[^\'\"]+)[\'\"]', html) for url in urlc: if 'sky-sports-1' not in url and 'fox1ushd' not in url: urls.append(url) urls += urly try: urls.append(re.findall("playStream\('iframe', '(.+?)'\)", html)[0]) except: pass urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]', html) urls += re.findall( '(http://www.hdmyt.info/(?:channel|player).php\?file=[^"\']+)["\']', html) from random import shuffle for url in urls: url = url.replace('https', 'http') if 'c4.zedo' in url or 'ProtectFile.File' in url or 'adServe' in url or 'facebook' in url or 'banner' in url: continue elif "micast" in url or 'turbocast' in url: return finder47(html, ref) elif 'lshstream' in url: return finder2(url, url) rr = resolve_it(url) if rr: return rr uri = manual_fix(url, ref) if limit >= 25: log("Exiting - iframe visit limit reached") return resolved = find_link(uri) if resolved: break headers = {'User-Agent': client.agent(), 'Referer': ref} if '.m3u8' in resolved and '|' not in resolved: headers.update({ 'X-Requested-With': constants.get_shockwave(), 'Host': urlparse.urlparse(resolved).netloc, 'Connection': 'keep-alive' }) resolved += '|%s' % urllib.urlencode(headers) return resolved except: return