Пример #1
0
	def resolve(self,url):
		html = client.request(url)
		soup = webutils.bs(html)
		url = soup.find('iframe',{'width':'600'})['src']
		if 'nhl' in url:
			url = url.split("playlist=")[-1]
			url = 'http://video.nhl.com/videocenter/servlets/playlist?ids=%s&format=json' % url
			result = client.request(url)
			url = re.compile('"publishPoint":"(.+?)"').findall(result)[0]
			return url
		elif 'rutube' in url:
			url = 'http:' + url
			result = client.request(url)
			m3u8 = re.compile('video_balancer": {.*?"m3u8": "(.*?)"}').findall(result)[0]
			result = client.request(m3u8)
			url = re.compile('"\n(.+?)\n').findall(result)
			url = url[::-1]
			return url[0]
		elif 'youtube' in url:
			import liveresolver
			return liveresolver.resolve(url)
		else:
			import urlresolver
			url = urlresolver.resolve(url)
			return url
Пример #2
0
	def resolve(self,url):
		try:
			referer,id = url.split('##')
			s = requests.Session()
			s.headers = {'Accept':'application/json, text/javascript, */*; q=0.01','Host':'www.streamgaroo.com','Referer':referer,'X-Requested-With' : 'XMLHttpRequest'}
			html = s.post('http://www.streamgaroo.com/calls/get/source',data={'h':urllib.unquote(id)}).text
			s.headers = ({'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8','Host':'www.streamgaroo.com','Referer':referer, 'Accept-Encoding':'gzip, deflate, lzma, sdch'})
			link = json.loads(html)['link']
			html = s.get(link).text
			
			#hls
			try:
				url = re.findall('playStream\(.+?,.((?:http|rtmp)[^\"\']+)',html)[0]
				if 'rtmp' in url:
					return url 
				else:
					return url + '|%s' %urllib.urlencode({'X-Requested-With':constants.get_shockwave(),'Referer':link,'User-agent':client.agent()})
			except:	pass

			#everything else
			import liveresolver
			return liveresolver.resolve(link,html=html)
		except:
			control.infoDialog('No stream available!')
			return ''
Пример #3
0
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
Пример #4
0
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)
Пример #5
0
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)
Пример #6
0
 def resolve(self, url):
     html = client.request(url)
     url = re.findall(
         '(?:\'|\")(https?://(?:www.|)youtube(?:-nocookie)?.com.+?[^\'\"]+)',
         html)[0]
     url = url.replace('amp;', '').replace('-nocookie', '')
     import liveresolver
     return liveresolver.resolve(url)
Пример #7
0
	def resolve(self,url):
		if 'http' not in url:
			url = self.sch_links(url)
			if url=='':
				return url

		import liveresolver
		return liveresolver.resolve(url)
		
Пример #8
0
    def resolve(self, url):
        urls = url.split('##')
        choices = ['Link %s' % (i + 1) for i in range(len(urls))]

        if len(choices) == 1:
            index = 0
        else:
            index = control.selectDialog(choices, 'Odaberite link:')
        if index > -1:
            url = urls[index]
            if 'morescreens' in url:
                from resources.lib.resolvers import hrti
                return hrti.resolve(url)

            elif 'streamlive.to' in url:
                from resources.lib.resolvers import streamlive
                return streamlive.resolve(url)

            elif 'dailymotion' in url:
                import urlresolver
                return urlresolver.resolve(url)

            #nova tv, doma tv
            specy = {
                'http://www.sipragezabava.com/kanal_3_hr.php':
                'http://prvenstvoliga.blogspot.hr/2014/12/nova-tv.html',
                'http://www.netraja.net/2014/05/doma-tv.html':
                'http://www.prvenstvoliga.blogspot.hr/2014/05/doma-tv.html'
            }
            if url in specy.keys():
                urlx = []
                src = []
                html = client.request(
                    specy[url],
                    referer=
                    'http://prvenstvoliga.blogspot.com/search/label/Hrvatska')
                urls = re.findall('target=[\"\']([^\"\']+)[\"\'].+?</embed>',
                                  html)
                i = 0
                for url in urls:
                    i += 1
                    src += ['Link %s' % i]

                dialog = xbmcgui.Dialog()
                index = dialog.select('Odaberite:', src)
                if index == -1:
                    return ''
                return urlx[index]

            import liveresolver
            return liveresolver.resolve(url)

        return ''
