def resolve_videto(url, referer): user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' from resources.libs import jsunpack from t0mm0.common.addon import Addon addon = Addon('plugin.video.movie25', sys.argv) try: from t0mm0.common.net import Net as net html = net(user_agent).http_GET(url).content addon.log_error('Mash Up: Resolve Vidto - Requesting GET URL: ' + url) r = re.findall(r'<font class="err">File was removed</font>', html, re.I) if r: addon.log_error('Mash Up: Resolve Vidto - File Was Removed') xbmc.executebuiltin("XBMC.Notification(File Not Found,Vidto,2000)") return False if not r: r = re.findall( r'(eval\(function\(p,a,c,k,e,d\)\{while.+?flvplayer.+?)</script>', html, re.M | re.DOTALL) if r: unpacked = jsunpack.unpack( r[0] ) #this is where it will error, not sure if resources,libs added to os path r = re.findall(r'label:"\d+p",file:"(.+?)"}', unpacked) if not r: r = re.findall('type="hidden" name="(.+?)" value="(.+?)">', html) post_data = {} for name, value in r: post_data[name] = value post_data['usr_login'] = '' post_data['referer'] = referer addon.show_countdown(7, 'Please Wait', 'Resolving') headers = {'Referer': referer} html = net(user_agent).http_POST(url, post_data, headers).content r = re.findall( r'(eval\(function\(p,a,c,k,e,d\)\{while.+?flvplayer.+?)</script>', html, re.M | re.DOTALL) if r: unpacked = jsunpack.unpack(r[0]) r = re.findall(r'label:"\d+p",file:"(.+?)"}', unpacked) if not r: r = re.findall(r"var file_link = '(.+?)';", html) return r[0] except Exception, e: print 'Mash Up: Resolve Vidto Error - ' + str(e) addon.show_small_popup( '[B][COLOR green]Mash Up: Vidto Resolver[/COLOR][/B]', 'Error, Check XBMC.log for Details', 5000, elogo)
def resolve_videto(url, referer): user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3" from resources.libs import jsunpack try: html = net(user_agent).http_GET(url).content addon.log_error("Mash Up: Resolve Vidto - Requesting GET URL: " + url) r = re.findall(r'<font class="err">File was removed</font>', html, re.I) if r: addon.log_error("Mash Up: Resolve Vidto - File Was Removed") xbmc.executebuiltin("XBMC.Notification(File Not Found,Vidto,2000)") return False if not r: r = re.findall(r"(eval\(function\(p,a,c,k,e,d\)\{while.+?flvplayer.+?)</script>", html, re.M | re.DOTALL) if r: unpacked = jsunpack.unpack( r[0] ) # this is where it will error, not sure if resources,libs added to os path r = re.findall(r'label:"\d+p",file:"(.+?)"}', unpacked) if not r: r = re.findall('type="hidden" name="(.+?)" value="(.+?)">', html) post_data = {} for name, value in r: post_data[name] = value post_data["usr_login"] = "" post_data["referer"] = referer addon.show_countdown(7, "Please Wait", "Resolving") headers = {"Referer": referer} html = net(user_agent).http_POST(url, post_data, headers).content r = re.findall( r"(eval\(function\(p,a,c,k,e,d\)\{while.+?flvplayer.+?)</script>", html, re.M | re.DOTALL ) if r: unpacked = jsunpack.unpack(r[0]) r = re.findall(r'label:"\d+p",file:"(.+?)"}', unpacked) if not r: r = re.findall(r"var file_link = '(.+?)';", html) return r[0] except Exception, e: print "Mash Up: Resolve Vidto Error - " + str(e) addon.show_small_popup( "[B][COLOR green]Mash Up: Vidto Resolver[/COLOR][/B]", "Error, Check XBMC.log for Details", 5000, elogo )
def resolve_videto(url,referer): user_agent='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' from resources.libs import jsunpack from t0mm0.common.addon import Addon addon = Addon('plugin.video.movie25', sys.argv) try: from t0mm0.common.net import Net as net html = net(user_agent).http_GET(url).content addon.log_error('Mash Up: Resolve Vidto - Requesting GET URL: '+url) r = re.findall(r'<font class="err">File was removed</font>',html,re.I) if r: addon.log_error('Mash Up: Resolve Vidto - File Was Removed') xbmc.executebuiltin("XBMC.Notification(File Not Found,Vidto,2000)") return False if not r: r = re.findall(r'(eval\(function\(p,a,c,k,e,d\)\{while.+?flvplayer.+?)</script>' ,html,re.M|re.DOTALL) if r: unpacked = jsunpack.unpack(r[0])#this is where it will error, not sure if resources,libs added to os path r = re.findall(r'label:"\d+p",file:"(.+?)"}',unpacked) if not r: r = re.findall('type="hidden" name="(.+?)" value="(.+?)">',html) post_data = {} for name, value in r: post_data[name] = value post_data['usr_login'] = '' post_data['referer'] = referer addon.show_countdown(7, 'Please Wait', 'Resolving') headers={'Referer':referer} html = net(user_agent).http_POST(url,post_data,headers).content r = re.findall(r'(eval\(function\(p,a,c,k,e,d\)\{while.+?flvplayer.+?)</script>' ,html,re.M|re.DOTALL) if r: unpacked = jsunpack.unpack(r[0]) r = re.findall(r'label:"\d+p",file:"(.+?)"}',unpacked) if not r: r = re.findall(r"var file_link = '(.+?)';",html) return r[0] except Exception, e: print 'Mash Up: Resolve Vidto Error - '+str(e) addon.show_small_popup('[B][COLOR green]Mash Up: Vidto Resolver[/COLOR][/B]','Error, Check XBMC.log for Details', 5000, elogo)
def LINK(url): link = OPEN_URL(url) link = link.encode('ascii', 'ignore').decode('ascii') try: referer = url try: RequestURL = re.search(r'emb=(.*?)&',link,re.I).group(1) except: RequestURL = re.search(r'emb2=(.*?)&',link,re.I).group(1) headers = {'Host': 'videomega.tv', 'Referer': referer, 'User-Agent': User_Agent} link = requests.get(RequestURL, headers=headers).content if jsunpack.detect(link): #1 these 3 lines taken from urlresolver js_data = jsunpack.unpack(link) #2 match = re.search('"src"\s*,\s*"([^"]+)', js_data) #3 headers = {'Origin': 'videomega.tv', 'Referer': link, 'User-Agent': User_Agent} url = match.group(1) + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={'Title':description}) liz.setProperty("IsPlayable","true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except:pass try: referer = url RequestURL = 'http://niter.co/player/pk/pk/plugins/player_p2.php' form_data = re.findall(r'ic=.*?&em.*?&(.*?)<', str(link), re.I|re.DOTALL)[0].replace('=','_') form_data={'url':form_data} headers = {'host': 'niter.co', 'content-type':'application/x-www-form-urlencoded; charset=UTF-8', 'origin':'http://niter.co', 'referer': referer, 'user-agent': User_Agent,'x-requested-with':'XMLHttpRequest'} r = requests.post(RequestURL, data=form_data, headers=headers) url = re.findall(r'"url":"(.*?)"', str(r.text), re.I|re.DOTALL)[-1] host = url.replace('http://','').replace('https://','').partition('/')[0] headers = {'Host': host, 'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={'Title':description}) liz.setProperty("IsPlayable","true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except:pass try: RequestURL = 'http://niter.co/player/pk/pk/plugins/player_p2.php' try: form_data={'url': re.search(r'ic=(.*?)&',link,re.I).group(1)} except: form_data={'url': re.search(r'ic=(.*?)<',link,re.I).group(1)} headers = {'host': 'niter.co', 'content-type':'application/x-www-form-urlencoded; charset=UTF-8', 'origin':'http://niter.co', 'referer': url, 'user-agent': User_Agent,'x-requested-with':'XMLHttpRequest'} r = requests.post(RequestURL, data=form_data, headers=headers) url = re.findall(r'"url":"(.*?)"', str(r.text), re.I|re.DOTALL)[-1] url = url.replace('.pdf','.mp4') headers = {'Host': host, 'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={'Title':description}) liz.setProperty("IsPlayable","true") liz.setPath(url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except:pass try: referer = url url = re.findall(r'dir=(.*?)&', str(link), re.I|re.DOTALL)[0] host = url.replace('http://','').replace('https://','').partition('/')[0] headers = {'Host': host, 'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={'Title':description}) liz.setProperty("IsPlayable","true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except: pass try: try: RequestURL = re.search(r'&emb=(.*?)&',link,re.I).group(1) except: RequestURL = re.search(r'&emb=(.*?)<',link,re.I).group(1) video_id = re.split(r'ef=', RequestURL, re.I)[1] form_data={'ref:': video_id} headers = {'host': 'up2stream.com','referer': url, 'user-agent': User_Agent,} r = requests.get(RequestURL, data=form_data, headers=headers).text try: match = re.compile("\,.*?'(.*?)'\.split\('\|'\)").findall(r)[0] try: url_part = re.compile("15,15,\'(.*?)\|").findall(r)[0] except: url_part = re.compile("16,16,\'(.*?)\|").findall(r)[0] try: hash_id = re.split(r"15,15,", str(match), re.I)[1] except: hash_id = re.split(r"16,16,", str(match), re.I)[1] try: hash_id2 = re.split(r"\|cdn\|http\|src\|video\|attr\|vizplay\|org\|", str(hash_id), re.I)[1] except: hash_id2 = re.split(r"\|cdn\|vizplay\|http\|src\|video\|attr\|org\|v\|hash\|.*?\|", str(hash_id), re.I)[1] try: url_part2 = re.split(r"\|hash\|st\|mp4\|v\|", str(hash_id2), re.I)[0] except: url_part2 = re.split(r"\|st\|", str(hash_id2), re.I)[0] try: hash_id3 = re.split(r"\|hash\|st\|mp4\|v\|", str(hash_id2), re.I)[1] except: hash_id3 = re.split(r"\|st\|", str(hash_id2), re.I)[1] url_part3 = re.split(r"\|", str(hash_id3), re.I)[0] try: url_part4 = re.split(r"\|mp4\|", str(hash_id3), re.I)[1] except: url_part4 = re.split(r"\|", str(hash_id3), re.I)[1] url = 'http://'+url_part+'.cdn.vizplay.org/v/'+url_part3+'.mp4?st='+url_part2+'&hash='+url_part4 print url liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={'Title':description}) liz.setProperty("IsPlayable","true") liz.setPath(url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except:pass except:pass
def LINK(url): link = OPEN_URL(url) link = link.encode('ascii', 'ignore').decode('ascii') referer = url try: url = re.findall(r'dir=(.*?)&', str(link), re.I | re.DOTALL)[0] headers = {'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={ "Title": name, "Plot": description }) liz.setProperty("IsPlayable", "true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except: pass try: try: RequestURL = re.search(r'emb.*?=(.*?)&', link, re.I).group(1) except: RequestURL = re.search(r'emb.*?=(.*?)<', link, re.I).group(1) if 'videomega' in RequestURL: headers = { 'Host': 'videomega.tv', 'Referer': referer, 'User-Agent': User_Agent } link = requests.get(RequestURL, headers=headers).content if jsunpack.detect(link): #1 these 3 lines taken from urlresolver js_data = jsunpack.unpack(link) #2 match = re.search('"src"\s*,\s*"([^"]+)', js_data) #3 headers = { 'Origin': 'videomega.tv', 'Referer': link, 'User-Agent': User_Agent } url = match.group(1) + '|' + urllib.urlencode(headers) elif 'up2stream' in RequestURL: headers = {'Referer': referer, 'User-Agent': User_Agent} link = requests.get(RequestURL, headers=headers).content if jsunpack.detect(link): js_data = jsunpack.unpack(link) match = re.search('"src"\s*,\s*"([^"]+)', js_data) headers = { 'Origin': 'http://up2stream.com', 'Referer': RequestURL, 'User-Agent': User_Agent } url = match.group(1) + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={ "Title": name, "Plot": description }) liz.setProperty("IsPlayable", "true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except: pass try: RequestURL = 'http://yify.co/player/pk/pk/plugins/player_p2.php' form_data = re.findall(r'ic=.*?&em.*?&(.*?)<', str(link), re.I | re.DOTALL)[0].replace('=', '_') form_data = {'url': form_data} headers = { 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'origin': 'http://niter.co', 'referer': referer, 'user-agent': User_Agent, 'x-requested-with': 'XMLHttpRequest' } r = requests.post(RequestURL, data=form_data, headers=headers) url = re.findall(r'"url":"(.*?)"', str(r.text), re.I | re.DOTALL)[-1] host = url.replace('http://', '').replace('https://', '').partition('/')[0] headers = {'Host': host, 'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={ "Title": name, "Plot": description }) liz.setProperty("IsPlayable", "true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except: pass try: RequestURL = 'http://yify.co/player/pk/pk/plugins/player_p2.php' try: form_data = {'url': re.search(r'ic=(.*?)&', link, re.I).group(1)} except: form_data = {'url': re.search(r'ic=(.*?)<', link, re.I).group(1)} headers = { 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'origin': 'http://niter.co', 'referer': referer, 'user-agent': User_Agent, 'x-requested-with': 'XMLHttpRequest' } r = requests.post(RequestURL, data=form_data, headers=headers) url = re.findall(r'"url":"(.*?)"', str(r.text), re.I | re.DOTALL)[-1] url = url.replace('.pdf', '.mp4') headers = {'Host': host, 'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={ "Title": name, "Plot": description }) liz.setProperty("IsPlayable", "true") liz.setPath(url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except: pass
def LINK(url): link = OPEN_URL(url) link = link.encode('ascii', 'ignore').decode('ascii') referer = url try: url = re.findall(r'dir=(.*?)&', str(link), re.I|re.DOTALL)[0] headers = {'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={"Title": name,"Plot":description}) liz.setProperty("IsPlayable","true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except: pass try: try: RequestURL = re.search(r'emb.*?=(.*?)&',link,re.I).group(1) except: RequestURL = re.search(r'emb.*?=(.*?)<',link,re.I).group(1) if 'videomega' in RequestURL: headers = {'Host': 'videomega.tv', 'Referer': referer, 'User-Agent': User_Agent} link = requests.get(RequestURL, headers=headers).content if jsunpack.detect(link): #1 these 3 lines taken from urlresolver js_data = jsunpack.unpack(link) #2 match = re.search('"src"\s*,\s*"([^"]+)', js_data) #3 headers = {'Origin': 'videomega.tv', 'Referer': link, 'User-Agent': User_Agent} url = match.group(1) + '|' + urllib.urlencode(headers) elif 'up2stream' in RequestURL: headers = {'Referer': referer, 'User-Agent': User_Agent} link = requests.get(RequestURL, headers=headers).content if jsunpack.detect(link): js_data = jsunpack.unpack(link) match = re.search('"src"\s*,\s*"([^"]+)', js_data) headers = {'Origin': 'http://up2stream.com', 'Referer': RequestURL, 'User-Agent': User_Agent} url = match.group(1) + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={"Title": name,"Plot":description}) liz.setProperty("IsPlayable","true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except:pass try: RequestURL = 'http://yify.co/player/pk/pk/plugins/player_p2.php' form_data = re.findall(r'ic=.*?&em.*?&(.*?)<', str(link), re.I|re.DOTALL)[0].replace('=','_') form_data={'url':form_data} headers = {'content-type':'application/x-www-form-urlencoded; charset=UTF-8', 'origin':'http://niter.co', 'referer': referer, 'user-agent': User_Agent,'x-requested-with':'XMLHttpRequest'} r = requests.post(RequestURL, data=form_data, headers=headers) url = re.findall(r'"url":"(.*?)"', str(r.text), re.I|re.DOTALL)[-1] host = url.replace('http://','').replace('https://','').partition('/')[0] headers = {'Host': host, 'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={"Title": name,"Plot":description}) liz.setProperty("IsPlayable","true") liz.setPath(str(url)) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except:pass try: RequestURL = 'http://yify.co/player/pk/pk/plugins/player_p2.php' try: form_data={'url': re.search(r'ic=(.*?)&',link,re.I).group(1)} except: form_data={'url': re.search(r'ic=(.*?)<',link,re.I).group(1)} headers = {'content-type':'application/x-www-form-urlencoded; charset=UTF-8', 'origin':'http://niter.co', 'referer': referer, 'user-agent': User_Agent,'x-requested-with':'XMLHttpRequest'} r = requests.post(RequestURL, data=form_data, headers=headers) url = re.findall(r'"url":"(.*?)"', str(r.text), re.I|re.DOTALL)[-1] url = url.replace('.pdf','.mp4') headers = {'Host': host, 'Referer': referer, 'User-Agent': User_Agent} url = url + '|' + urllib.urlencode(headers) liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setInfo(type='Video', infoLabels={"Title": name,"Plot":description}) liz.setProperty("IsPlayable","true") liz.setPath(url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) except:pass