def PLAYLINK(name,url,iconimage): if not'http'in url:url='http://'+url 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)
def GETMULTI(name,url,iconimage): streamurl=[] streamname=[] streamicon=[] link=open_url(url) urls=re.compile('<title>'+re.escape(name)+'</title>(.+?)</item>',re.DOTALL).findall(link)[0] iconimage=re.compile('<thumbnail>(.+?)</thumbnail>').findall(urls)[0] links=re.compile('<link>(.+?)</link>').findall(urls) i=1 for sturl in links: sturl2=sturl if '(' in sturl: sturl=sturl.split('(')[0] caption=str(sturl2.split('(')[1].replace(')','')) streamurl.append(sturl) streamname.append(caption) else: streamurl.append( sturl ) streamname.append( 'Link '+str(i) ) i=i+1 name='[COLOR red]'+name+'[/COLOR]' dialog = xbmcgui.Dialog() select = dialog.select(name,streamname) if select < 0: quit() else: url = streamurl[select] print url 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)
def Oo0oOOo(name, url, iconimage): try: if 'sop://' in url: url = urllib.quote(url) url = 'plugin://program.plexus/?mode=2&url=%s&name=%s' % ( url, name.replace(' ', '+')) OoooOoo(name, url, iconimage) elif 'acestream://' in url or '.acelive' in url: url = urllib.quote(url) url = 'plugin://program.plexus/?mode=1&url=%s&name=%s' % ( url, name.replace(' ', '+')) OoooOoo(name, url, iconimage) elif 'plugin://plugin.video.SportsDevil/' in url: OoooOoo(name, url, iconimage) elif '.ts' in url: url = 'plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&name=' + name + '&url=' + url OoooOoo(name, url, iconimage) elif urlresolver.HostedMediaFile(url).valid_url(): url = urlresolver.HostedMediaFile(url).resolve() O0o000Oo(name, url, iconimage) elif liveresolver.isValid(url) == True: url = liveresolver.resolve(url) O0o000Oo(name, url, iconimage) else: OoooOoo(name, url, iconimage) except: ooo('UKTurk', 'Stream Unavailable', '3000', IIi1IiiiI1Ii) if 27 - 27: OoO0O0o0Ooo % IIIi1i1I
def CHECKLINKS(name, url, iconimage): try: if urlresolver.HostedMediaFile(url).valid_url(): url = urlresolver.HostedMediaFile(url).resolve() PLAYLINKS(name, url, iconimage) elif liveresolver.isValid(url) == True: url = liveresolver.resolve(url) PLAYLINKS(name, url, iconimage) else: PLAYLINKS(name, url, iconimage) except: notification(addtags('[COLOR red]REPLAYME[/COLOR]'), 'Stream Unavailable', '3000', icon)
def o0OO0oo0oOO(name, url, iconimage): if 54 - 54: I1IiiI % II111iiii % II111iiii iI1 = [] i11Iiii = [] iI = [] Oo0o0000o0o0 = i1I1Iiii1111(url) I1i1I1II = re.compile('<title>' + re.escape(name) + '</title>(.+?)</item>', re.DOTALL).findall(Oo0o0000o0o0)[0] iconimage = re.compile('<thumbnail>(.+?)</thumbnail>').findall(I1i1I1II)[0] i1 = re.compile('<link>(.+?)</link>').findall(I1i1I1II) IiIiiI = 1 for I1I in i1: oOO00oOO = I1I if '(' in I1I: I1I = I1I.split('(')[0] OoOo = str(oOO00oOO.split('(')[1].replace(')', '')) iI1.append(I1I) i11Iiii.append(OoOo) else: iI1.append(I1I) i11Iiii.append('Link ' + str(IiIiiI)) IiIiiI = IiIiiI + 1 name = '[COLOR red]' + name + '[/COLOR]' iiIIIII1i1iI = xbmcgui.Dialog() iIo00O = iiIIIII1i1iI.select(name, i11Iiii) if iIo00O < 0: quit() else: url = iI1[iIo00O] if 69 - 69: O0Oo0oO0o % OoOoo0 - o0oOOo0O0Ooo + OoOoo0 - O0 % OoooooooOO if urlresolver.HostedMediaFile(url).valid_url(): Iii111II = urlresolver.HostedMediaFile(url).resolve() elif liveresolver.isValid(url) == True: Iii111II = liveresolver.resolve(url) else: Iii111II = url oOOoO0 = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) oOOoO0.setPath(Iii111II) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, oOOoO0) iiIIIII1i1iI.notification( Iii1ii1II11i, '[COLOR red]Attempting To Resolve Link Now[/COLOR]', i1i1II, 5000) xbmc.Player().play(Iii111II, oOOoO0, False) if 9 - 9: OoO0O00
def I1(url): if 11 - 11: I1IiiI I1i1iiI1.create(Iii1ii1II11i, "[COLOR yellow]Generating link...[/COLOR]", '[COLOR red]Please wait...[/COLOR]', '') I1i1iiI1.update(0) time.sleep(1) import liveresolver import urlresolver if urlresolver.HostedMediaFile(url).valid_url(): Iii111II = urlresolver.HostedMediaFile(url).resolve() oOOoO0 = xbmcgui.ListItem(ii1I, iconImage=Oo0ooOo0o, thumbnailImage=Oo0ooOo0o) oOOoO0.setPath(Iii111II) xbmc.Player().play(Iii111II, oOOoO0, False) elif liveresolver.isValid(url) == True: url = liveresolver.resolve(url) oOOoO0 = xbmcgui.ListItem(ii1I, iconImage=Oo0ooOo0o, thumbnailImage=Oo0ooOo0o) oOOoO0.setPath(Iii111II) xbmc.Player().play(Iii111II, oOOoO0, False) else: if '.m3u8' in url: I1111i = 'plugin://plugin.video.f4mTester/?streamtype=HLSRETRY&name=' + ii1I + '&url=' + url + '&iconImage=' + Oo0ooOo0o elif '.ts' in url: I1111i = 'plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&name=' + ii1I + '&url=' + url + '&iconImage=' + Oo0ooOo0o elif 'rtmp://' in url: xbmc.Player().play(url) quit() elif 'acestream' in url: I1111i = "plugin://program.plexus/?url=" + url + "&mode=1&name=acestream+" else: I1111i = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26title=%26url=' + url + '%26referer=https://soccerstreams.net' if 14 - 14: II1iI / o0oOOo0O0Ooo oOOoO0 = xbmcgui.ListItem(ii1I, iconImage=Oo0ooOo0o, thumbnailImage=Oo0ooOo0o) oOOoO0.setPath(url) if 32 - 32: I1IiiI * Oo0Ooo xbmc.Player().play(I1111i, oOOoO0, False) if 78 - 78: II1iI - OoooooooOO - I1ii11iIi11i / iIiiI1 / II111iiii
def GETMULTI(name, url, iconimage): streamurl = [] streamname = [] streamicon = [] link = open_url(url) urls = re.compile('<title>' + re.escape(name) + '</title>(.+?)</item>', re.DOTALL).findall(link)[0] iconimage = re.compile('<thumbnail>(.+?)</thumbnail>').findall(urls)[0] links = re.compile('<link>(.+?)</link>').findall(urls) i = 1 for sturl in links: sturl2 = sturl if '(' in sturl: sturl = sturl.split('(')[0] caption = str(sturl2.split('(')[1].replace(')', '')) streamurl.append(sturl) streamname.append(caption) else: streamurl.append(sturl) streamname.append('Link ' + str(i)) i = i + 1 name = '[COLOR red]' + name + '[/COLOR]' dialog = xbmcgui.Dialog() select = dialog.select(name, streamname) if select < 0: quit() else: url = streamurl[select] print url 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)
def URL_RESOLVER(url): import urlresolver try: 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) except: dialog.ok( AddonTitle, "[COLOR yellow]Sorry, It seems the file has been removed at source\n[COLOR white]Universe Movies Team[/COLOR]" ) quit()
try: if not 'filmon.com/' in url: raise Exception() from resources.lib.modules import filmon u = filmon.resolve(url) return u except: pass try: try: headers = dict(parse_qsl(url.rsplit('|', 1)[1])) except: headers = dict('') if not url.startswith('http'): raise Exception() result = client.request(url.split('|')[0], headers=headers, output='headers', timeout='20') if 'Content-Type' in result and not 'html' in result['Content-Type']: raise Exception() import liveresolver if liveresolver.isValid(url) is True: direct = False u = liveresolver.resolve(url) if not u is None: try: dialog.close() except: pass return u except: pass try: # resolveURL dependency has been removed import resolveurl hmf = resolveurl.HostedMediaFile(url=url) if hmf.valid_url() is False: raise Exception() direct = False ; u = hmf.resolve() if not u is False: return u
def PLAYLINK(name, url, iconimage): if not 'http' in url: url = 'http://' + url 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 if '.ts' in stream_url: stream_url = 'plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&name=' + name + '&url=' + stream_url liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) if 'plugin://' not in stream_url: liz.setPath(stream_url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) xbmc.Player().play(stream_url, liz, False)
def GETMULTI(name, url, iconimage): sdbase = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url=' streamurl = [] streamname = [] streamicon = [] streamnumber = [] link = open_url(url) urls = re.compile('<title>' + re.escape(name) + '</title>(.+?)</item>', re.DOTALL).findall(link)[0] links = re.compile('<sportsdevil>(.+?)</sportsdevil>').findall(urls) links2 = re.compile('<link>(.+?)</link>').findall(urls) iconimage = re.compile('<thumbnail>(.+?)</thumbnail>').findall(urls)[0] i = 1 for sturl in links2: sturl2 = sturl if '(' in sturl: sturl = sturl.split('(')[0] caption = str(sturl2.split('(')[1].replace(')', '')) streamurl.append(sturl) streamname.append(caption) streamnumber.append('Stream ' + str(i)) else: streamurl.append(sturl) streamname.append('Link ' + str(i)) i = i + 1 for sturl in links: sturl2 = sturl if '(' in sturl: sturl = sturl.split('(')[0] caption = str(sturl2.split('(')[1].replace(')', '')) streamurl.append(sdbase + sturl) streamname.append(caption) streamnumber.append('Stream ' + str(i)) else: streamurl.append(sdbase + sturl) streamname.append('Link ' + str(i)) i = i + 1 name = '[COLOR red]' + name + '[/COLOR]' dialog = xbmcgui.Dialog() select = dialog.select(name, streamname) if select < 0: quit() else: url = streamurl[select] if sdbase in url: check = streamname[select] suffix = "/" if not check.endswith(suffix): refer = check + "/" else: refer = check url = url + "%26referer=" + refer liz = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=iconimage) liz.setPath(url) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz) xbmc.Player().play(url, liz) else: 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) xbmc.Player().play(stream_url, liz)
import xbmc,xbmcaddon,xbmcgui,xbmcplugin,urllib,urllib2,os,re,sys,hashlib
def process(self, url, direct=True): try: if not any(i in url for i in ['.jpg', '.png', '.gif']): raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit('.')[-1].replace('/', '').lower() if not ext in ['jpg', 'png', 'gif']: raise Exception() try: i = os.path.join(control.dataPath,'img') control.deleteFile(i) f = control.openFile(i, 'w') f.write(client.request(url)) f.close() control.execute('ShowPicture("%s")' % i) return False except: return except: pass try: r, x = re.findall('(.+?)\|regex=(.+?)$', url)[0] x = regex.fetch(x) r += urllib.unquote_plus(x) if not '</regex>' in r: raise Exception() u = regex.resolve(r) if not u == None: url = u except: pass try: if not url.startswith('rtmp'): raise Exception() if len(re.compile('\s*timeout=(\d*)').findall(url)) == 0: url += ' timeout=10' return url except: pass try: if not any(i in url for i in ['.m3u8', '.f4m', '.ts']): raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit('.')[-1].replace('/', '').lower() if not ext in ['m3u8', 'f4m', 'ts']: raise Exception() return url except: pass try: preset = re.findall('<preset>(.+?)</preset>', url)[0] if not 'search' in preset: raise Exception() title, year, imdb = re.findall('<title>(.+?)</title>', url)[0], re.findall('<year>(.+?)</year>', url)[0], re.findall('<imdb>(.+?)</imdb>', url)[0] try: tvdb, tvshowtitle, premiered, season, episode = re.findall('<tvdb>(.+?)</tvdb>', url)[0], re.findall('<tvshowtitle>(.+?)</tvshowtitle>', url)[0], re.findall('<premiered>(.+?)</premiered>', url)[0], re.findall('<season>(.+?)</season>', url)[0], re.findall('<episode>(.+?)</episode>', url)[0] except: tvdb = tvshowtitle = premiered = season = episode = None direct = False quality = 'HD' if not preset == 'searchsd' else 'SD' from resources.lib.modules import sources u = sources.sources().getSources(title, year, imdb, tvdb, season, episode, tvshowtitle, premiered, quality) if not u == None: return u except: pass try: from resources.lib.modules import sources u = sources.sources().getURISource(url) if not u == False: direct = False if u == None or u == False: raise Exception() return u except: pass try: if not '.google.com' in url: raise Exception() from resources.lib.modules import directstream u = directstream.google(url)[0]['url'] return u except: pass try: if not 'filmon.com/' in url: raise Exception() from resources.lib.modules import filmon u = filmon.resolve(url) return u except: pass try: try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1])) except: headers = dict('') if not url.startswith('http'): raise Exception() result = client.request(url.split('|')[0], headers=headers, output='headers', timeout='20') if 'Content-Type' in result and not 'html' in result['Content-Type']: raise Exception() import liveresolver if liveresolver.isValid(url) == True: direct = False u = liveresolver.resolve(url) if not u == None: try: dialog.close() except: pass return u except: pass try: import urlresolver hmf = urlresolver.HostedMediaFile(url=url) if hmf.valid_url() == False: raise Exception() direct = False ; u = hmf.resolve() if not u == False: return u except: pass if direct == True: return url
def process(self, url, direct=True): try: if not any(i in url for i in ['.jpg', '.png', '.gif']): raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit('.')[-1].replace('/', '').lower() if not ext in ['jpg', 'png', 'gif']: raise Exception() try: i = os.path.join(control.dataPath,'img') control.deleteFile(i) f = control.openFile(i, 'w') f.write(client.request(url)) f.close() control.execute('ShowPicture("%s")' % i) return False except: return except: pass try: r, x = re.findall('(.+?)\|regex=(.+?)$', url)[0] x = regex.fetch(x) r += urllib.unquote_plus(x) if not '</regex>' in r: raise Exception() u = regex.resolve(r) if not u is None: url = u except: pass try: if not url.startswith('rtmp'): raise Exception() if len(re.compile('\s*timeout=(\d*)').findall(url)) == 0: url += ' timeout=10' return url except: pass try: if not any(i in url for i in ['.m3u8', '.f4m', '.ts']): raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit('.')[-1].replace('/', '').lower() if not ext in ['m3u8', 'f4m', 'ts']: raise Exception() return url except: pass try: preset = re.findall('<preset>(.+?)</preset>', url)[0] if not 'search' in preset: raise Exception() title, year, imdb = re.findall('<title>(.+?)</title>', url)[0], re.findall('<year>(.+?)</year>', url)[0], re.findall('<imdb>(.+?)</imdb>', url)[0] try: tvdb, tvshowtitle, premiered, season, episode = re.findall('<tvdb>(.+?)</tvdb>', url)[0], re.findall('<tvshowtitle>(.+?)</tvshowtitle>', url)[0], re.findall('<premiered>(.+?)</premiered>', url)[0], re.findall('<season>(.+?)</season>', url)[0], re.findall('<episode>(.+?)</episode>', url)[0] except: tvdb = tvshowtitle = premiered = season = episode = None direct = False quality = 'HD' if not preset == 'searchsd' else 'SD' from resources.lib.modules import sources u = sources.Sources().getSources(title, year, imdb, tvdb, season, episode, tvshowtitle, premiered, quality) if not u is None: return u except: pass try: from resources.lib.modules import sources u = sources.Sources().getURISource(url) if not u is False: direct = False if u is None or u is False: raise Exception() return u except: pass try: if not '.google.com' in url: raise Exception() from resources.lib.modules import directstream u = directstream.google(url)[0]['url'] return u except: pass try: if not 'filmon.com/' in url: raise Exception() from resources.lib.modules import filmon u = filmon.resolve(url) return u except: pass try: try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1])) except: headers = dict('') if not url.startswith('http'): raise Exception() result = client.request(url.split('|')[0], headers=headers, output='headers', timeout='20') if 'Content-Type' in result and not 'html' in result['Content-Type']: raise Exception() import liveresolver if liveresolver.isValid(url) is True: direct = False u = liveresolver.resolve(url) if not u is None: try: dialog.close() except: pass return u except: pass try: import resolveurl hmf = resolveurl.HostedMediaFile(url=url) if hmf.valid_url() is False: raise Exception() direct = False ; u = hmf.resolve() if not u is False: return u except: pass if direct is True: return url
def process(self, 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 url.startswith('rtmp'): raise Exception() if len(re.compile('\s*timeout=(\d*)').findall(url)) == 0: url += ' timeout=10' try: dialog.close() except: pass return url except: pass try: if not '.m3u8' in url: raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit( '.')[-1].replace('/', '').lower() if not ext == 'm3u8': raise Exception() try: dialog.close() except: pass return url except: pass try: preset = re.findall('<preset>(.+?)</preset>', url)[0] title, year, imdb = re.findall( '<title>(.+?)</title>', url)[0], re.findall( '<year>(.+?)</year>', url)[0], re.findall('<imdb>(.+?)</imdb>', url)[0] try: tvdb, tvshowtitle, premiered, season, episode = re.findall( '<tvdb>(.+?)</tvdb>', url)[0], re.findall( '<tvshowtitle>(.+?)</tvshowtitle>', url)[0], re.findall('<premiered>(.+?)</premiered>', url)[0], re.findall( '<season>(.+?)</season>', url)[0], re.findall( '<episode>(.+?)</episode>', url)[0] except: tvdb = tvshowtitle = premiered = season = episode = None direct = False presetDict = [ 'primewire_mv_tv', 'watchfree_mv_tv', 'movie25_mv', 'watchseries_tv', 'dizibox_tv', 'dizigold_tv', 'dizilab_tv', 'miradetodo_mv', 'onemovies_mv_tv', 'onlinedizi_tv', 'pelispedia_mv_tv', 'pubfilm_mv_tv', 'putlocker_mv_tv', 'sezonlukdizi_tv', 'usmovies_mv', 'usseries_tv', 'watch1080_mv' ] if preset == 'searchsd': presetDict = [ 'primewire_mv_tv', 'watchfree_mv_tv', 'movie25_mv', 'watchseries_tv' ] from resources.lib.sources import sources try: dialog.update(0, control.lang(30726).encode('utf-8'), control.lang(30731).encode('utf-8')) except: pass u = sources().getSources(title, year, imdb, tvdb, season, episode, tvshowtitle, premiered, presetDict=presetDict, progress=False, timeout=20) try: dialog.update(50, control.lang(30726).encode('utf-8'), control.lang(30731).encode('utf-8')) except: pass u = sources().sourcesDirect(u, progress=False) if not u == None: try: dialog.close() except: pass return u except: pass try: from resources.lib.sources import sources u = sources().getURISource(url) if not u == False: direct = False if u == None or u == False or u == []: raise Exception() try: dialog.update(50, control.lang(30726).encode('utf-8'), control.lang(30731).encode('utf-8')) except: pass u = sources().sourcesDirect(u, progress=False) if not u == None: try: dialog.close() except: pass return u except: pass try: if not '.google.com' in url: raise Exception() from resources.lib.modules import directstream u = directstream.google(url)[0]['url'] try: dialog.close() except: pass return u except: pass try: import urlresolver try: hmf = urlresolver.HostedMediaFile(url=url, include_disabled=True, include_universal=False) except: hmf = urlresolver.HostedMediaFile(url=url) if hmf.valid_url() == False: raise Exception() direct = False u = hmf.resolve() if 'plugin://plugin.video.youtube' in u: raise Exception() if not u == False: try: dialog.close() except: pass return u except: pass try: try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1])) except: headers = dict('') if not url.startswith('http'): raise Exception() result = client.request(url.split('|')[0], headers=headers, output='headers', timeout='20') if 'Content-Type' in result and not 'html' in result[ 'Content-Type']: raise Exception() import liveresolver if liveresolver.isValid(url) == True: direct = False u = liveresolver.resolve(url) if not u == None: try: dialog.close() except: pass return u except: pass if direct == True: return url try: dialog.close() except: pass
def process(self, url, direct=True): try: if not any(i in url for i in ['.jpg', '.png', '.gif']): raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit('.')[-1].replace('/', '').lower() if not ext in ['jpg', 'png', 'gif']: raise Exception() try: dialog = None dialog = control.progressDialog dialog.create(control.addonInfo('name'), control.lang(30732).encode('utf-8')) dialog.update(0) i = os.path.join(control.dataPath,'img') control.deleteFile(i) f = control.openFile(i, 'w') f.write(client.request(url)) f.close() dialog.close() control.execute('ShowPicture("%s")' % i) return True except: return except: pass 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 url.startswith('rtmp'): raise Exception() if len(re.compile('\s*timeout=(\d*)').findall(url)) == 0: url += ' timeout=10' try: dialog.close() except: pass return url except: pass try: if not any(i in url for i in ['.m3u8', '.f4m', '.ts']): raise Exception() ext = url.split('?')[0].split('&')[0].split('|')[0].rsplit('.')[-1].replace('/', '').lower() if not ext in ['m3u8', 'f4m', 'ts']: raise Exception() try: dialog.close() except: pass return url except: pass try: preset = re.findall('<preset>(.+?)</preset>', url)[0] title, year, imdb = re.findall('<title>(.+?)</title>', url)[0], re.findall('<year>(.+?)</year>', url)[0], re.findall('<imdb>(.+?)</imdb>', url)[0] try: tvdb, tvshowtitle, premiered, season, episode = re.findall('<tvdb>(.+?)</tvdb>', url)[0], re.findall('<tvshowtitle>(.+?)</tvshowtitle>', url)[0], re.findall('<premiered>(.+?)</premiered>', url)[0], re.findall('<season>(.+?)</season>', url)[0], re.findall('<episode>(.+?)</episode>', url)[0] except: tvdb = tvshowtitle = premiered = season = episode = None direct = False presetDict = ['primewire_mv_tv', 'watchfree_mv_tv', 'movie25_mv', 'watchseries_tv', 'afdah_mv', 'dtmovies_mv', 'dizibox_tv', 'dizigold_tv', 'miradetodo_mv', 'onemovies_mv_tv', 'onlinedizi_tv', 'pelispedia_mv_tv', 'pubfilm_mv_tv', 'putlocker_mv_tv', 'rainierland_mv', 'sezonlukdizi_tv', 'tunemovie_mv', 'xmovies_mv'] if preset == 'searchsd': presetDict = ['primewire_mv_tv', 'watchfree_mv_tv', 'movie25_mv', 'watchseries_tv'] from resources.lib.sources import sources try: dialog.update(0, control.lang(30726).encode('utf-8'), control.lang(30731).encode('utf-8')) except: pass u = sources().getSources(title, year, imdb, tvdb, season, episode, tvshowtitle, premiered, presetDict=presetDict, progress=False, timeout=20) try: dialog.update(50, control.lang(30726).encode('utf-8'), control.lang(30731).encode('utf-8')) except: pass u = sources().sourcesDirect(u, progress=False) if not u == None: try: dialog.close() except: pass return u except: pass try: from resources.lib.sources import sources u = sources().getURISource(url) if not u == False: direct = False if u == None or u == False or u == []: raise Exception() try: dialog.update(50, control.lang(30726).encode('utf-8'), control.lang(30731).encode('utf-8')) except: pass u = sources().sourcesDirect(u, progress=False) if not u == None: try: dialog.close() except: pass return u except: pass try: if not '.google.com' in url: raise Exception() from resources.lib.modules import directstream u = directstream.google(url)[0]['url'] try: dialog.close() except: pass return u except: pass try: import urlresolver hmf = urlresolver.HostedMediaFile(url=url, include_disabled=True, include_universal=False) if hmf.valid_url() == False: raise Exception() direct = False ; u = hmf.resolve() if 'plugin://plugin.video.youtube' in u: raise Exception() if not u == False: try: dialog.close() except: pass return u except: pass try: try: headers = dict(urlparse.parse_qsl(url.rsplit('|', 1)[1])) except: headers = dict('') if not url.startswith('http'): raise Exception() result = client.request(url.split('|')[0], headers=headers, output='headers', timeout='20') if 'Content-Type' in result and not 'html' in result['Content-Type']: raise Exception() import liveresolver if liveresolver.isValid(url) == True: direct = False u = liveresolver.resolve(url) if not u == None: try: dialog.close() except: pass return u except: pass if direct == True: return url try: dialog.close() except: pass
def Player(name, url, iconimage): dp.create(AddonTitle, "Opening.......", "Please Wait...") if "m3u8" in url: a = open(HISTORY).read() b = a.replace('<link>' + url + '</link>', '') f = open(HISTORY, mode='w') f.write(str(b)) f.close() a = open(HISTORY).read() b = a.replace('#START OF FILE#', '#START OF FILE#\n<link>' + url + '</link>') f = open(HISTORY, mode='w') f.write(str(b)) f.close() elif not "m3u" in url: a = open(HISTORY).read() b = a.replace('<link>' + url + '</link>', '') f = open(HISTORY, mode='w') f.write(str(b)) f.close() a = open(HISTORY).read() b = a.replace('#START OF FILE#', '#START OF FILE#\n<link>' + url + '</link>') f = open(HISTORY, mode='w') f.write(str(b)) f.close() if not 'f4m' in url: if '.m3u8' in url: url = 'plugin://plugin.video.f4mTester/?streamtype=HLSRETRY&name=' + name + '&url=' + url elif '.ts' in url: url = url.replace('.ts', '.m3u8') url = 'plugin://plugin.video.f4mTester/?streamtype=HLSRETRY&name=' + name + '&url=' + url elif '.mpegts' in url: url = url.replace('.mpegts', '.m3u8') url = 'plugin://plugin.video.f4mTester/?streamtype=HLSRETRY&name=' + name + '&url=' + url if "plugin://" in url: if not os.path.exists(F4M): dialog.ok( '[COLOR red]F4M TESTER NOT INSTALLED![/COLOR]', "This link requires F4M Tester be installed. Please install F4M from the Shani Repo at http://fusion.tvaddons.ag" ) quit() if urlresolver.HostedMediaFile(url).valid_url(): stream_url = urlresolver.HostedMediaFile(url).resolve() liz = xbmcgui.ListItem(url, iconImage=icon, thumbnailImage=icon) liz.setPath(stream_url) dp.close() xbmc.executebuiltin("Container.Refresh") xbmc.Player().play(stream_url, liz, False) quit() elif liveresolver.isValid(url) == True: stream_url = liveresolver.resolve(url) liz = xbmcgui.ListItem(url, iconImage=icon, thumbnailImage=icon) liz.setPath(stream_url) dp.close() xbmc.executebuiltin("Container.Refresh") xbmc.Player().play(stream_url, liz, False) quit() else: if 'http' in url: url = url + '|User-Agent=Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30' liz = xbmcgui.ListItem(url, iconImage=icon, thumbnailImage=icon) dp.close() xbmc.executebuiltin("Container.Refresh") xbmc.Player().play(url, liz, False) quit()
def Player(name, url, icon=None): dialogP.create(TITLE, "Open URL: " + url, "Please wait ...") # Add to history addHistory(HISTORYPLAY_LST, url, name) #xbmc.executebuiltin("Container.Refresh") ext = getFileExt(url) (urlfile, ext) = os.path.splitext(url) if urlresolver.HostedMediaFile(url).valid_url(): stream_url = urlresolver.HostedMediaFile(url).resolve() #li = xbmcgui.ListItem(path=stream_url) li = xbmcgui.ListItem(name) dialogP.close() xbmc.log('Play with support from urlresolver: %s - %s' % (name, url), xbmc.LOGDEBUG) #xbmcplugin.setResolveUrl(addon_handle, True, listitem=li) xbmc.Player().play(stream_url, li, False) elif liveresolver.isValid(url) == True: stream_url = liveresolver.resolve(url) #li = xbmcgui.ListItem(path=stream_url) li = xbmcgui.ListItem(name) dialogP.close() xbmc.log('Play with support from liveresolver: %s - %s' % (name, url), xbmc.LOGDEBUG) #xbmcplugin.setResolveUrl(addon_handle, True, listitem=li) xbmc.Player().play(stream_url, li, False) elif ext.lower() in ('.ts', 'mpegts'): #Check for plugin f4m if re.match(r"plugin://plugin.video.f4mTester", url): if not os.path.exists(PLUGIN_F4M): dialog.ok('[COLOR red]F4M TESTER NOT INSTALLED![/COLOR]', "Please install F4M Tester first") quit() url_mod = url #check if http-request is a http-redirect (302), than resolve it an pass this further ... #url_redirect = getRedirectLocation(url_mod, maxredirect=1, timeout=30, dialog=dialogP) #url_mod = url_redirect['url'] #if url_redirect['accept'] == False: # dialogP.close() # msg = "3. Redirection failed!" # dialog.notification(TITLE, msg, xbmcgui.NOTIFICATION_ERROR) # xbmc.log('4. Redirection failed: URL: %s, Statuscode: %s' % (url_mod, url_redirect['status']), xbmc.LOGERROR) # quit() #xbmc.log('5. Use Redirect[Code:%s]: %s' % (url_redirect['status'], url_mod), xbmc.LOGDEBUG) #streamtype = 'HLSRETRY' streamtype = 'TSDOWNLOADER' proxyurl = 'plugin://plugin.video.f4mTester/?mode=play&streamtype=' + streamtype + '&name=' + urllib2.quote( name) + '&url=' + urllib2.quote(url_mod) li = xbmcgui.ListItem(name) dialogP.close() xbmc.log('Play with f4m: %s - %s (mod: %s)' % (name, url, url_mod), xbmc.LOGDEBUG) xbmc.Player().play(proxyurl, li, False) else: li = xbmcgui.ListItem(name) dialogP.close() xbmc.log('Play normal: %s - %s' % (name, url), xbmc.LOGDEBUG) xbmc.Player().play(url, li, False)
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, urllib, urllib2, os, re, sys, hashlib