Пример #9
0
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)
Пример #10
0
 def resolve(self,url):
     html = client.request(url)
     try:
         html= convert.unescape(html)
     except:
         pass
     res = url
     try:
         res = urllib.unquote(re.findall('unescape\s*\(\s*[\"\']([^\"\']+)',html)[0])
         res = re.findall('(?:href|src)=[\"\']([^\"\']+)',res)[0]
     except:
         pass
     
     import liveresolver
     return liveresolver.resolve(res)
Пример #11
0
	def resolve(self,url):
		ods = eval(client.request('https://raw.githubusercontent.com/natko1412/cod/master/extra/on_demands'))
		exts = ['.mp4','.mkv','.flv','.avi','plugin://']
		if any(word in url for word in ods):
			import urlresolver
			return urlresolver.resolve(url)
		elif 'playwire' in url:
			from resources.lib.resolvers import playwire
			return playwire.resolve(url)

		elif any(ext in url for ext in exts):
			return url

		else:
			import liveresolver
			return liveresolver.resolve(url)
Пример #12
0
    def resolve(self, url):
        html = client.request(url)
        try:
            html = convert.unescape(html)
        except:
            pass
        res = url
        try:
            res = urllib.unquote(
                re.findall('unescape\s*\(\s*[\"\']([^\"\']+)', html)[0])
            res = re.findall('(?:href|src)=[\"\']([^\"\']+)', res)[0]
        except:
            pass

        import liveresolver
        return liveresolver.resolve(res)
Пример #13
0
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
Пример #14
0
 def resolve(self, url):
     headers = {"Cookie": "beget=begetok; has_js=1;"}
     try:
         log('batman : ' + url)
         source = requests.get(url, headers=headers).text
     except:
         source = None
     if source:
         match = re.compile('sop://(.+?)"').findall(source)
         if match:
             log("sop://" + match[0])
             return "sop://" + match[0]
         else:
             match = re.compile('this.loadPlayer\("(.+?)"').findall(source)
             if match:
                 return liveresolver.resolve("acestream://" + match[0])
             else:
                 pass
Пример #15
0
    def resolve(self, url):

        if 'morescreens' in url:
            from resources.lib.resolvers import hrti
            return hrti.resolve(url)

        #nova tv, doma tv
        specy = {
            'http://www.sipragezabava.com/kanal_3_hr.php':
            'http://prvenstvoliga.blogspot.hr/2014/12/nova-tv.html',
            'http://www.netraja.net/2014/05/doma-tv.html':
            'http://www.prvenstvoliga.blogspot.hr/2014/05/doma-tv.html'
        }
        if url in specy.keys():
            urlx = []
            src = []
            html = client.request(
                specy[url],
                referer=
                'http://prvenstvoliga.blogspot.com/search/label/Hrvatska')
            urls = re.findall('target=[\"\']([^\"\']+)[\"\'].+?</embed>', html)
            i = 0
            for url in urls:
                i += 1

                if '.ts' in url:
                    if url not in urlx:
                        urlx += [
                            'plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&url='
                            + url
                        ]
                        src += ['Link %s' % i]
                else:
                    if url not in urlx:
                        urlx += [url]
                        src += ['Link %s' % i]
            dialog = xbmcgui.Dialog()
            index = dialog.select('Odaberite:', src)
            if index == -1:
                return
            return urlx[index]

        import liveresolver
        return liveresolver.resolve(url)
Пример #16
0
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&amp;name=' + ii1I + '&amp;url=' + url + '&amp;iconImage=' + Oo0ooOo0o
        elif '.ts' in url:
            I1111i = 'plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&amp;name=' + ii1I + '&amp;url=' + url + '&amp;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&amp;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
Пример #17
0
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)
Пример #18
0
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()
Пример #19
0
def show_streams(title, playlist_id):
    if mode == title:
        streams = source.Source().get_streams(playlist_id)
        if streams:
            for c in streams:
                title = c['title']
                channel = c['title']
                videoId = c['videoId']
                img = c['img']
                rURL = Addon.plugin_url + "?channel=" + channel + "&videoId=" + videoId + "&mode=play"
                Addon.add_video_item(rURL, {'title': title}, img=img)

    elif mode == 'play':
        videoId = Addon.plugin_queries['videoId']
        stream_status = source.Source()._get_json(
            '/check' + base64.b64decode('LnBocA=='), {'id': videoId})['status']
        if stream_status == 'true':
            stream = "https://www.youtube.com/watch?v=" + videoId
            stream_url = liveresolver.resolve(stream)
            item = xbmcgui.ListItem(path=stream_url)
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
        else:
            dlg.ok(Addon.get_string(5000), Addon.get_string(7000))
            exit()
