def captura(name, url): tvgolourl = url link = abrir_url(url) linkoriginal = link link = clean(link) #ty tfouto link = link.replace('<div style="float:left;"><iframe', '').replace('"contentjogos">', '"contentjogos"></iframe>') ij = link.find('"contentjogos">') link = link[ij:] #ty tfouto titles = [] ligacao = [] aliezref = int(0) aliez = re.compile('<iframe.+?src="http://emb.aliez.tv/(.+?)"').findall( link) if aliez: for codigo in aliez: aliezref = int(aliezref + 1) if len(aliez) == 1: aliez2 = str('') else: aliez2 = ' #' + str(aliezref) titles.append('Aliez' + aliez2) ligacao.append('http://emb.aliez.tv/' + codigo) dailymotionref = int(0) dailymotion = re.compile( 'src="http://www.dailymotion.com/embed/video/(.+?)"', re.DOTALL | re.M).findall(link) if not dailymotion: dailymotion = re.compile( 'src="http://www.dailymotion.com/embed/video/(.+?)"', re.DOTALL | re.M).findall(linkoriginal) if dailymotion: for codigo in dailymotion: golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('Dailymotion' + golo) ligacao.append('http://www.dailymotion.com/video/' + codigo) #fb www.tvgolo.com/match-showfull-1382558391-1304288520--50 fbvideoref = int(0) fbvideo = re.compile( 'src="http://www.facebook.com/video/embed.+?video_id=(.+?)"', re.DOTALL | re.M).findall(link) if fbvideo: for codigo in fbvideo: golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('Facebook' + golo) ligacao.append("http://www.facebook.com/video/embed?video_id=" + codigo) #kiwi http://www.tvgolo.com/match-showfull-1382558564-1304288520--50 kiwiref = int(0) kiwi = re.compile('src="http://v.kiwi.kz/v2/(.+?)/"', re.DOTALL | re.M).findall(link) if kiwi: for codigo in kiwi: golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('Kiwi' + golo) ligacao.append(codigo) #Falta longtailref = int(0) longtail = re.compile( 'flashvars=".+?".+?src="http://player.longtailvideo.com/player5.2.swf"' ).findall(link) if longtail: for codigo in longtail: longtailref = int(longtailref + 1) if len(longtail) == 1: longtail2 = str('') else: longtail2 = ' #' + str(longtailref) titles.append('Longtail' + longtail2 + ' (' + traducao(40015) + ')') ligacao.append(0) metauaref = int(0) metaua = re.compile( 'src="http://video.meta.ua/players/video/3.2.19k/Player.swf.+?fileID=(.+?)&' ).findall(link) if metaua: for codigo in metaua: metauaref = int(metauaref + 1) if len(metaua) == 1: metaua2 = str('') else: metaua2 = ' #' + str(metauaref) titles.append('Meta.ua' + metaua2 + ' (' + traducao(40015) + ')') ligacao.append(0) #http://www.tvgolo.com/match-showfull-1396982174---50 playwire = re.compile( 'data-publisher-id="(.+?)" data-video-id="(.+?)"').findall(link) if not playwire: playwire = re.compile( 'http://config.playwire.com/videos/(.+?)/(.+?)/').findall(link) if playwire: for publisher, codigo in playwire: if publisher == 'v2': publisher = 'configopener' golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('Playwire' + golo) ligacao.append('http://cdn.playwire.com/v2/%s/config/%s.json' % (publisher, codigo)) playwire_v2 = re.compile( 'http://config.playwire.com/(.+?)/videos/v2/(.+?)/player.json' ).findall(link) if playwire_v2: for publisher, codigo in playwire_v2: golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('Playwire' + golo) ligacao.append( 'http://config.playwire.com/%s/videos/v2/%s/player.json' % (publisher, codigo)) #rutube http://www.tvgolo.com/match-showfull-1376242370---02 rutuberef = int(0) rutube = re.compile('src=".+?rutube.ru/video/embed/(.+?)"', re.DOTALL | re.M).findall(link) if not rutube: rutube = re.compile('value="http://video.rutube.ru/(.+?)"', re.DOTALL | re.M).findall(linkoriginal) if not rutube: rutube = re.compile('src="http://rutube.ru/video/embed/(.+?)"', re.DOTALL | re.M).findall(linkoriginal) if rutube: for codigo in rutube: golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append("Rutube" + golo) ligacao.append(codigo) saporef = int(0) sapo = re.compile('src="http://videos.sapo.pt/playhtml.+?file=(.+?)/1&"', re.DOTALL | re.M).findall(link) if sapo: for endereco in sapo: golo = findgolo(link, endereco) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('Videos Sapo' + golo) ligacao.append(endereco) videaref = int(0) videa = re.compile('src="http://videa.hu/(.+?)"', re.DOTALL | re.M).findall(link) if videa: for codigo in videa: golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('Videa' + golo) ligacao.append('http://videa.hu/' + codigo) #http://www.tvgolo.com/match-showfull-1376242370---02 vkref = int(0) vk = re.compile('src="http://vk.com/(.+?)"', re.DOTALL | re.M).findall(link) if vk: for codigo in vk: golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('VK' + golo) ligacao.append('http://vk.com/' + codigo) youtuberef = int(0) youtube = re.compile('src="http://www.youtube.com/embed/(.+?)"', re.DOTALL | re.M).findall(link) if not youtube: youtube = re.compile('src="//www.youtube.com/embed/(.+?)"', re.DOTALL | re.M).findall(link) if youtube: for codigo in youtube: golo = findgolo(link, codigo) golo = cleangolo(golo).replace('<', '') if golo: golo = ' (%s)' % (golo) titles.append('Youtube' + golo) ligacao.append(codigo) if len(ligacao) == 1: index = 0 elif len(ligacao) == 0: ok = mensagemok(traducao(40000), traducao(40016)) return else: #titles.append('');titles.append('[COLOR blue][B]'+traducao(40017)+'[/B][/COLOR]');ligacao.append(0);ligacao.append(0) index = menuescolha(traducao(40018), titles) if index > -1: linkescolha = ligacao[index] servidor = titles[index] if linkescolha: if re.search('Rutube', servidor): link = abrir_url('http://rutube.ru/api/play/options/' + linkescolha) try: streamurl = re.compile('"m3u8": "(.+?)"').findall(link)[0] except: streamurl = re.compile('"default": "(.+?)"').findall( link)[0] comecarvideo(name, streamurl, '') elif re.search('Aliez', servidor): linkescolha = linkescolha.replace('amp;', '') link = abrir_url(linkescolha) streamurl = re.compile("file.+?'(.+?)'").findall(link)[0] comecarvideo(name, streamurl, '') elif re.search('Playwire', servidor): if re.search('configopener', linkescolha): videoid = ''.join(linkescolha.split('/')[-1:]).replace( '.json', '') streamurl = redirect( 'http://config.playwire.com/videos/v2/%s/player.json' % videoid).replace('player.json', 'manifest.f4m') else: link = abrir_url(linkescolha) streamurl = re.compile('"src":"(.+?)"').findall(link)[0] if re.search('.f4m', streamurl): titles = [] ligacao = [] f4m = abrir_url(streamurl) baseurl = re.compile('<baseURL>(.+?)</baseURL>').findall( f4m)[0] videos = re.compile( 'url="(.+?)".+?height="(.+?)"').findall(f4m) for urlname, quality in videos: titles.append(quality + 'p') ligacao.append(urlname) if len(ligacao) == 1: index = 0 else: index = menuescolha("Qualidade", titles) if index > -1: streamurl = '%s/%s' % (baseurl, ligacao[index]) else: return streamurl = streamurl.replace( 'rtmp://streaming.playwire.com/', 'http://cdn.playwire.com/').replace('mp4:', '') comecarvideo(name, streamurl, '') elif re.search('VK', servidor): linkescolha = linkescolha.replace('amp;', '') link = abrir_url(linkescolha) link = link.replace('\\', '') if re.search('No videos found.', link): ok = mensagemok("OKGoals", 'Video not found') else: titles = [] ligacao = [] try: streamurl = re.compile('"url1080":"(.+?)"').findall( link)[0] titles.append("1080p") ligacao.append(streamurl) except: pass try: streamurl = re.compile('"url720":"(.+?)"').findall( link)[0] titles.append("720p") ligacao.append(streamurl) except: pass try: streamurl = re.compile('"url480":"(.+?)"').findall( link)[0] titles.append("480p") ligacao.append(streamurl) except: pass try: streamurl = re.compile('"url360":"(.+?)"').findall( link)[0] titles.append("360p") ligacao.append(streamurl) except: pass try: streamurl = re.compile('"url240":"(.+?)"').findall( link)[0] titles.append("240p") ligacao.append(streamurl) except: pass if len(ligacao) == 1: index = 0 else: index = menuescolha("Qualidade", titles) if index > -1: linkescolha = ligacao[index] comecarvideo(name, linkescolha, '') elif re.search('Sapo', servidor): comecarvideo(name, linkescolha, '') elif re.search('Facebook', servidor): link = abrir_url(linkescolha) params = re.compile('"params","([\w\%\-\.\\\]+)').findall( link)[0] html = urllib.unquote(params.replace('\u0025', '%')).decode('utf-8') html = html.replace('\\', '') streamurl = re.compile( '(?:hd_src|sd_src)\":\"([\w\-\.\_\/\&\=\:\?]+)').findall( html)[0] comecarvideo(name, streamurl, '') elif re.search('Kiwi', servidor): link = urllib.unquote( abrir_url('http://v.kiwi.kz/v2/' + linkescolha)) streamurl = re.compile('&url=(.+?)&poster').findall(link)[0] comecarvideo(name, streamurl, '') elif re.search('videa', linkescolha): referencia = re.compile('flvplayer.swf.+?v=(.+?)"').findall( linkescolha)[0] link = abrir_url( 'http://videa.hu/flvplayer_get_video_xml.php?v=' + referencia) streamurl = re.compile( '<version quality="standard" video_url="(.+?)"').findall( link)[0] comecarvideo(name, streamurl, '') elif re.search('Youtube', servidor): streamurl = 'plugin://plugin.video.youtube/?action=play_video&videoid=' + codigo comecarvideo(name, streamurl, '') elif re.search('dailymotion', linkescolha): import urlresolver sources = [] hosted_media = urlresolver.HostedMediaFile(url=linkescolha) sources.append(hosted_media) source = urlresolver.choose_source(sources) if source: linkescolha = source.resolve() if linkescolha == False: okcheck = xbmcgui.Dialog().ok okcheck(traducao(40000), traducao(40019)) return else: comecarvideo(name, linkescolha, '')
def find_sources(url): sources = [] hosted_media = urlresolver.HostedMediaFile(url=url) sources.append(hosted_media) source = urlresolver.choose_source(sources) return source
nometopico = re.compile('<title>(.+?)</title>').findall(conteudo)[0] mesmo = re.compile('<code class="bbc_code">(.+?)</code>').findall(conteudo) #print mesmo for endereco in mesmo: hosted_media = urlresolver.HostedMediaFile(endereco) if hosted_media: print "consegue" else: print "nao consegue" #print hosted_media sources.append(hosted_media) if not mesmo: if re.search('youtube.com', conteudo): try: idyoutube = re.compile( 'class="aeva_link bbc_link new_win">.+?v=(.+?)</a>' ).findall(conteudo)[0] hosted_media = urlresolver.HostedMediaFile( 'http://www.youtube.com/watch?v=' + idyoutube) sources.append(hosted_media) except: pass if re.search('vimeo.com', conteudo): try: idv = re.compile('"http://vimeo.com/(.+?)"').findall( conteudo)[0] hosted_media = urlresolver.HostedMediaFile( 'http://www.vimeo.com/' + idv) sources.append(hosted_media) except: pass source = urlresolver.choose_source(sources) if source:
def resolveUrl(url, direct=True): try: dialog = None dialog = control.progressDialog dialog.create(control.addonInfo('name'), control.lang(30726).encode('utf-8')) dialog.update(0) except: pass try: if not '</regex>' in url: raise Exception() from resources.lib.modules import regex u = regex.resolve(url) if not u == None: url = u except: pass try: if not '.f4m'in url: raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit('.')[-1].replace('/', '').lower() if not ext == 'f4m': raise Exception() from resources.lib.modules.f4mproxy.F4mProxy import f4mProxyHelper f4mlabel = cleantitle(control.infoLabel('listitem.label')) f4micon = control.infoLabel('listitem.icon') return f4mProxyHelper().playF4mLink(url, f4mlabel, None, None, '', f4micon) except: pass try: if not url.startswith('rtmp'): raise Exception() if len(re.compile('\s*timeout=(\d*)').findall(url)) == 0: url += ' timeout=10' return playItem(url, dialog) except: pass try: url = url.split('<source>')[0] domain = '.'.join((urlparse.urlparse(url).netloc).split('.')[-2:]).lower() s = [] path = os.path.join(control.addonInfo('path'), 'resources', 'lib', 'sources') for d in os.listdir(path): try: s += [(d, re.findall('self\.domains\s*=\s*\[(.+?)\]', open(os.path.join(path, d), 'r').read())[0].split(','))] except: pass s = [(i[0], [x.replace('\'', '').replace('\"', '').strip() for x in i[1]]) for i in s] s = [i[0].replace('.py', '') for i in s if domain in i[1]] if len(s) > 0: direct = False import urlresolver hostDict = urlresolver.plugnplay.man.implementors(urlresolver.UrlResolver) hostDict = [i.domains for i in hostDict] hostDict = [i for i in hostDict if not '*' in i] hostDict = [i.lower() for i in reduce(lambda x, y: x+y, hostDict)] hostDict = [x for y,x in enumerate(hostDict) if x not in hostDict[:y]] hostcapDict = ['hugefiles.net', 'kingfiles.net', 'openload.io', 'openload.co'] call = __import__('resources.lib.sources.%s' % s[0], globals(), locals(), ['object'], -1).source() sources = call.sources(url, hostDict, hostDict) random.shuffle(sources) filter = [] filter += [i for i in sources if i['direct'] == True] filter += [i for i in sources if i['direct'] == False] sources = filter filter = [] filter += [i for i in sources if i['quality'] == '1080p' and not i['source'].lower() in hostcapDict] filter += [i for i in sources if i['quality'] == '1080p' and i['source'].lower() in hostcapDict] filter += [i for i in sources if i['quality'] == 'HD' and not i['source'].lower() in hostcapDict] filter += [i for i in sources if i['quality'] == 'HD' and i['source'].lower() in hostcapDict] filter += [i for i in sources if i['quality'] == 'SD' and not i['source'].lower() in hostcapDict] filter += [i for i in sources if i['quality'] == 'SCR' and not i['source'].lower() in hostcapDict] filter += [i for i in sources if i['quality'] == 'CAM' and not i['source'].lower() in hostcapDict] sources = filter try: dialog.update(50, control.lang(30726).encode('utf-8'), str(' ')) except: pass u = None for i in range(len(sources)): try: try: if dialog.iscanceled(): break if xbmc.abortRequested == True: return sys.exit() except: pass url = call.resolve(sources[i]['url']) if url == None: raise Exception() if not sources[i]['direct'] == True: url = urlresolver.HostedMediaFile(url=sources[i]['url']).resolve() if url == False: raise Exception() u = url ; break except: pass if not u == None: return playItem(u, dialog) except: pass try: import urlresolver if urlresolver.HostedMediaFile(url).valid_url() == True: direct = False u = urlresolver.HostedMediaFile(url=url).resolve() if not u == False: return playItem(u, dialog) except: pass try: domain = '.'.join((urlparse.urlparse(url).netloc).split('.')[-2:]).lower() s = [] path = os.path.join(control.addonInfo('path'), 'resources', 'lib', 'resolvers') for d in os.listdir(path): try: s += [(d, re.findall('domains\s*=\s*\[(.+?)\]', open(os.path.join(path, d), 'r').read())[0].split(','))] except: pass s = [(i[0], [x.replace('\'', '').replace('\"', '').strip() for x in i[1]]) for i in s] s = [i[0].replace('.py', '') for i in s if domain in i[1]] if len(s) > 0: direct = False u = __import__('resources.lib.resolvers.%s' % s[0], globals(), locals(), ['object'], -1).resolve(url) if not u == None: return playItem(u, dialog) except: pass if direct == True: return playItem(url, dialog) try: dialog.close() except: pass return control.infoDialog(control.lang(30705).encode('utf-8'))
def GetLinks(section, url): # Get Links print 'GETLINKS FROM URL: ' + url html = net.http_GET(str(url)).content CLEAN(html) sources = [] listitem = GetMediaInfo(html) print 'LISTITEM: ' + str(listitem) content = html print 'CONTENT: ' + str(listitem) r = re.search('<strong>Links.*</strong>', html) r = re.search('commentblock', content) if r: content = content[:r.start()] match = re.compile('href="(.+?)"').findall(content) listitem = GetMediaInfo(content) for url in match: host = GetDomain(url) if 'Unknown' in host: continue if r: continue print '*****************************' + host + ' : ' + url title = url.rpartition('/') title = title[2].replace('.html', '') title = title.replace('.htm', '') title = title.replace('-', ' ') title = title.replace('_', ' ') name = host + '-' + title hosted_media = urlresolver.HostedMediaFile(url=url, title=name) sources.append(hosted_media) find = re.search('commentblock', html) if find: print 'in comments if' html = html[find.end():] CLEAN(html) ### match = re.compile('<a href="(http://.+?)" rel="nofollow"', re.DOTALL).findall(html) match1 = re.compile(r'comment-page-numbers(.+?)<!--comments form -->', re.DOTALL).findall(html) match = re.compile('<a href="(htt.+?)" rel="nofollow"', re.DOTALL).findall(str(match1)) print 'MATCH IS: ' + str(match) print len(match) for url in match: host = GetDomain(url) if 'Unknown' in host: continue # ignore .rar files r = re.search('\.rar[(?:\.html|\.htm)]*', url, re.IGNORECASE) if r: continue try: print 'in GetLinks if loop' title = url.rpartition('/') title = title[2].replace('.html', '') title = title.replace('.htm', '') title = title.replace('-', ' ') title = title.replace('_', ' ') name = host + '-' + title hosted_media = urlresolver.HostedMediaFile(url=url, title=name) sources.append(hosted_media) print sources print 'URL IS::: ' + url except: continue source = urlresolver.choose_source(sources) if source: stream_url = source.resolve() else: stream_url = '' xbmc.Player().play(stream_url) xbmcplugin.endOfDirectory(int(sys.argv[1]))
web_url = 'https://www.trt.pl/film/297j7mtenu/Nice-Guys-Rowni-goscie-The-Nice-Guys-2016-LEKTOR' web_url = 'http://ebd.cda.pl/638x469/13226752c' web_url = 'https://openload.co/embed/rZ04_L_uRuU' #pattern = '(?://|\.)(openload\.(?:io|co))/(?:embed|f)/([0-9a-zA-Z-_]+)' #import re #r = re.search(pattern, web_url, re.I) #print r.group(0) try: import urlresolver except: import urlresolver as urlresolver hmf = urlresolver.HostedMediaFile(url=web_url, include_disabled=True, include_universal=False) print "HMF", hmf if hmf.valid_url() == True: url = hmf.resolve() print("RESOLVED", url) exit() #import mrknow_pCommon #mrknow_pCommon.mystat(url='http://aso.pl') import urllib2, socket socket.setdefaulttimeout(180) # read the list of proxy IPs in proxyList proxyList = ['89.250.207.195:80', '172.30.1.1:8080',
def urlopen(self, URL, mediaitem=0): result = {"code":0} #successful try: import urlresolver; except: pass try: #import urlresolver; if urlresolver.HostedMediaFile(mediaitem.URL).valid_url()==True: print "valid url for local UrlResolver"; self.loc_url=urlresolver.HostedMediaFile(mediaitem.URL).resolve(); print "loc_url:"; print self.loc_url; if '://' in self.loc_url: self.processed=True; return {"code":0}; except urllib2.URLError, e: print e; pass except Exception, e: print e; pass except: pass if mediaitem.processor != '': #if tfalse(SettingG("use-LocalUrlResolver"))==True: # try: # #import urlresolver; # print "using urlresolver method"; print "mediaitem.URL"; # if urlresolver.HostedMediaFile(mediaitem.URL).valid_url()==True: # print "valid url"; # self.loc_url=urlresolver.HostedMediaFile(mediaitem.URL).resolve(); print "loc_url:"; print self.loc_url; # self.processed=True; return {"code":0}; # except: ## Fall back to site processors # result=self.geturl_processor(mediaitem) #else: result=self.geturl_processor(mediaitem) #print "======================================="; print mediaitem.processor; print mediaitem.URL; print result; print "======================================="; elif URL.find('http://www.youtube.com') != -1: #if tfalse(SettingG("use-LocalUrlResolver"))==True: # try: # import urlresolver; print "using urlresolver method"; print "mediaitem.URL"; # if urlresolver.HostedMediaFile(mediaitem.URL).valid_url(): # print "valid url"; # self.loc_url=urlresolver.HostedMediaFile(mediaitem.URL).resolve(); print "loc_url:"; print self.loc_url; # self.processed=True; return {"code":0}; # except: ## Fall back to site processors # mediaitem.processor="http://www.navixtreme.com/proc/youtube"; # result=self.geturl_processor(mediaitem); #else: mediaitem.processor="http://www.navixtreme.com/proc/youtube"; result=self.geturl_processor(mediaitem); #print "======================================="; print URL; print mediaitem.processor; print mediaitem.URL; print result; print "======================================="; elif URL[:4] == 'http': if mediaitem.processed==True: self.loc_url=mediaitem.URL else: result=self.geturl_redirect(URL,mediaitem) else: self.loc_url=URL print "======================================="; print URL; print mediaitem.processor; print mediaitem.URL; print result; print "======================================="; try: if (not result["code"] == 0) and ('http' in mediaitem.URL): ## Thus far result['code'] seems to be 0 even if online processor fails. #import urlresolver; print "using urlresolver method as final fallback attempt"; print "mediaitem.URL"; if urlresolver.HostedMediaFile(mediaitem.URL).valid_url()==True: print "valid url"; self.loc_url=urlresolver.HostedMediaFile(mediaitem.URL).resolve(); print "loc_url:"; print self.loc_url; self.processed=True; result={"code":0}; except: pass return result
def GetFileHosts(self, url, list, lock, message_queue): from entertainment import requests from entertainment import jsunpack import urlresolver, re headers = {'User-Agent': self.User_Agent} link = requests.get(url, headers=headers, timeout=15).content try: RES = re.findall(r'Quality:</strong>([^<>]*)<', str(link), re.I | re.DOTALL)[0].upper() except: RES = '' if '4K' in RES: res = '4K' elif '3D' in RES: res = '3D' elif '1080' in RES: res = '1080P' elif '720' in RES: res = '720P' elif 'HD' in RES: res = 'HD' elif 'DVD' in RES: res = 'DVD' elif 'HDTS' in RES: res = 'TS' elif 'TS' in RES: res = 'TS' elif 'CAM' in RES: res = 'CAM' elif 'HDCAM' in RES: res = 'CAM' else: res = '720P' iframe_url = re.findall(r'iframe.*?src="([^"]+)"', str(link), re.I | re.DOTALL) for source in iframe_url: if '/gdp/play/' in source: try: source = source.replace('&', '&') link2 = requests.get(source, headers=headers, timeout=15).content match = '' if 'JuicyCodes' in link2: try: data = re.findall( 'type="text/javascript">([^<>]*)<', str(link2), re.I | re.DOTALL)[0] data = data.replace('JuicyCodes.Run(', '').replace( '"+"', '').decode('base64') js_data = jsunpack.unpack(data) match = re.findall( r'"file":"([^"]+)".*?"label":"([^"]+)"', str(js_data), re.I | re.DOTALL) except: pass else: try: if jsunpack.detect(link2): js_data = jsunpack.unpack(link2) match = re.findall( r'"file":"([^"]+)".*?"label":"([^"]+)"', str(js_data), re.I | re.DOTALL) except: pass self.AddMedia(list, match) except: pass else: if urlresolver.HostedMediaFile(source): self.AddFileHost(list, res, source)
def get_source(self, url): count = 0 try: if not 'http' in url: url = 'http:' + url if 'openload' in url: try: chk = requests.get(url).content rez = re.compile('"description" content="(.+?)"', re.DOTALL).findall(chk)[0] if '1080' in rez: res = '1080p' elif '720' in rez: res = '720p' else: res = 'DVD' except: res = 'DVD' count += 1 self.sources.append({ 'source': 'Openload', 'quality': res, 'scraper': self.name, 'url': url, 'direct': False }) elif 'goo.gl' in url: headers = {'User-Agent': User_Agent} r = requests.get(url, headers=headers, allow_redirects=False) new_url = r.headers['location'] count += 1 self.sources.append({ 'source': 'HQQ', 'quality': '720P', 'scraper': self.name, 'url': new_url, 'direct': False }) elif 'dailymotion' in url: count += 1 self.sources.append({ 'source': 'Dailymotion', 'quality': '720P', 'scraper': self.name, 'url': url, 'direct': False }) elif 'streamango.com' in url: holder = requests.get(url).content qual = re.compile('type:"video/mp4".+?height:(.+?),', re.DOTALL).findall(holder)[0] count += 1 self.sources.append({ 'source': 'Streamango.com', 'quality': qual, 'scraper': self.name, 'url': url, 'direct': False }) else: if urlresolver.HostedMediaFile(url).valid_url(): host = url.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() count += 1 self.sources.append({ 'source': host, 'quality': 'SD', 'scraper': self.name, 'url': url, 'direct': False }) except: pass if dev_log == 'true': end_time = time.time() - self.start_time send_log(self.name, end_time, count)
def GetLinks(url): movie_url_data = net.http_GET(url).content movie_url_data = addon.unescape(movie_url_data) movie_url_data = unescape(movie_url_data) movie_img = re.search( r"(?s)<div class='post-body entry-content'>.*?<img.*?src=\"(.+?)\".*?</div>", movie_url_data).group(1) playable_items_match = re.search( r"(?s)<div class='post-body entry-content'>(.+?)<div class='post-footer'>", movie_url_data) if playable_items_match: playable_items = playable_items_match.group(1) playable_items = addon.unescape(playable_items) playable_items = unescape(playable_items) for playable_item in re.finditer(r"<a.*?href=\"(.+?)\".*?\">(.+?)/a>", playable_items): playable_item_url = playable_item.group(1) if (re.search("bollywoodsantabanta", playable_item_url)): embed_url_data = net.http_GET(playable_item_url).content iframe = re.search( "(?s)<div class='post-body entry-content'>.*?<iframe.*?src=\"(.+?)\".*?\"></iframe>", embed_url_data) if iframe: playable_item_url = iframe.group(1) playable_item_url = playable_item_url.replace("embed-", "") playable_item_url = re.sub(r"-.*?\.", ".", playable_item_url) elif (re.search("desihome", playable_item_url)): embed_url_data = net.http_GET(playable_item_url).content playable_item_title = playable_item.group(2) playable_item_part_match = re.search(r"[Pp]art(.*?)<", playable_item_title) playable_item_name_part = '' if playable_item_part_match: playable_item_name_part = " - Part" + playable_item_part_match.group( 1) for iframe in re.finditer( "(?s)<div id=tab.*?<iframe.*?src=\"(.+?)\".*?\"></iframe>", embed_url_data): playable_item_url = iframe.group(1) playable_item_url = playable_item_url.replace("embed-", "") playable_item_url = re.sub(r"-.*?\.", ".", playable_item_url) playable_item_url = playable_item_url.replace( "dailymotion.com/embed/", "dailymotion.com/swf/") playable_item_url = playable_item_url.replace(".html", "") hosted_media = urlresolver.HostedMediaFile( url=playable_item_url) if hosted_media: playable_item_name = playable_item_url if re.search("http://www.", playable_item_name): playable_item_name = playable_item_name[ playable_item_name.index('.') + 1:] elif re.search("http://", playable_item_name): playable_item_name = playable_item_name.replace( "http://", "") playable_item_name = playable_item_name[ 0:playable_item_name. index('.')] + playable_item_name_part queries = { 'mode': 'play', 'url': playable_item_url, 'title': title + ' - ' + playable_item_name, 'historytitle': title, 'historylink': sys.argv[0] + sys.argv[2], 'img': movie_img } contextMenuItems = [] from universal import playbackengine contextMenuItems.insert( 0, ('Queue Item', playbackengine.QueueItem( addon_id, title + ' - ' + playable_item_name, addon.build_plugin_url(queries)))) addon.add_directory(queries, {'title': playable_item_name}, contextMenuItems, context_replace=False, img=movie_img) for iframe in re.finditer( "(?s)<div id=tab.*?<embed.*?src=\"(.+?)\".*?\"></embed>", embed_url_data): playable_item_url = iframe.group(1) playable_item_url = playable_item_url.replace("embed-", "") playable_item_url = re.sub(r"-.*?\.", ".", playable_item_url) playable_item_url = playable_item_url.replace( "dailymotion.com/embed/", "dailymotion.com/swf/") playable_item_url = playable_item_url.replace(".html", "") hosted_media = urlresolver.HostedMediaFile( url=playable_item_url) if hosted_media: playable_item_name = playable_item_url if re.search("http://www.", playable_item_name): playable_item_name = playable_item_name[ playable_item_name.index('.') + 1:] elif re.search("http://", playable_item_name): playable_item_name = playable_item_name.replace( "http://", "") playable_item_name = playable_item_name[ 0:playable_item_name. index('.')] + playable_item_name_part queries = { 'mode': 'play', 'url': playable_item_url, 'title': title + ' - ' + playable_item_name, 'historytitle': title, 'historylink': sys.argv[0] + sys.argv[2], 'img': movie_img } contextMenuItems = [] from universal import playbackengine contextMenuItems.insert( 0, ('Queue Item', playbackengine.QueueItem( addon_id, title + ' - ' + playable_item_name, addon.build_plugin_url(queries)))) addon.add_directory(queries, {'title': playable_item_name}, contextMenuItems, context_replace=False, img=movie_img) continue playable_item_url = playable_item_url.replace(".html", "") playable_item_url = playable_item_url.replace( "dailymotion.com/embed/", "dailymotion.com/swf/") hosted_media = urlresolver.HostedMediaFile(url=playable_item_url) if hosted_media: playable_item_title = playable_item.group(2) playable_item_name = playable_item_url if re.search("http://www.", playable_item_name): playable_item_name = playable_item_name[playable_item_name. index('.') + 1:] elif re.search("http://", playable_item_name): playable_item_name = playable_item_name.replace( "http://", "") playable_item_name = playable_item_name[0:playable_item_name. index('.')] playable_item_part_match = re.search(r"[Pp]art(.*?)<", playable_item_title) if playable_item_part_match: playable_item_name = playable_item_name + " - Part" + playable_item_part_match.group( 1) queries = { 'mode': 'play', 'url': playable_item_url, 'title': title + ' - ' + playable_item_name, 'historytitle': title, 'historylink': sys.argv[0] + sys.argv[2], 'img': movie_img } contextMenuItems = [] from universal import playbackengine contextMenuItems.insert( 0, ('Queue Item', playbackengine.QueueItem( addon_id, title + ' - ' + playable_item_name, addon.build_plugin_url(queries)))) addon.add_directory(queries, {'title': playable_item_name}, contextMenuItems, context_replace=False, img=movie_img) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def __resolve_item(url, title): import urlresolver media = urlresolver.HostedMediaFile( url=url, title=title) return media.resolve()
def LINKTV4B(mname, murl): main.GA("RlsmixTV", "Watched") ok = True infoLabels = main.GETMETAEpiT(mname, '', '') video_type = 'episode' season = infoLabels['season'] episode = infoLabels['episode'] img = infoLabels['cover_url'] fanart = infoLabels['backdrop_url'] imdb_id = infoLabels['imdb_id'] infolabels = { 'supports_meta': 'true', 'video_type': video_type, 'name': str(infoLabels['title']), 'imdb_id': str(infoLabels['imdb_id']), 'season': str(season), 'episode': str(episode), 'year': str(infoLabels['year']) } hosted_media = urlresolver.HostedMediaFile(url=murl) source = hosted_media try: if source: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = source.resolve() else: stream_url = False infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'] } # play with bookmark player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=infoLabels['title'], season=str(season), episode=(episode), year=str(infoLabels['year']), img=img, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id=imdb_id) #WatchHistory if selfAddon.getSetting("whistory") == "true": wh.add_item(mname + ' ' + '[COLOR green]Rlsmix[/COLOR]', sys.argv[0] + sys.argv[2], infolabels=infolabels, img=img, fanart=fanart, is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def get_source(self, item_url): try: #print 'solar Pass ' + item_url headers = {'User-Agent': random_agent()} OPEN = requests.get(item_url, headers=headers, timeout=5).content Endlinks = re.compile('id="link_.+?target="_blank" id="(.+?)"', re.DOTALL).findall(OPEN) #print 'SolarMovie - scrape_movie - EndLinks: '+str(Endlinks) count = 0 for link in Endlinks: if 'openload' in link: try: headers = {'User_Agent': User_Agent} get_res = requests.get(link, headers=headers, timeout=5).content rez = re.compile('description" content="(.+?)"', re.DOTALL).findall(get_res)[0] if '1080p' in rez: qual = '1080p' elif '720p' in rez: qual = '720p' else: qual = 'DVD' except: qual = 'DVD' count += 1 self.sources.append({ 'source': 'Openload', 'quality': qual, 'scraper': self.name, 'url': link, 'direct': False }) elif 'streamango' in link: try: headers = {'User_Agent': User_Agent} get_res = requests.get(link, headers=headers, timeout=5).content rez = re.compile('description" content="(.+?)"', re.DOTALL).findall(get_res)[0] if '1080' in rez: qual = '1080p' elif '720' in rez: qual = '720p' else: qual = 'DVD' except: qual = 'DVD' count += 1 self.sources.append({ 'source': 'Streamango', 'quality': qual, 'scraper': self.name, 'url': link, 'direct': False }) else: if urlresolver.HostedMediaFile(link): host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() count += 1 self.sources.append({ 'source': host, 'quality': 'DVD', 'scraper': self.name, 'url': link, 'direct': False }) if dev_log == 'true': end_time = time.time() - self.start_time send_log(self.name, end_time, count) except: pass
def get_source(self, item_url, title, year, season, episode, start_time): if 1: #try: rez = item_url if '1080' in rez: res = '1080p' elif '720' in rez: res = '720p' else: res = 'SD' headers = {'User-Agent': random_agent()} OPEN = requests.get(item_url, headers=headers, timeout=10).content Regexs = re.compile('<h4 style="(.+?)</h4>', re.DOTALL).findall(OPEN) Regex = re.compile('link=(.+?)"', re.DOTALL).findall(str(Regexs)) stream = re.compile('href="(.+?)"', re.DOTALL).findall(str(Regexs)) count = 0 for links in stream: if 'video.php' in links: link = 'https://lh3.googleusercontent.com/' + links.split( '=' )[1].replace( '&s', '' ) + '=m18|User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0' count += 1 self.sources2.append({ 'source': 'Google', 'quality': res, 'language': 'en', 'url': link, 'direct': True, 'debridonly': False }) elif '/openload.php?url=' in links: link = 'https://openload.co/embed/' + links.split('=')[1] host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() if 'Www' not in host: count += 1 self.sources2.append({ 'source': host, 'quality': res, 'language': 'en', 'url': link, 'direct': False, 'debridonly': False }) for link in Regex: try: link = base64.b64decode(link) except: pass if not urlresolver.HostedMediaFile(link).valid_url(): continue host = link.split('//')[1].replace('www.', '') host = host.split('/')[0].split('.')[0].title() if 'Www' not in host: count += 1 self.sources2.append({ 'source': host, 'quality': res, 'language': 'en', 'url': link, 'direct': False, 'debridonly': False })
def PLAY_URL(name,url,iconimage): name,url = url.split('|SPLIT|') dp = common.GET_LUCKY() ref_url = url result = common.open_url(url) url = re.compile('<source src="(.+?)"',re.DOTALL).findall(result)[-1] choice = dialog.select("[COLOR red]Please select an option[/COLOR]", ['[COLOR pink]Watch Video[/COLOR]','[COLOR pink]Add to Favourites[/COLOR]','[COLOR pink]Download Video[/COLOR]']) if choice == 1: a=open(FAVOURITES_FILE).read() b=a.replace('#START OF FILE#', '#START OF FILE#\n<item>\n<name>'+str(name)+'</name>\n<link>'+str(url)+'</link>\n<site>Perfect Girls</site>\n<icon>'+str(iconimage)+'</icon>\n</item>\n') f= open(FAVOURITES_FILE, mode='w') f.write(str(b)) f.close() dp.close() dialog.ok(AddonTitle, "[COLOR pink]" + name + " has been added to your favourites. You can access your favourites on the main menu.[/COLOR]") quit() elif choice == 2: try: download_location = plugintools.get_setting("download_location") download_folder = xbmc.translatePath(download_location) _in = url name = name.replace(' ','_').replace('[COLOR','').replace('[/COLOR','').replace('[I]','').replace(']','').replace('|','').replace('%','').replace('-','').replace('[/I','').replace('[/B','').replace('[','').replace('/','').replace(':','') _out = download_folder + name + '.mp4' dp.close() a=open(DOWNLOADS_FILE).read() b=a.replace('#START OF FILE#', '#START OF FILE#\n<item>\n<name>'+str(_out)+'</name>\n<icon>'+str(iconimage)+'</icon>\n</item>\n') f= open(DOWNLOADS_FILE, mode='w') f.write(str(b)) f.close() downloader.download(_in,_out,dp=None) dialog.ok(AddonTitle, "[COLOR pink]Your video has been successfully downloaded and can be viewed from the Your Downloads section on the main menu.[/COLOR]") except: try: os.remove(_out) except: pass dp.close() dialog.ok(AddonTitle, "[COLOR pink]Sorry, there was an error trying to download the video.[/COLOR]") quit() elif choice == 0: history_on_off = plugintools.get_setting("history_setting") if history_on_off == "true": date_now = datetime.datetime.now().strftime("%d-%m-%Y") time_now = datetime.datetime.now().strftime("%H:%M") a=open(HISTORY_FILE).read() b=a.replace('#START OF FILE#', '#START OF FILE#\n<item>\n<date>'+str(date_now)+'</date>\n<time>'+str(time_now)+'</time>\n<name>'+str(name)+'</name>\n<link>'+str(url)+'</link>\n<site>Perfect Girls</site>\n<icon>'+str(iconimage)+'</icon>\n</item>\n') f= open(HISTORY_FILE, mode='w') f.write(str(b)) f.close() import urlresolver if urlresolver.HostedMediaFile(url).valid_url(): url = urlresolver.HostedMediaFile(url).resolve() liz = xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage) dp.close() xbmc.Player ().play(url, liz, False) else: dp.close() quit()
def PlayShowLink ( url ): # url = tabURL.replace('%s',channelName); req = urllib2.Request(url) req.add_header('User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10') response = urllib2.urlopen(req) link=response.read() response.close() # print url line1 = "Playing DM Link" time = 5000 #in miliseconds defaultLinkType=0 #0 youtube,1 DM,2 tunepk defaultLinkType=selfAddon.getSetting( "DefaultVideoType" ) print defaultLinkType print "LT link is" + linkType # if linktype is not provided then use the defaultLinkType if linkType.upper()=="SHOWALL" or (linkType.upper()=="" and defaultLinkType=="5"): ShowAllSources(url,link) return if linkType.upper()=="DM" or (linkType=="" and defaultLinkType=="1"): print "PlayDM" line1 = "Playing DM Link" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) # print link playURL= match =re.findall('src="(http.*?(dailymotion.com).*?)"',link) if len(playURL)==0: line1 = "Daily motion link not found" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) ShowAllSources(url,link) return playURL=match[0][0] print playURL playlist = xbmc.PlayList(1) playlist.clear() listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png") listitem.setInfo("Video", {"Title":name}) listitem.setProperty('mimetype', 'video/x-msvideo') listitem.setProperty('IsPlayable', 'true') stream_url = urlresolver.HostedMediaFile(playURL).resolve() print stream_url playlist.add(stream_url,listitem) xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO) xbmcPlayer.play(playlist) #xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem) #src="(.*?(dailymotion).*?)" elif linkType.upper()=="EBOUND" or (linkType=="" and defaultLinkType=="4"): line1 = "Playing Ebound Link" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) print "Eboundlink" playURL= match =re.findall(' src=".*?ebound\\.tv.*?site=(.*?)&.*?date=(.*?)\\&', link) if len(playURL)==0: line1 = "EBound link not found" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) ShowAllSources(url,link) return playURL=match[0] dt=playURL[1] clip=playURL[0] urli='http://www.eboundservices.com/iframe/new/vod_ugc.php?stream=mp4:vod/%s/%s&width=620&height=350&clip=%s&day=%s&month=undefined'%(dt,clip,clip,dt) #req = urllib2.Request(urli) #req.add_header('User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10') #response = urllib2.urlopen(req) #link=response.read() #response.close() post = {'username':'******'} post = urllib.urlencode(post) req = urllib2.Request('http://eboundservices.com/flashplayerhash/index.php') req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36') response = urllib2.urlopen(req,post) link=response.read() response.close() strval =link;# match[0] stream_url='rtmp://cdn.ebound.tv/vod playpath=mp4:vod/%s/%s app=vod?wmsAuthSign=%s swfurl=http://www.eboundservices.com/live/v6/player.swf?domain=www.zemtv.com&channel=%s&country=EU pageUrl=%s tcUrl=rtmp://cdn.ebound.tv/vod?wmsAuthSign=%s live=true timeout=15' % (dt,clip,strval,clip,urli,strval) print stream_url playlist = xbmc.PlayList(1) playlist.clear() listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png") listitem.setInfo("Video", {"Title":name}) listitem.setProperty('mimetype', 'video/x-msvideo') listitem.setProperty('IsPlayable', 'true') playlist.add(stream_url,listitem) xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO) xbmcPlayer.play(playlist) elif linkType.upper()=="LINK" or (linkType=="" and defaultLinkType=="2"): line1 = "Playing Tune.pk Link" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) print "PlayLINK" playURL= match =re.findall('src="(.*?(tune\.pk).*?)"', link) if len(playURL)==0: line1 = "Link.pk link not found" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) ShowAllSources(url,link) return playURL=match[0][0] print playURL playlist = xbmc.PlayList(1) playlist.clear() listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png") listitem.setInfo("Video", {"Title":name}) listitem.setProperty('mimetype', 'video/x-msvideo') listitem.setProperty('IsPlayable', 'true') stream_url = urlresolver.HostedMediaFile(playURL).resolve() print stream_url playlist.add(stream_url,listitem) xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO) xbmcPlayer.play(playlist) elif linkType.upper()=="PLAYWIRE" or (linkType=="" and defaultLinkType=="3"): line1 = "Playing Playwire Link" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) print "Playwire" playURL =re.findall('src=".*?(playwire).*?data-publisher-id="(.*?)"\s*data-video-id="(.*?)"', link) V=1 if len(playURL)==0: playURL =re.findall('data-config="(.*?config.playwire.com.*?)"', link) V=2 if len(playURL)==0: line1 = "Playwire link not found" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) ShowAllSources(url,link) return if V==1: (playWireVar,PubId,videoID)=playURL[0] cdnUrl="http://cdn.playwire.com/v2/%s/config/%s.json"%(PubId,videoID) req = urllib2.Request(cdnUrl) req.add_header('User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10') response = urllib2.urlopen(req) link=response.read() response.close() playURL ="http://cdn.playwire.com/%s/%s"%(PubId,re.findall('src":".*?mp4:(.*?)"', link)[0]) print 'playURL',playURL else: playURL=playURL[0] reg='media":\{"(.*?)":"(.*?)"' req = urllib2.Request(playURL) req.add_header('User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10') response = urllib2.urlopen(req) link=response.read() playURL =re.findall(reg, link) if len(playURL)>0: playURL=playURL[0] ty=playURL[0] innerUrl=playURL[1] print innerUrl req = urllib2.Request(innerUrl) req.add_header('User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10') response = urllib2.urlopen(req) link=response.read() reg='baseURL>(.*?)<\/baseURL>\s*?<media url="(.*?)"' playURL =re.findall(reg, link)[0] playURL=playURL[0]+'/'+playURL[1] playlist = xbmc.PlayList(1) playlist.clear() listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png") listitem.setInfo("Video", {"Title":name}) listitem.setProperty('mimetype', 'video/x-msvideo') listitem.setProperty('IsPlayable', 'true') stream_url = playURL#urlresolver.HostedMediaFile(playURL).resolve() print 'stream_url',stream_url playlist.add(stream_url,listitem) xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO) xbmcPlayer.play(playlist) #bmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)#src="(.*?(tune\.pk).*?)" else: #either its default or nothing selected line1 = "Playing Youtube Link" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) youtubecode= match =re.findall('<strong>Youtube<\/strong>.*?src=\".*?embed\/(.*?)\?.*\".*?<\/iframe>', link,re.DOTALL| re.IGNORECASE) if len(youtubecode)==0: line1 = "Youtube link not found" xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) ShowAllSources(url,link) return youtubecode=youtubecode[0] uurl = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s' % youtubecode # print uurl xbmc.executebuiltin("xbmc.PlayMedia("+uurl+")") return
def checkHoster(self, sHosterUrl): #securitee if (not sHosterUrl): return False #Petit nettoyage sHosterUrl = sHosterUrl.split('|')[0] #Recuperation du host try: sHostName = sHosterUrl.split('/')[2] except: sHostName = sHosterUrl #L'user a active l'url resolver ? if self.ADDON.getSetting('UserUrlResolver') == 'true': import urlresolver hmf = urlresolver.HostedMediaFile(url=sHosterUrl) if hmf.valid_url(): tmp = self.getHoster('resolver') RH = sHosterUrl.split('/')[2] RH = RH.replace('www.', '') tmp.setRealHost(RH[:3].upper()) return tmp #Gestion classique if ('livestream' in sHostName): return self.getHoster('lien_direct') if ('gounlimited' in sHostName): return self.getHoster('gounlimited') if ('xdrive' in sHostName): return self.getHoster('xdrive') if ('facebook' in sHostName): return self.getHoster('facebook') if ('cloudcartel' in sHostName): return self.getHoster('cloudcartel') if (('raptu.com' in sHostName) or ('rapidvideo' in sHostName)): return self.getHoster('raptu') if ('mixloads' in sHostName): return self.getHoster('mixloads') if ('vidoza.' in sHostName): return self.getHoster('vidoza') if (('youtube' in sHostName) or ('youtu.be' in sHostName)): return self.getHoster('youtube') if ('rutube' in sHostName): return self.getHoster('rutube') if ('vk.com' in sHostName): return self.getHoster('vk') if ('vkontakte' in sHostName): return self.getHoster('vk') if ('vkcom' in sHostName): return self.getHoster('vk') if ('megawatch' in sHostName): return self.getHoster('megawatch') if ('vidto.me' in sHostName): return self.getHoster('vidto') if ('vidtodo.' in sHostName): return self.getHoster('vidtodo') if ('vidstodo.' in sHostName): return self.getHoster('vidtodo') if ('vidzi' in sHostName): return self.getHoster('vidzi') if ('vcstream' in sHostName): return self.getHoster('vidcloud') if ('filetrip' in sHostName): return self.getHoster('filetrip') if ('uptostream' in sHostName): return self.getHoster('uptostream') if (('dailymotion' in sHostName) or ('dai.ly' in sHostName)): if 'stream' in sHosterUrl: return self.getHoster('lien_direct') else: return self.getHoster('dailymotion') if ('filez.' in sHostName): return self.getHoster('flashx') if ('mystream' in sHostName) or ('mstream' in sHostName): return self.getHoster('mystream') if ('streamingentiercom/videophp?type=speed' in sHosterUrl): return self.getHoster('speedvideo') if ('speedvideo' in sHostName): return self.getHoster('speedvideo') if ('speedvid' in sHostName): return self.getHoster('speedvid') if (('netu' in sHostName) or ('hqq' in sHostName)): return self.getHoster('netu') if ('waaw' in sHostName): return self.getHoster('netu') if ('mail.ru' in sHostName): return self.getHoster('mailru') if ('onevideo' in sHostName): return self.getHoster('onevideo') if ('googlevideo' in sHostName): return self.getHoster('googlevideo') if ('picasaweb' in sHostName): return self.getHoster('googlevideo') if ('googleusercontent' in sHostName): return self.getHoster('googlevideo') if ('playreplay' in sHostName): return self.getHoster('playreplay') if ('flashx' in sHostName): return self.getHoster('flashx') if (('ok.ru' in sHostName) or ('odnoklassniki' in sHostName)): return self.getHoster('ok_ru') if ('vimeo.com' in sHostName): return self.getHoster('vimeo') if ('openload' in sHostName): return self.getHoster('openload') if ('oload.' in sHostName): return self.getHoster('openload') if ('oladblock.' in sHostName): return self.getHoster('openload') if (('thevideo.' in sHostName) or ('video.tt' in sHostName) or ('vev.io' in sHostName)): return self.getHoster('thevideo_me') if ('uqload.' in sHostName): return self.getHoster('uqload') if ('letwatch' in sHostName): return self.getHoster('letwatch') if ('www.amazon' in sHostName): return self.getHoster('amazon') if ('filepup' in sHostName): return self.getHoster('filepup') if ('vimple.ru' in sHostName): return self.getHoster('vimple') if ('wstream.' in sHostName): return self.getHoster('wstream') if ('watchvideo' in sHostName): return self.getHoster('watchvideo') if ('drive.google.com' in sHostName): return self.getHoster('googledrive') if ('docs.google.com' in sHostName): return self.getHoster('googledrive') if ('vidwatch' in sHostName): return self.getHoster('vidwatch') if ('up2stream' in sHostName): return self.getHoster('up2stream') if ('stream.moe' in sHostName): return self.getHoster('streammoe') if ('tune' in sHostName): return self.getHoster('tune') if ('sendvid' in sHostName): return self.getHoster('sendvid') if ('vidup' in sHostName): return self.getHoster('vidup') if ('vidbull' in sHostName): return self.getHoster('vidbull') if ('vidlox' in sHostName): return self.getHoster('vidlox') if ('stagevu' in sHostName): return self.getHoster('stagevu') if (('movshare' in sHostName) or ('wholecloud' in sHostName)): return self.getHoster('wholecloud') if ('gorillavid' in sHostName): return self.getHoster('gorillavid') if ('daclips' in sHostName): return self.getHoster('daclips') if ('estream' in sHostName) and not ('widestream' in sHostName): return self.getHoster('estream') if ('hdvid' in sHostName): return self.getHoster('hdvid') if ('streamango' in sHostName): return self.getHoster('streamango') if ('streamcherry' in sHostName): return self.getHoster('streamango') if ('vshare' in sHostName): return self.getHoster('vshare') if ('giga' in sHostName): return self.getHoster('giga') if ('vidbom' in sHostName): return self.getHoster('vidbom') if ('upvid.' in sHostName): return self.getHoster('upvid') if (('cloudvid' in sHostName) or ('clipwatching.' in sHostName)): #meme code return self.getHoster('cloudvid') if ('megadrive' in sHostName): return self.getHoster('megadrive') if ('downace' in sHostName): return self.getHoster('downace') if ('clickopen' in sHostName): return self.getHoster('clickopen') if ('iframe-secured' in sHostName): return self.getHoster('iframe_secured') if ('iframe-secure' in sHostName): return self.getHoster('iframe_secure') if ('goo.gl' in sHostName or 'bit.ly' in sHostName or 'streamcrypt.net' in sHostName or 'opsktp.com' in sHosterUrl): return self.getHoster('allow_redirects') if ('jawcloud' in sHostName): return self.getHoster('jawcloud') if ('kvid' in sHostName): return self.getHoster('kvid') if ('soundcloud' in sHostName): return self.getHoster('soundcloud') if ('mixcloud' in sHostName): return self.getHoster('mixcloud') if ('ddlfr' in sHostName): return self.getHoster('ddlfr') if ('pdj' in sHostName): return self.getHoster('pdj') if ('vidzstore' in sHostName): return self.getHoster('vidzstore') if ('hd-stream' in sHostName): return self.getHoster('hd_stream') if ('rapidstream' in sHostName): return self.getHoster('rapidstream') if ('beeload' in sHostName): return self.getHoster('beeload') if ('verystream.' in sHostName): return self.getHoster('verystream') if ('archive.' in sHostName): return self.getHoster('archive') if ('freshstream' in sHostName): return self.getHoster('freshstream') if ('jetload' in sHostName): return self.getHoster('jetload') #Lien telechargeable a convertir en stream if ('1fichier' in sHostName): return self.getHoster('onefichier') if ('uptobox' in sHostName): return self.getHoster('uptobox') if ('uplea.com' in sHostName): return self.getHoster('uplea') if ('uploaded' in sHostName or 'ul.to' in sHostName): return self.getHoster('uploaded') if ('kaydo.ws' in sHostName): return self.getHoster('lien_direct') if ('fembed' in sHostName): return self.getHoster('lien_direct') #Si aucun hebergeur connu on teste les liens directs if (sHosterUrl[-4:] in '.mp4.avi.flv.m3u8.webm'): return self.getHoster('lien_direct') #Cas special si parametre apres le lien_direct if (sHosterUrl.split('?')[0][-4:] in '.mp4.avi.flv.m3u8.webm'): return self.getHoster('lien_direct') return False
def checkHoster(self, sHosterUrl, debrid=True): # securite if not sHosterUrl: return False # Petit nettoyage sHosterUrl = sHosterUrl.split('|')[0] sHosterUrl = sHosterUrl.lower() # Recuperation du host try: sHostName = sHosterUrl.split('/')[2] except: sHostName = sHosterUrl if debrid: # L'user a active l'url resolver ? if self.ADDON.getSetting('UserUrlResolver') == 'true': import urlresolver hmf = urlresolver.HostedMediaFile(url=sHosterUrl) if hmf.valid_url(): tmp = self.getHoster('resolver') RH = sHosterUrl.split('/')[2] RH = RH.replace('www.', '') tmp.setRealHost(RH.split('.')[0].upper()) return tmp # L'user a activé alldebrid ? if self.ADDON.getSetting('hoster_alldebrid_premium') == 'true': return self.getHoster('alldebrid') # L'user a activé debrid_link ? if self.ADDON.getSetting('hoster_debridlink_premium') == 'true': if "debrid.link" not in sHosterUrl: return self.getHoster('debrid_link') else: return self.getHoster("lien_direct") # Gestion classique if ('streamz' in sHostName): return self.getHoster('streamz') if ('streamax' in sHostName): return self.getHoster('streamax') if ('gounlimited' in sHostName): return self.getHoster('gounlimited') if ('xdrive' in sHostName): return self.getHoster('xdrive') if ('facebook' in sHostName): return self.getHoster('facebook') if ('mixdrop' in sHostName): return self.getHoster('mixdrop') if ('mixloads' in sHostName): return self.getHoster('mixloads') if ('vidoza' in sHostName): return self.getHoster('vidoza') if ('youtube' in sHostName) or ('youtu.be' in sHostName): return self.getHoster('youtube') if ('rutube' in sHostName): return self.getHoster('rutube') if ('vk.com' in sHostName): return self.getHoster('vk') if ('vkontakte' in sHostName): return self.getHoster('vk') if ('vkcom' in sHostName): return self.getHoster('vk') if ('megawatch' in sHostName): return self.getHoster('megawatch') if ('playvidto' in sHostName): return self.getHoster('vidto') # vidtodo et clone if ('vidtodo' in sHostName) or ('vixtodo' in sHostName): return self.getHoster('vidtodo') if ('viddoto' in sHostName): return self.getHoster('vidtodo') if ('vidstodo' in sHostName): return self.getHoster('vidtodo') if ('vidzi' in sHostName): return self.getHoster('vidzi') if ('vcstream' in sHostName): return self.getHoster('vidcloud') if ('filetrip' in sHostName): return self.getHoster('filetrip') if ('uptostream' in sHostName): return self.getHoster('uptostream') if ('dailymotion' in sHostName) or ('dai.ly' in sHostName): try: if 'stream' in sHosterUrl: return self.getHoster('lien_direct') except: pass else: return self.getHoster('dailymotion') if ('livestream' in sHostName): return self.getHoster('lien_direct') if ('flashx' in sHostName): return self.getHoster('flashx') if ('filez' in sHostName): return self.getHoster('flashx') if ('mystream' in sHostName) or ('mstream' in sHostName): return self.getHoster('mystream') if ('streamingentiercom/videophp?type=speed' in sHosterUrl): return self.getHoster('speedvideo') if ('speedvideo' in sHostName): return self.getHoster('speedvideo') if ('speedvid' in sHostName): return self.getHoster('speedvid') #if ('netu' in sHostName) or ('hqq' in sHostName) or ('waaw' in sHostName) or ('vizplay' in sHostName): # return self.getHoster('netu') if ('upstream' in sHostName): return self.getHoster('upstream') if ('mail.ru' in sHostName): return self.getHoster('mailru') if ('onevideo' in sHostName): return self.getHoster('onevideo') if ('googlevideo' in sHostName): return self.getHoster('googlevideo') if ('picasaweb' in sHostName): return self.getHoster('googlevideo') if ('googleusercontent' in sHostName): return self.getHoster('googlevideo') if ('playreplay' in sHostName): return self.getHoster('playreplay') if ('ok.ru' in sHostName) or ('odnoklassniki' in sHostName): return self.getHoster('ok_ru') if ('vimeo' in sHostName): return self.getHoster('vimeo') if ('prostream' in sHostName): return self.getHoster('prostream') if ('vidfast' in sHostName): return self.getHoster('vidfast') if ('thevideo' in sHostName) or ('video.tt' in sHostName) or ('vev.io' in sHostName): return self.getHoster('thevideo_me') if ('uqload' in sHostName): return self.getHoster('uqload') if ('letwatch' in sHostName): return self.getHoster('letwatch') if ('letsupload' in sHostName): return self.getHoster('letsupload') if ('filepup' in sHostName): return self.getHoster('filepup') if ('vimple.ru' in sHostName): return self.getHoster('vimple') if ('wstream' in sHostName): return self.getHoster('wstream') if ('watchvideo' in sHostName): return self.getHoster('watchvideo') if ('drive.google.com' in sHostName): return self.getHoster('googledrive') if ('docs.google.com' in sHostName): return self.getHoster('googledrive') if ('vidwatch' in sHostName): return self.getHoster('vidwatch') if ('up2stream' in sHostName): return self.getHoster('up2stream') if ('vidbm' in sHostName): return self.getHoster('vidbm') if ('tune' in sHostName): return self.getHoster('tune') if ('vidup' in sHostName): return self.getHoster('vidup') if ('vidbull' in sHostName): return self.getHoster('vidbull') # vidlox et clone if ('vidlox' in sHostName): return self.getHoster('vidlox') if ('videobin' in sHostName): return self.getHoster('videobin') if ('stagevu' in sHostName): return self.getHoster('stagevu') if ('movshare' in sHostName) or ('wholecloud' in sHostName): return self.getHoster('wholecloud') if ('gorillavid' in sHostName): return self.getHoster('gorillavid') if ('daclips' in sHostName): return self.getHoster('daclips') if ('estream' in sHostName) and not ('widestream' in sHostName): return self.getHoster('estream') if ('hdvid' in sHostName): return self.getHoster('hdvid') if ('vshare' in sHostName): return self.getHoster('vshare') if ('giga' in sHostName): return self.getHoster('giga') if ('vidbom' in sHostName): return self.getHoster('vidbom') if ('upvid' in sHostName): return self.getHoster('upvid') if ('cloudvid' in sHostName): return self.getHoster('cloudvid') if ('clipwatching' in sHostName) or ('highstream' in sHostName): return self.getHoster('clipwatching') if ('megadrive' in sHostName): return self.getHoster('megadrive') if ('downace' in sHostName): return self.getHoster('downace') if ('clickopen' in sHostName): return self.getHoster('clickopen') if ('iframe-secured' in sHostName): return self.getHoster('iframe_secured') if ('iframe-secure' in sHostName): return self.getHoster('iframe_secure') if ('goo.gl' in sHostName) or ('bit.ly' in sHostName) or ( 'streamcrypt' in sHostName) or ('opsktp' in sHosterUrl): return self.getHoster('allow_redirects') if ('jawcloud' in sHostName): return self.getHoster('jawcloud') if ('kvid' in sHostName): return self.getHoster('kvid') if ('soundcloud' in sHostName): return self.getHoster('soundcloud') if ('mixcloud' in sHostName): return self.getHoster('mixcloud') if ('ddlfr' in sHostName): return self.getHoster('ddlfr') if ('pdj' in sHostName): return self.getHoster('pdj') if ('vidzstore' in sHostName): return self.getHoster('vidzstore') if ('hd-stream' in sHostName): return self.getHoster('hd_stream') if ('rapidstream' in sHostName): return self.getHoster('rapidstream') if ('archive' in sHostName): return self.getHoster('archive') if ('jetload' in sHostName): return self.getHoster('jetload') if ('dustreaming' in sHostName): return self.getHoster('dustreaming') # frenchvid et clone if ('french-vid' in sHostName) or ('yggseries' in sHostName): return self.getHoster('frenchvid') if ('fembed' in sHostName) or ('fem.tohds' in sHostName): return self.getHoster('frenchvid') if ('feurl' in sHostName) or ('fsimg' in sHostName): return self.getHoster('frenchvid') if ('core1player' in sHostName) or ('vfsplayer' in sHostName): return self.getHoster('frenchvid') if ('gotochus' in sHostName): return self.getHoster('frenchvid') if ('viki' in sHostName): return self.getHoster('viki') if ('flix555' in sHostName): return self.getHoster('flix555') if ('onlystream' in sHostName): return self.getHoster('onlystream') if ('pstream' in sHostName): return self.getHoster('pstream') if ('vudeo' in sHostName): return self.getHoster('vudeo') if ('sendvid' in sHostName): return self.getHoster('sendvid') if ('supervideo' in sHostName): return self.getHoster('supervideo') if ('dood' in sHostName): return self.getHoster('dood') if ('vidia' in sHostName): return self.getHoster('vidia') if ('streamtape' in sHostName): return self.getHoster('streamtape') if ('femax' in sHostName): return self.getHoster('femax') if ('vidbem' in sHostName): return self.getHoster('vidbem') if ('sibnet' in sHostName): return self.getHoster('sibnet') if ('vidplayer' in sHostName): return self.getHoster('vidplayer') if ('userload' in sHostName): return self.getHoster('userload') if ('aparat' in sHostName): return self.getHoster('aparat') if ('evoload' in sHostName): return self.getHoster('evoload') if ('vidshar' in sHostName): return self.getHoster('vidshar') if ('abcvideo' in sHostName): return self.getHoster('abcvideo') if ('plynow' in sHostName): return self.getHoster('plynow') if ('myvi.tv' in sHostName): return self.getHoster('myvitv') if ('playtube' in sHostName): return self.getHoster('playtube') if ('dwfull' in sHostName): return self.getHoster('dwfull') if ('directmoviedl' in sHostName) or ('moviesroot' in sHostName): return self.getHoster('directmoviedl') # Lien telechargeable a convertir en stream if ('1fichier' in sHostName): return self.getHoster('onefichier') if ('uptobox' in sHostName): return self.getHoster('uptobox') if ('uplea' in sHostName): return self.getHoster('uplea') if ('uploaded' in sHostName) or ('ul.to' in sHostName): if ('/file/forbidden' in sHosterUrl): return False return self.getHoster('uploaded') if ('vidload' in sHostName): return self.getHoster('vidload') if ('kaydo' in sHostName): return self.getHoster('lien_direct') if ('cloudhost' in sHostName): return self.getHoster('cloudhost') if ('rapidgator' in sHostName): return False if ('turbobit' in sHostName): return False if ('mega.nz' in sHostName) or ('mega.co.nz' in sHostName): return False if ('hitfile' in sHostName): return False if ('myfiles.alldebrid.com' in sHostName): return self.getHoster('lien_direct') if ('dl.free.fr' in sHostName): return False if ('easyload' in sHostName): return self.getHoster('easyload') if ('ninjastream' in sHostName): return self.getHoster('ninjastream') # Si aucun hebergeur connu on teste les liens directs if (sHosterUrl[-4:] in '.mp4.avi.flv.m3u8.webm.mkv'): return self.getHoster('lien_direct') # Cas special si parametre apres le lien_direct if (sHosterUrl.split('?')[0][-4:] in '.mp4.avi.flv.m3u8.webm.mkv'): return self.getHoster('lien_direct') return False
def VIDEOLINKSEXTRA(mname, murl, thumb, desc): main.GA("Watching Now", "Watched") xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Collecting hosts,5000)") sources = [] link = main.OPENURL(murl) ok = True infoLabels = main.GETMETAT(mname, '', '', thumb) video_type = 'movie' season = '' episode = '' img = infoLabels['cover_url'] fanart = infoLabels['backdrop_url'] imdb_id = infoLabels['imdb_id'] infolabels = { 'supports_meta': 'true', 'video_type': video_type, 'name': str(infoLabels['title']), 'imdb_id': str(infoLabels['imdb_id']), 'season': str(season), 'episode': str(episode), 'year': str(infoLabels['year']) } match = re.compile('<strong><a href="(.+?)" target=".+?">(.+?)</a>', re.DOTALL).findall(link) import urlresolver for url, host in match: link2 = getlink(murl, url) xurl = re.findall('var click_url = "(.+?)";', link2)[0] hosted_media = urlresolver.HostedMediaFile(url=xurl, title=host) sources.append(hosted_media) if (len(sources) == 0): xbmc.executebuiltin( "XBMC.Notification(Sorry!,Show doesn't have playable links,5000)") else: source = urlresolver.choose_source(sources) try: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = main.resolve_url(source.get_url()) if (stream_url == False): return infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'] } # play with bookmark from resources.universal import playbackengine player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']), season=str(season), episode=str(episode), year=str(infoLabels['year']), img=img, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id=imdb_id) #WatchHistory if selfAddon.getSetting("whistory") == "true": from resources.universal import watchhistory wh = watchhistory.WatchHistory(addon_id) wh.add_item(mname + ' ' + '[COLOR green]Watching Now[/COLOR]', sys.argv[0] + sys.argv[2], infolabels=infolabels, img=img, fanart='', is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def checkHoster(self, sHosterUrl): #securitee if (not sHosterUrl): return False #Petit nettoyage sHosterUrl = sHosterUrl.split('|')[0] #Recuperation du host try: sHostName = sHosterUrl.split('/')[2] except: sHostName = sHosterUrl #L'user a active l'url resolver ? if cConfig().getSetting('UserUrlResolver') == 'true': import urlresolver hmf = urlresolver.HostedMediaFile(url=sHosterUrl) if hmf.valid_url(): tmp = cHosterHandler().getHoster('resolver') RH = sHosterUrl.split('/')[2] RH = RH.replace('www.', '') tmp.setRealHost(RH[:3].upper()) return tmp #Gestion classique if (('novamov' in sHostName) or ('auroravid' in sHostName)): return cHosterHandler().getHoster('novamov') if (('divxstage' in sHostName) or ('cloudtime' in sHostName)): return cHosterHandler().getHoster('divxstage') if ('raptu.com' in sHostName): return cHosterHandler().getHoster('raptu') if ('watchers.to' in sHostName): return cHosterHandler().getHoster('watchers') if (('videoweed' in sHostName) or ('bitvid' in sHostName)): return cHosterHandler().getHoster('videoweed') if ('youwatch' in sHostName): return cHosterHandler().getHoster('youwatch') #if ('turbovid' in sHostName): # return cHosterHandler().getHoster('turbovid') if (('youtube' in sHostName) or ('youtu.be' in sHostName)): return cHosterHandler().getHoster('youtube') if ('rutube' in sHostName): return cHosterHandler().getHoster('rutube') if ('exashare' in sHostName): return cHosterHandler().getHoster('exashare') if ('nowvideo' in sHostName): return cHosterHandler().getHoster('nowvideo') if ('vk.com' in sHostName): return cHosterHandler().getHoster('vk') if ('vkontakte' in sHostName): return cHosterHandler().getHoster('vk') if ('vkcom' in sHostName): return cHosterHandler().getHoster('vk') if ('megawatch' in sHostName): return cHosterHandler().getHoster('megawatch') if ('vidto' in sHostName): return cHosterHandler().getHoster('vidto') if ('vidzi' in sHostName): return cHosterHandler().getHoster('vidzi') if ('cloudy' in sHostName): return cHosterHandler().getHoster('cloudy') if ('filetrip' in sHostName): return cHosterHandler().getHoster('filetrip') if ('uptostream' in sHostName): return cHosterHandler().getHoster('uptostream') if (('dailymotion' in sHostName) or (('dai.ly' in sHostName))): return cHosterHandler().getHoster('dailymotion') if ('filez.' in sHostName): return cHosterHandler().getHoster('filez') if ('vodlocker' in sHostName): return cHosterHandler().getHoster('vodlocker') if ('mystream' in sHostName): return cHosterHandler().getHoster('mystream') if ('streamingentiercom/videophp?type=speed' in sHosterUrl): return cHosterHandler().getHoster('speedvideo') if ('speedvideo' in sHostName): return cHosterHandler().getHoster('speedvideo') if ('speedvid' in sHostName): return cHosterHandler().getHoster('speedvid') #if ('axavid' in sHostName): # return cHosterHandler().getHoster('axavid') if (('netu' in sHostName) or ('hqq' in sHostName)): return cHosterHandler().getHoster('netu') if ('waaw' in sHostName): return cHosterHandler().getHoster('netu') if ('mail.ru' in sHostName): return cHosterHandler().getHoster('mailru') if ('videoraj' in sHostName): return cHosterHandler().getHoster('videoraj') if ('videohut' in sHostName): return cHosterHandler().getHoster('videohut') if ('onevideo' in sHostName): return cHosterHandler().getHoster('onevideo') if ('googlevideo' in sHostName): return cHosterHandler().getHoster('googlevideo') if ('picasaweb' in sHostName): return cHosterHandler().getHoster('googlevideo') if ('googleusercontent' in sHostName): return cHosterHandler().getHoster('googlevideo') if ('video.tt' in sHostName): return cHosterHandler().getHoster('videott') if ('playreplay' in sHostName): return cHosterHandler().getHoster('playreplay') if ('streamin.to' in sHostName): return cHosterHandler().getHoster('streaminto') if ('vodlocker' in sHostName): return cHosterHandler().getHoster('vodlocker') if ('flashx' in sHostName): return cHosterHandler().getHoster('flashx') if ('easywatch' in sHostName): return cHosterHandler().getHoster('easywatch') if (('ok.ru' in sHostName) or ('odnoklassniki' in sHostName)): return cHosterHandler().getHoster('ok_ru') if ('vimeo.com' in sHostName): return cHosterHandler().getHoster('vimeo') if ('openload' in sHostName): return cHosterHandler().getHoster('openload') if ('oload.co' in sHostName): return cHosterHandler().getHoster('openload') if ('thevideo.me' in sHostName): return cHosterHandler().getHoster('thevideo_me') if ('vid.me' in sHostName): return cHosterHandler().getHoster('vidme') if ('zstream' in sHostName): return cHosterHandler().getHoster('zstream') if ('watching' in sHostName): return cHosterHandler().getHoster('watching') if ('letwatch' in sHostName): return cHosterHandler().getHoster('letwatch') if ('easyvid' in sHostName): return cHosterHandler().getHoster('easyvid') if (('allvid' in sHostName) or ('coo5shaine' in sHostName)): return cHosterHandler().getHoster('allvid') if ('www.amazon' in sHostName): return cHosterHandler().getHoster('amazon') if ('filepup' in sHostName): return cHosterHandler().getHoster('filepup') #if ('v-vids' in sHostName): # return cHosterHandler().getHoster('v_vids') if ('vid.ag' in sHostName): return cHosterHandler().getHoster('vid_ag') #if ('wat.tv' in sHostName): # return cHosterHandler().getHoster('wat_tv') if ('thevid' in sHostName): return cHosterHandler().getHoster('thevid') if ('nosvideo' in sHostName): return cHosterHandler().getHoster('nosvideo') if ('vimple.ru' in sHostName): return cHosterHandler().getHoster('vimple') if ('allmyvideos.net' in sHostName): return cHosterHandler().getHoster('allmyvideos') if ('idowatch' in sHostName): return cHosterHandler().getHoster('idowatch') if ('wstream.' in sHostName): return cHosterHandler().getHoster('wstream') #if ('veevr.' in sHostName): # return cHosterHandler().getHoster('veevr') if ('watchvideo.' in sHostName): return cHosterHandler().getHoster('watchvideo') if ('drive.google.com' in sHostName): return cHosterHandler().getHoster('googledrive') if ('docs.google.com' in sHostName): return cHosterHandler().getHoster('googledrive') if ('vidwatch' in sHostName): return cHosterHandler().getHoster('vidwatch') if ('up2stream' in sHostName): return cHosterHandler().getHoster('up2stream') if ('stream.moe' in sHostName): return cHosterHandler().getHoster('streammoe') if ('tune' in sHostName): return cHosterHandler().getHoster('tune') if ('sendvid' in sHostName): return cHosterHandler().getHoster('sendvid') if ('vidup' in sHostName): return cHosterHandler().getHoster('vidup') if ('vidbull' in sHostName): return cHosterHandler().getHoster('vidbull') if ('vidlox' in sHostName): return cHosterHandler().getHoster('vidlox') if ('stagevu' in sHostName): return cHosterHandler().getHoster('stagevu') if ('veehd.' in sHostName): return cHosterHandler().getHoster('veehd') if (('movshare' in sHostName) or ('wholecloud' in sHostName)): return cHosterHandler().getHoster('wholecloud') if ('gorillavid' in sHostName): return cHosterHandler().getHoster('gorillavid') if ('daclips' in sHostName): return cHosterHandler().getHoster('daclips') if ('kvid' in sHostName): return cHosterHandler().getHoster('kvid') if ('estream' in sHostName): return cHosterHandler().getHoster('estream') #Lien telechargeable a convertir en stream if ('1fichier' in sHostName): return cHosterHandler().getHoster('onefichier') if ('uptobox' in sHostName): return cHosterHandler().getHoster('uptobox') if ('uplea.com' in sHostName): return cHosterHandler().getHoster('uplea') if ('uploaded' in sHostName or 'ul.to' in sHostName): return cHosterHandler().getHoster('uploaded') if ('kaydo.ws' in sHostName): return cHosterHandler().getHoster('lien_direct') #Si aucun hebergeur connu on teste les liens directs if (sHosterUrl[-4:] in '.mp4.avi.flv.m3u8'): return cHosterHandler().getHoster('lien_direct') return False
def CHANNELCLink(mname, murl): main.GA("CC/Tv4", "Watched") sources = [] xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Collecting hosts,3000)") link = main.OPENURL(murl) ok = True playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() site = re.findall('channelcut', murl) if len(site) > 0: match = re.compile('<a href="([^"]*)" rel="nofollow">.+?</a>').findall( link) else: match = re.compile('<td><a href="(.+?)" target="').findall(link) for url in match: match2 = re.compile('http://(.+?)/.+?').findall(url) for host in match2: host = host.replace('www.', '') hosted_media = urlresolver.HostedMediaFile(url=url, title=host) sources.append(hosted_media) if (len(sources) == 0): xbmc.executebuiltin( "XBMC.Notification(Sorry!,Show doesn't have playable links,5000)") else: source = urlresolver.choose_source(sources) try: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = main.resolve_url(source.get_url()) if (stream_url == False): return infoLabels = main.GETMETAEpiT(mname, '', '') video_type = 'episode' season = infoLabels['season'] episode = infoLabels['episode'] img = infoLabels['cover_url'] fanart = infoLabels['backdrop_url'] imdb_id = infoLabels['imdb_id'] infolabels = { 'supports_meta': 'true', 'video_type': video_type, 'name': str(infoLabels['title']), 'imdb_id': str(infoLabels['imdb_id']), 'season': str(season), 'episode': str(episode), 'year': str(infoLabels['year']) } infoL = { 'Title': infoLabels['title'], 'Plot': infoLabels['plot'], 'Genre': infoLabels['genre'] } # play with bookmark player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type=video_type, title=str(infoLabels['title']), season=str(season), episode=str(episode), year=str(infoLabels['year']), img=img, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id=imdb_id) #WatchHistory if selfAddon.getSetting("whistory") == "true": wh.add_item(mname + ' ' + '[COLOR green]CC/Tv4[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=img, fanart='', is_folder=False) player.KeepAlive() return ok except Exception, e: if stream_url != False: main.ErrorReport(e) return ok
def PLAY_URL(name, url, iconimage): name, url = url.split('|SPLIT|') dp = common.GET_LUCKY() choice = dialog.select( "[COLOR red]Please select an option[/COLOR]", ['[COLOR pink]Source 1[/COLOR]', '[COLOR pink]Source 2[/COLOR]']) if choice == 0: url = url elif choice == 1: url = url + '2/' else: quit() ref_url = url urlresolve = 0 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36' } holdingpage = net.http_GET(url, headers).content if "openload" in holdingpage: match = re.compile('src="https://openload.co/(.+?)"').findall( holdingpage)[0] url = "https://openload.co/" + match import urlresolver if urlresolver.HostedMediaFile(url).valid_url(): urlresolve = 1 else: net.save_cookies(TEMP_COOKIES) try: match = re.compile('src="http://www.porn00.org/king/(.+?)"' ).findall(holdingpage)[0] id = 'king' except: try: match = re.compile('http://www.porn00.org/server/(.+?)"' ).findall(holdingpage)[0] id = 'server' except: try: match = re.compile('http://www.porn00.org/play/(.+?)"' ).findall(holdingpage)[0] id = 'play' except: try: match = re.compile( 'http://www.porn00.org/player/(.+?)"').findall( holdingpage)[0] id = 'player' except: try: id, match = re.compile( 'http://www.porn00.org/(.+?)/(.+?)"').findall( holdingpage)[0] except: quit() url = 'http://www.porn00.org/' + id + '/' + match net.set_cookies(TEMP_COOKIES) linkpage = net.http_GET(url, headers).content links = re.compile('file\: "(.+?)",').findall(linkpage) try: url = links[-1] except: try: url = links[0] except: dialog.ok( AddonTitle, "There was an error playing this video. Please select another." ) quit() choice = dialog.select("[COLOR red]Please select an option[/COLOR]", [ '[COLOR pink]Watch Video[/COLOR]', '[COLOR pink]Add to Favourites[/COLOR]', '[COLOR pink]Download Video[/COLOR]' ]) if choice == 1: a = open(FAVOURITES_FILE).read() b = a.replace( '#START OF FILE#', '#START OF FILE#\n<item>\n<name>' + str(name) + '</name>\n<link>' + str(url) + '</link>\n<site>Porn00</site>\n<icon>' + str(iconimage) + '</icon>\n</item>\n') f = open(FAVOURITES_FILE, mode='w') f.write(str(b)) f.close() dp.close() dialog.ok( AddonTitle, "[COLOR pink]" + name + " has been added to your favourites. You can access your favourites on the main menu.[/COLOR]" ) quit() elif choice == 2: try: download_location = plugintools.get_setting("download_location") download_folder = xbmc.translatePath(download_location) _in = url name = name.replace(' ', '_').replace('[COLOR', '').replace( '[/COLOR', '').replace('[I]', '').replace(']', '').replace( '|', '').replace('%', '').replace('-', '').replace( '[/I', '').replace('[/B', '').replace('[', '').replace( '/', '').replace(':', '') _out = download_folder + name + '.mp4' dp.close() a = open(DOWNLOADS_FILE).read() b = a.replace( '#START OF FILE#', '#START OF FILE#\n<item>\n<name>' + str(_out) + '</name>\n<icon>' + str(iconimage) + '</icon>\n</item>\n') f = open(DOWNLOADS_FILE, mode='w') f.write(str(b)) f.close() downloader.download(_in, _out, dp=None) dialog.ok( AddonTitle, "[COLOR pink]Your video has been successfully downloaded and can be viewed from the Your Downloads section on the main menu.[/COLOR]" ) except: try: os.remove(_out) except: pass dp.close() dialog.ok( AddonTitle, "[COLOR pink]Sorry, there was an error trying to download the video.[/COLOR]" ) quit() elif choice == 0: history_on_off = plugintools.get_setting("history_setting") if history_on_off == "true": date_now = datetime.datetime.now().strftime("%d-%m-%Y") time_now = datetime.datetime.now().strftime("%H:%M") a = open(HISTORY_FILE).read() b = a.replace( '#START OF FILE#', '#START OF FILE#\n<item>\n<date>' + str(date_now) + '</date>\n<time>' + str(time_now) + '</time>\n<name>' + str(name) + '</name>\n<link>' + str(url) + '</link>\n<site>Porn00</site>\n<icon>' + str(iconimage) + '</icon>\n</item>\n') f = open(HISTORY_FILE, mode='w') f.write(str(b)) f.close() if urlresolve == 1: url = urlresolver.HostedMediaFile(url).resolve() else: url = url + '|User-Agent=Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.220203.207 Safari/537.36&Referer=' + ref_url liz = xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage) dp.close() xbmc.Player().play(url, liz, False) else: dp.close() quit()
def PlayVideo(url, listitem): print 'in PlayVideo %s' % url stream_url = urlresolver.HostedMediaFile(url).resolve() xbmc.Player().play(stream_url, listitem)
def get_url(scraper, title, show_year, year, season, episode, imdb, tvdb, type, cache_location, maximum_age, check_url=False, debrid=False): cache_enabled = xbmcaddon.Addon( 'script.module.nanscrapers').getSetting("cache_enabled") == 'true' try: dbcon = database.connect(cache_location) dbcur = dbcon.cursor() try: dbcur.execute("SELECT * FROM version") match = dbcur.fetchone() except: nanscrapers.clear_cache() dbcur.execute("CREATE TABLE version (" "version TEXT)") dbcur.execute("INSERT INTO version Values ('0.5.4')") dbcon.commit() dbcur.execute("CREATE TABLE IF NOT EXISTS rel_src (" "scraper TEXT, " "title Text, show_year TEXT, year TEXT, " "season TEXT, " "episode TEXT, " "imdb_id TEXT, " "urls TEXT, " "added TEXT, " "UNIQUE(scraper, title, year, season, episode)" ");") except: pass if cache_enabled: try: sources = [] dbcur.execute( "SELECT * FROM rel_src WHERE scraper = '%s' AND title = '%s' AND show_year= '%s' AND year = '%s' AND season = '%s' AND episode = '%s'" % (scraper.name, clean_title(title).upper(), show_year, year, season, episode)) match = dbcur.fetchone() t1 = int(re.sub('[^0-9]', '', str(match[8]))) t2 = int(datetime.datetime.now().strftime("%Y%m%d%H%M")) update = abs(t2 - t1) > maximum_age if update == False: sources = json.loads(match[7]) return sources except: pass try: sources = [] if type == "movie": sources = scraper.scrape_movie(title, year, imdb, debrid=debrid) elif type == "episode": sources = scraper.scrape_episode(title, show_year, year, season, episode, imdb, tvdb, debrid=debrid) if sources == None: sources = [] else: if cache_enabled: try: dbcur.execute( "DELETE FROM rel_src WHERE scraper = '%s' AND title = '%s' AND show_year= '%s' AND year = '%s' AND season = '%s' AND episode = '%s'" % (scraper.name, clean_title(title).upper(), show_year, year, season, episode)) dbcur.execute( "INSERT INTO rel_src Values (?, ?, ?, ?, ?, ?, ?, ?, ?)", (scraper.name, clean_title(title).upper(), show_year, year, season, episode, imdb, json.dumps(sources), datetime.datetime.now().strftime("%Y-%m-%d %H:%M") )) dbcon.commit() except: pass if check_url: noresolver = False try: import urlresolver except: try: import urlresolver9 as urlresolver except: noresolver = True new_sources = [] from common import check_playable for source in sources: if source["direct"]: check = check_playable(source["url"]) if check: new_sources.append(source) elif not noresolver: try: hmf = urlresolver.HostedMediaFile( url=source['url'], include_disabled=False, include_universal=False) if hmf.valid_url(): resolved_url = hmf.resolve() check = check_playable(resolved_url) if check: new_sources.append(source) except: pass else: new_sources.append(source) sources = new_sources return sources except: pass
def PlayShowLink(url): # url = tabURL.replace('%s',channelName); req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10' ) response = urllib2.urlopen(req) link = response.read() response.close() # print url line1 = "Playing DM Link" time = 5000 #in miliseconds defaultLinkType = 0 #0 youtube,1 DM,2 tunepk defaultLinkType = selfAddon.getSetting("DefaultVideoType") print defaultLinkType print "LT link is" + linkType # if linktype is not provided then use the defaultLinkType if linkType == "DM" or (linkType == "" and defaultLinkType == "1"): print "PlayDM" line1 = "Playing DM Link" xbmc.executebuiltin('Notification(%s, %s, %d, %s)' % (__addonname__, line1, time, __icon__)) # print link playURL = match = re.findall('src="(.*?(dailymotion).*?)"', link) playURL = match[0][0] print playURL playlist = xbmc.PlayList(1) playlist.clear() listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png") listitem.setInfo("Video", {"Title": name}) listitem.setProperty('mimetype', 'video/x-msvideo') listitem.setProperty('IsPlayable', 'true') stream_url = urlresolver.HostedMediaFile(playURL).resolve() print stream_url playlist.add(stream_url, listitem) xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO) xbmcPlayer.play(playlist) #xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem) #src="(.*?(dailymotion).*?)" elif linkType == "LINK" or (linkType == "" and defaultLinkType == "2"): line1 = "Playing Tune.pk Link" xbmc.executebuiltin('Notification(%s, %s, %d, %s)' % (__addonname__, line1, time, __icon__)) print "PlayLINK" playURL = match = re.findall('src="(.*?(tune\.pk).*?)"', link) playURL = match[0][0] print playURL playlist = xbmc.PlayList(1) playlist.clear() listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png") listitem.setInfo("Video", {"Title": name}) listitem.setProperty('mimetype', 'video/x-msvideo') listitem.setProperty('IsPlayable', 'true') stream_url = urlresolver.HostedMediaFile(playURL).resolve() print stream_url playlist.add(stream_url, listitem) xbmcPlayer = xbmc.Player(xbmc.PLAYER_CORE_AUTO) xbmcPlayer.play(playlist) x #bmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem) #src="(.*?(tune\.pk).*?)" else: #either its default or nothing selected line1 = "Playing Youtube Link" xbmc.executebuiltin('Notification(%s, %s, %d, %s)' % (__addonname__, line1, time, __icon__)) youtubecode = match = re.findall( '<strong>Youtube<\/strong>.*?src=\".*?embed\/(.*?)\?.*\".*?<\/iframe>', link, re.DOTALL | re.IGNORECASE) youtubecode = youtubecode[0] uurl = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s' % youtubecode # print uurl xbmc.executebuiltin("xbmc.PlayMedia(" + uurl + ")") return
def sourcesResolve(self, item, info=False): try: self.url = None u = url = item['url'] d = item['debrid'] direct = item['direct'] provider = item['provider'] call = [i[1] for i in self.sourceDict if i[0] == provider][0] u = url = call.resolve(url) if url == None or not '://' in str(url): raise Exception() url = url[8:] if url.startswith('stack:') else url urls = [] for part in url.split(' , '): u = part if not d == '': part = debrid.resolver(part, d) elif not direct == True: hmf = urlresolver.HostedMediaFile(url=u, include_disabled=True, include_universal=False) if hmf.valid_url() == True: part = hmf.resolve() urls.append(part) url = 'stack://' + ' , '.join(urls) if len(urls) > 1 else urls[0] if url == False or url == None: raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit( '.')[-1].replace('/', '').lower() if ext == 'rar': raise Exception() try: headers = url.rsplit('|', 1)[1] except: headers = '' headers = urllib.quote_plus(headers).replace( '%3D', '=') if ' ' in headers else headers headers = dict(urlparse.parse_qsl(headers)) if url.startswith('http') and '.m3u8' in url: result = client.request(url.split('|')[0], headers=headers, output='geturl', timeout='20') if result == None: raise Exception() elif url.startswith('http'): result = client.request(url.split('|')[0], headers=headers, output='chunk', timeout='20') if result == None: raise Exception() self.url = url return url except: if info == True: self.errorForSources() return
links.append(link) hosts.append(host + ' - ' + video_type) #Display dialog box of sources dialog = xbmcgui.Dialog() index = dialog.select('Choose a video source', hosts) if index >= 0: url = links[index] html = net.http_GET(url).content media_id = re.search('<input type="hidden" value="(.+?)" id="vid" />', html, re.DOTALL).group(1) host = re.search('<input type="hidden" value="(.+?)" id="vhost" />', html, re.DOTALL).group(1) stream_url = urlresolver.HostedMediaFile(host=host, media_id=media_id).resolve() else: stream_url = False #Play the stream if stream_url: addon.resolve_url(stream_url) if mode == 'main': addon.add_directory({ 'mode': 'movies', 'section': 'movies' }, {'title': 'Movies'}, img=icon_path + 'Movies.jpg') addon.add_directory({ 'mode': 'tv',
def sourcesResolve(self, item): try: self.url = None u = url = item['url'] d = item['debrid'] direct = item['direct'] provider = item['provider'].lower() if not provider.endswith(('_mv', '_tv', '_mv_tv')): sourceDict = [] for package, name, is_pkg in pkgutil.walk_packages(__path__): sourceDict.append((name, is_pkg)) provider = [ i[0] for i in sourceDict if i[1] == False and i[0].startswith(provider + '_') ][0] source = __import__(provider, globals(), locals(), [], -1).source() u = url = source.resolve(url) if url == None: raise Exception() if not d == '': self.url = url = debrid.resolver(url, d) if url == None: raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit( '.')[-1].replace('/', '').lower() if ext == 'rar': raise Exception() return url elif not direct == True: try: hmf = urlresolver.HostedMediaFile(url=u, include_disabled=True, include_universal=False) if hmf.valid_url() == True: url = hmf.resolve() except: pass try: hmf = urlresolver.plugnplay.man.implementors( urlresolver.UrlResolver) hmf = [i for i in hmf if not '*' in i.domains] hmf = [(i, i.get_host_and_id(u)) for i in hmf] hmf = [i for i in hmf if not i[1] == False] hmf = [(i[0], i[0].valid_url(u, i[1][0]), i[1][0], i[1][1]) for i in hmf] hmf = [i for i in hmf if not i[1] == False][0] url = hmf[0].get_media_url(hmf[2], hmf[3]) except: pass if url == False or url == None: raise Exception() try: headers = url.rsplit('|', 1)[1] except: headers = '' headers = urllib.quote_plus(headers).replace( '%3D', '=') if ' ' in headers else headers headers = dict(urlparse.parse_qsl(headers)) if url.startswith('http') and '.m3u8' in url: result = client.request(url.split('|')[0], headers=headers, output='geturl', timeout='20') if result == None: raise Exception() elif url.startswith('http'): result = client.request(url.split('|')[0], headers=headers, output='chunk', timeout='20') if result == None: raise Exception() self.url = url return url except: return
def ViceLink(mname, murl, thumb2): main.GA("Vice", "Watched") xbmc.executebuiltin("XBMC.Notification(Please Wait!,Playing Link,5000)") link = main.OPENURL(murl) ok = True desci = re.compile('<meta name="description" content="(.+?)" />').findall( link) if len(desci) > 0: desc = desci[0] else: desc = '' thumbi = re.compile( '<meta property="og:image" content="(.+?)" />').findall(link) if len(thumbi) > 0: thumb = thumbi[0] else: thumb = '' match = re.compile( 'content="http://player.ooyala.com/player.swf.?embedCode=(.+?)&keepEmbedCode=true&autoplay=1"' ).findall(link) if len(match) > 0: playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() durl = 'http://player.ooyala.com/player/ipad/' + match[0] + '.m3u8' link2 = main.OPENURL(durl) match = re.compile('http://(.+?).m3u8').findall(link2) if len(match) == 0: xbmc.executebuiltin( "XBMC.Notification(Sorry!,Link Cannot Be Played,5000)") else: if selfAddon.getSetting("vice-qua") == "0": try: stream_url = 'http://' + match[3] + '.m3u8' except: stream_url = 'http://' + match[0] + '.m3u8' elif selfAddon.getSetting("vice-qua") == "1": try: stream_url = 'http://' + match[0] + '.m3u8' except: stream_url = 'http://' + match[2] + '.m3u8' else: stream_url = durl infoL = {"Title": mname, "Plot": desc} # play with bookmark player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='', title=mname, season='', episode='', year='', img=thumb, infolabels=infoL, watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": wh.add_item(mname + ' ' + '[COLOR green]Vice[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb, fanart='', is_folder=False) player.KeepAlive() return ok match2 = re.compile('content="http://www.youtube.com/v/(.+?)" />').findall( link) if len(match2) > 0: url = 'http://www.youtube.com/watch?v=' + match2[0] media = urlresolver.HostedMediaFile(str(url)) source = media listitem = xbmcgui.ListItem(mname) if source: xbmc.executebuiltin( "XBMC.Notification(Please Wait!,Resolving Link,3000)") stream_url = source.resolve() if source.resolve() == False: xbmc.executebuiltin( "XBMC.Notification(Sorry!,Link Cannot Be Resolved,5000)") return else: stream_url = False # play with bookmark player = playbackengine.PlayWithoutQueueSupport( resolved_url=stream_url, addon_id=addon_id, video_type='', title=mname, season='', episode='', year='', img=thumb, infolabels='', watchedCallbackwithParams=main.WatchedCallbackwithParams, imdb_id='') #WatchHistory if selfAddon.getSetting("whistory") == "true": wh.add_item(mname + ' ' + '[COLOR green]Vice[/COLOR]', sys.argv[0] + sys.argv[2], infolabels='', img=thumb2, fanart='', is_folder=False) player.KeepAlive() return ok
def PLAYLINK(name, url, iconimage): if 'youtube.com/playlist' in url: searchterm = url.split('list=')[1] ytapi = ytpl + searchterm + ytpl2 req = urllib2.Request(ytapi) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() link = link.replace('\r', '').replace('\n', '').replace(' ', '') match = re.compile('"title": "(.+?)".+?"videoId": "(.+?)"', re.DOTALL).findall(link) try: np = re.compile('"nextPageToken": "(.+?)"').findall(link)[0] ytapi = ytplpg1 + np + ytplpg2 + searchterm + ytplpg3 addDir('Next Page >>', ytapi, 2, nextpage, fanart) except: pass for name, ytid in match: url = 'https://www.youtube.com/watch?v=' + ytid iconimage = 'https://i.ytimg.com/vi/' + ytid + '/hqdefault.jpg' if not 'Private video' in name: if not 'Deleted video' in name: addLink(name, url, 2, iconimage, fanart) if 'https://www.googleapis.com/youtube/v3' in url: searchterm = re.compile('playlistId=(.+?)&maxResults').findall(url)[0] req = urllib2.Request(url) req.add_header( 'User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3' ) response = urllib2.urlopen(req) link = response.read() response.close() link = link.replace('\r', '').replace('\n', '').replace(' ', '') match = re.compile('"title": "(.+?)".+?"videoId": "(.+?)"', re.DOTALL).findall(link) try: np = re.compile('"nextPageToken": "(.+?)"').findall(link)[0] ytapi = ytplpg1 + np + ytplpg2 + searchterm + ytplpg3 addDir('Next Page >>', ytapi, 2, nextpage, fanart) except: pass for name, ytid in match: url = 'https://www.youtube.com/watch?v=' + ytid iconimage = 'https://i.ytimg.com/vi/' + ytid + '/hqdefault.jpg' if not 'Private video' in name: if not 'Deleted video' in name: addLink(name, url, 2, iconimage, fanart) if urlresolver.HostedMediaFile(url).valid_url(): stream_url = urlresolver.HostedMediaFile(url).resolve() elif liveresolver.isValid(url) == True: stream_url = liveresolver.resolve(url) else: stream_url = url liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setPath(stream_url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) if 'http' not in url: if '.ts' in url: url = 'plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&name=' + name + '&url=' + url elif 'acestream' in url: url = "plugin://program.plexus/?url=" + url + "&mode=1&name=acestream+" xbmc.Player().play(url) elif urlresolver.HostedMediaFile(url).valid_url(): url = urlresolver.HostedMediaFile(url).resolve() elif liveresolver.isValid(url) == True: url = liveresolver.resolve(url) liz = xbmcgui.ListItem(name, iconImage=icon, thumbnailImage=icon) xbmc.Player().play(url, liz, False) quit()