Пример #20
0
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&amp;name=' + name + '&amp;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)
Пример #21
0
	def resolve(self,url):
		html = client.request(url)
		url2 = self.base + re.findall('href=[\"\']([^\"\']+)[\"\'] target=[\"\']_blank[\"\']>.+?Click Here To Watch',html)[0]
		import liveresolver
		return liveresolver.resolve(url2)
Пример #22
0
def GETMULTI(name, url, iconimage):

    sdbase = 'plugin://plugin.video.SportsDevil/?mode=1&amp;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)
Пример #23
0
	def resolve(self,url):
		ref=url
		html = client.request(url)
		soup = webutils.bs(html)
		try:
			url = soup.find('iframe',{'width':'600'})['src']
		except:
			try:
				url = 'http:' + re.findall('(\/\/config\.playwire\.com\/[^\'\"]+)',html)[0]
			except:
				try:
					url = soup.find('iframe',{'width':'626'})['src']
				except:
					return

		if 'nba' in url:
			url = url.split("playlist=")[-1]
			url = 'http://video.nba.com/videocenter/servlets/playlist?ids=%s&format=json' % url
			result = client.request(url)
			url = re.compile('"publishPoint":"(.+?)"').findall(result)[0]
			return url
		elif 'rutube' in url:
			url = re.findall('embed/(\d+)',url)[0]
			url = 'http://rutube.ru/api/play/options/'+url+'?format=json'
			result = client.request(url)
			jsx = json.loads(result)
			link = jsx['video_balancer']['m3u8']
			return link
		elif 'youtube' in url:
			import liveresolver
			return liveresolver.resolve(url)
		elif 'playwire' in url:
			try:
				result = client.request(url)
				html = result
				result = json.loads(result)
				try:
					f4m=result['content']['media']['f4m']
				except:
					reg=re.compile('"src":"http://(.+?).f4m"')
					f4m=re.findall(reg,html)[0]
					f4m='http://'+pom+'.f4m'

				result = client.request(f4m)
				soup = webutils.bs(result)
				try:
					base=soup.find('baseURL').getText()+'/'
				except:
					base=soup.find('baseurl').getText()+'/'

				linklist = soup.findAll('media')
				choices,links=[],[]
				for link in linklist:
					url = base + link['url']
					bitrate = link['bitrate']
					choices.append(bitrate)
					links.append(url)
					if len(links)==1:
						return links[0]
					if len(links)>1:
						import xbmcgui
						dialog = xbmcgui.Dialog()
						index = dialog.select('Select bitrate', choices)
					if index>-1:
						return links[index]
				return
			except:
				return

		elif 'mail.ru' in url:
			link=url

			link = link.replace('https://videoapi.my.mail.ru/videos/embed/mail/','http://videoapi.my.mail.ru/videos/mail/')
			link = link.replace('http://videoapi.my.mail.ru/videos/embed/mail/','http://videoapi.my.mail.ru/videos/mail/')
			link = link.replace('html','json')
			s = requests.Session()
			f = s.get(link).text

			js = json.loads(f)
			token = s.cookies.get_dict()['video_key']
			url = js['videos'][-1]['url'] + '|%s'%(urllib.urlencode({'Cookie':'video_key=%s'%token, 'User-Agent':client.agent(), 'Referer':ref} ))
			return url
		else:
			import urlresolver
			url = urlresolver.resolve(url)
			return url
Пример #24
0
			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
		except: pass
Пример #25
0
	def resolve(self,url):
		if url.endswith('.ts') or 'bit.ly' in url:
			return url
		else:
			import liveresolver
			return liveresolver.resolve(url)
Пример #26
0
def Big_resolve2(name, url):
    import liveresolver
    resolved_url = liveresolver.resolve(url)
    xbmc.Player().play(resolved_url, xbmcgui.ListItem(name))
    xbmcplugin.endOfDirectory(int(sys.argv[1]))
Пример #27
0
 def resolve(self,url):
     html = client.request(url)
     import liveresolver
     return liveresolver.resolve(url,html=html,cache_timeout=0)
Пример #28
0
	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
Пример #29
0
def play(url):
	resolved = liveresolver.resolve(url)
	item = xbmcgui.ListItem(path=resolved)
	xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
Пример #30
0
 def resolve(self,url):
     html = client.request(url)
     import liveresolver
     return liveresolver.resolve(url,html=html,cache_timeout=0)
Пример #31
0
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)
Пример #32
0
	def resolve(self,url):

		import liveresolver
		return liveresolver.resolve(url)
		
Пример #33
0
	def resolve(self,url):
		import liveresolver
		return liveresolver.resolve(url,cache_timeout=0)
Пример #34
0
	def resolve(self,url):
		ref = url
		html = client.request(url)
		soup = webutils.bs(html)
		try:
			url = soup.find('iframe',{'width':'600'})['src']
		except:
			try:
				url = 'http:' + re.findall('(\/\/config\.playwire\.com\/[^\'\"]+)',html)[0]
			except:
				return
		if 'nhl' in url:
			url = url.split("playlist=")[-1]
			url = 'http://video.nhl.com/videocenter/servlets/playlist?ids=%s&format=json' % url
			result = client.request(url)
			url = re.compile('"publishPoint":"(.+?)"').findall(result)[0]
			return url
		elif 'rutube' in url:
			url = re.findall('embed/(\d+)',url)[0]
			url = 'http://rutube.ru/api/play/options/'+url+'?format=json'
			result = client.request(url)
			jsx = json.loads(result)
			link = jsx['video_balancer']['m3u8']
			return link
		
		elif 'mail.ru' in url:
			link=url

			link = link.replace('https://videoapi.my.mail.ru/videos/embed/mail/','http://videoapi.my.mail.ru/videos/mail/')
			link = link.replace('http://videoapi.my.mail.ru/videos/embed/mail/','http://videoapi.my.mail.ru/videos/mail/')
			link = link.replace('html','json')
			s = requests.Session()
			f = s.get(link).text

			js = json.loads(f)
			token = s.cookies.get_dict()['video_key']
			url = js['videos'][-1]['url'] + '|%s'%(urllib.urlencode({'Cookie':'video_key=%s'%token, 'User-Agent':client.agent(), 'Referer':ref} ))
			return url

		elif 'youtube' in url:
			import liveresolver
			return liveresolver.resolve(url)
		elif 'playwire' in url:
			try:
				result = client.request(url)
				html = result
				result = json.loads(result)
				try:
					f4m=result['content']['media']['f4m']
				except:
					reg=re.compile('"src":"http://(.+?).f4m"')
					f4m=re.findall(reg,html)[0]
					f4m='http://'+pom+'.f4m'

				result = client.request(f4m)
				soup = webutils.bs(result)
				try:
					base=soup.find('baseURL').getText()+'/'
				except:
					base=soup.find('baseurl').getText()+'/'

				linklist = soup.findAll('media')
				choices,links=[],[]
				for link in linklist:
					url = base + link['url']
					bitrate = link['bitrate']
					choices.append(bitrate)
					links.append(url)
				if len(links)==1:
					return links[0]
				if len(links)>1:
					import xbmcgui
					dialog = xbmcgui.Dialog()
					index = dialog.select('Select bitrate', choices)
					if index>-1:
						return links[index]
				return
			except:
				return
		else:
			import urlresolver
			url = urlresolver.resolve(url)
			return url
Пример #35
0
    

elif mode[0]=='my_castaway':
    addon.add_item({'mode': 'keyboard_open'}, {'title':'Open URL'}, img=icon_path('live.png'), fanart=fanart,is_folder=True)
    addon.add_item({'mode': 'x'}, {'title':'[COLOR yellow]Follow me @natko1412[/COLOR]'}, img=icon_path('twitter.png'), fanart=fanart)
    addon.end_of_directory()


elif mode[0]=='keyboard_open':
    keyboard = xbmc.Keyboard('', 'Enter URL:', False)
    keyboard.doModal()
    if keyboard.isConfirmed():
        query = keyboard.getText()
        import liveresolver
        url=query
        resolved = liveresolver.resolve(url)
        xbmc.Player().play(resolved)

elif mode[0] == 'live_sport':
    sources = os.listdir(AddonPath + '/resources/lib/sources/live_sport')
    sources.remove('__init__.py')
    for source in sources:
        if '.pyo' not in source and '__init__' not in source:
            try:
                source = source.replace('.py','')
                exec "from resources.lib.sources.live_sport import %s"%source
                info = eval(source+".info()")
                addon.add_item({'mode': 'open_live_sport', 'site': info.mode}, {'title': info.name}, img=icon_path(info.icon), fanart=fanart,is_folder=True)
            except:
                pass
    addon.end_of_directory()
Пример #36
0
 def resolve(self,url):
     import liveresolver
     return liveresolver.resolve(url,cache_timeout=0)
Пример #37
0
                {
                    'mode': 'play_special_sport',
                    'url': event[0],
                    'title': title,
                    'img': img,
                    'site': site
                }, {'title': event[1]},
                img=img,
                fanart=fanart,
                contextmenu_items=context)
        addon.end_of_directory()
    else:
        for event in events:
            import liveresolver
            try:
                resolved = liveresolver.resolve(event[0])
            except:
                resolved = None
            if resolved:
                player = xbmc.Player()
                li = xbmcgui.ListItem(title)
                li.setThumbnailImage(img)
                player.play(resolved, listitem=li)
                break
        control.infoDialog("No stream found")

elif mode[0] == 'play_special_sport':
    try:
        url = args['url'][0]
        title = args['title'][0]
        img = args['img'][0]
Пример #38
0
elif mode[0]=='my_castaway':
    #addon.add_item({'mode': 'favourites'}, {'title':'Favourites'}, img=icon_path('favourites.jpg'), fanart=fanart,is_folder=True)
    #addon.add_item({'mode': 'my_lists'}, {'title':'My Lists'}, img=icon_path('my_lists.jpg'), fanart=fanart,is_folder=True)
    addon.add_item({'mode': 'keyboard_open'}, {'title':'Open URL'}, img=icon_path('my_castaway.jpg'), fanart=fanart,is_folder=True)
    addon.add_item({'mode': 'x'}, {'title':'[COLOR yellow]Follow me @natko1412[/COLOR]'}, img=icon_path('twitter.png'), fanart=fanart)
    addon.end_of_directory()


elif mode[0]=='keyboard_open':
    keyboard = xbmc.Keyboard('', 'Enter URL:', False)
    keyboard.doModal()
    if keyboard.isConfirmed():
        query = keyboard.getText()
        import liveresolver
        url=query
        resolved = liveresolver.resolve(url,cache_timeout=0)
        xbmc.Player().play(resolved)

elif mode[0] == 'live_sport':
    sources = os.listdir(AddonPath + '/resources/lib/sources/live_sport')
    sources.remove('__init__.py')
    for source in sources:
        if '.pyo' not in source and '__init__' not in source:
            try:
                source = source.replace('.py','')
                exec "from resources.lib.sources.live_sport import %s"%source
                info = eval(source+".info()")
                addon.add_item({'mode': 'open_live_sport', 'site': info.mode}, {'title': info.name}, img=icon_path(info.icon), fanart=fanart,is_folder=True)
            except:
                pass
    addon.end_of_directory()
Пример #39
0
	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
Пример #40
0
                   fanart=fanart,
                   is_folder=True)
    addon.add_item({'mode': 'x'},
                   {'title': '[COLOR yellow]Follow me @natko1412[/COLOR]'},
                   img=icon_path('twitter.png'),
                   fanart=fanart)
    addon.end_of_directory()

elif mode[0] == 'keyboard_open':
    keyboard = xbmc.Keyboard('', 'Enter URL:', False)
    keyboard.doModal()
    if keyboard.isConfirmed():
        query = keyboard.getText()
        import liveresolver
        url = query
        resolved = liveresolver.resolve(url, cache_timeout=0)
        xbmc.Player().play(resolved)

elif mode[0] == 'live_sport':
    sources = os.listdir(AddonPath + '/resources/lib/sources/live_sport')
    sources.remove('__init__.py')
    for source in sources:
        if '.pyo' not in source and '__init__' not in source:
            try:
                source = source.replace('.py', '')
                exec "from resources.lib.sources.live_sport import %s" % source
                info = eval(source + ".info()")
                addon.add_item({
                    'mode': 'open_live_sport',
                    'site': info.mode
                }, {'title': info.name},
Пример #41
0
import xbmc,xbmcaddon,xbmcgui,xbmcplugin,urllib,urllib2,os,re,sys,hashlib
Пример #42
0
    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
Пример #43
0
    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
Пример #44
0
 def resolve(self, url):
     import liveresolver
     return liveresolver.resolve(url)
Пример #45
0
	def resolve(self,url):
		html = client.request(url)
		url = re.findall('(?:\'|\")(https?://(?:www.|)youtube(?:-nocookie)?.com.+?[^\'\"]+)',html)[0]
		url = url.replace('amp;','').replace('-nocookie','')
		import liveresolver
		return liveresolver.resolve(url)
Пример #46
0
def play(url):
	resolved = liveresolver.resolve(url)
	item = xbmcgui.ListItem(path=resolved)
	xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
Пример #47
0
 def resolve(self, url):
     if url.endswith('.ts') or 'bit.ly' in url:
         return url
     else:
         import liveresolver
         return liveresolver.resolve(url)