Exemplo n.º 1
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 ''
Exemplo n.º 2
0
def resolve(url):
    try:
        if '.mp4' in url:
            url = url.replace('https', 'http')
            url += '|%s' % urllib.urlencode(
                {
                    'User-agent': client.agent(),
                    'X-requested-with': constants.get_shockwave()
                })
            return url
        if url.startswith('//'):
            url = 'http:' + url
        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')
        link = linklist[0]
        url = base + link['url']
        return url.replace('https', 'http')
    except:
        return
Exemplo n.º 3
0
 def links(self, url, img=' '):
     out = []
     ref = url
     orig_title = xbmc.getInfoLabel('ListItem.Title')
     html = client.request(url)
     link = re.findall("src='(https://videoapi.my.mail.ru/.+?)'", html)[0]
     link = link.replace('https://videoapi.my.mail.ru/videos/embed/mail/',
                         'http://videoapi.my.mail.ru/videos/mail/')
     link = link.replace('html', 'json')
     cookieJar = cookielib.CookieJar()
     opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookieJar),
                                   urllib2.HTTPHandler())
     conn = urllib2.Request(link)
     connection = opener.open(conn)
     f = connection.read()
     connection.close()
     js = json.loads(f)
     for cookie in cookieJar:
         token = cookie.value
     js = js['videos']
     for x in js:
         url = x['url']
         host = urlparse.urlparse(url).netloc
         url = url + '|%s' % (urllib.urlencode(
             {
                 'Cookie': 'video_key=%s' % token,
                 'User-Agent': client.agent(),
                 'Referer': ref,
                 'Host': host,
                 'X-Requested-With': constants.get_shockwave()
             }))
         title = orig_title + ' ' + x['key']
         out.append((title, url, img))
     return out
Exemplo n.º 4
0
def resolve(url):
	try:
		if '.mp4' in url:
			url = url.replace('https','http')
			url += '|%s' % urllib.urlencode({'User-agent':client.agent(),'X-requested-with':constants.get_shockwave()})
			return url
		if url.startswith('//'):
			url = 'http:' + url
		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')
		link = linklist[0]
		url = base + link['url']
		return url.replace('https','http')
	except:
		return
Exemplo n.º 5
0
	def resolve(self,url):
		try:
			url = self.base + url
			html = client.request(url)
			url = 'http:/' + re.findall('src=[\"\']([^\"\']+)[\"\'].+?mpeg',html)[0]
			url += '|%s' % urllib.urlencode({'X-Requested-With':constants.get_shockwave(),'User-agent':client.agent()})
			return url
		except:
			return url
Exemplo n.º 6
0
	def resolve(self,url):
		try:
			url = self.base + url
			html = client.request(url)
			url = 'http:/' + re.findall('src=[\"\']([^\"\']+)[\"\'].+?mpeg',html)[0]
			url += '|%s' % urllib.urlencode({'X-Requested-With':constants.get_shockwave(),'User-agent':client.agent()})
			return url
		except:
			return url
Exemplo n.º 7
0
	def links(self,url, img=' '):
		out=[]
		ref=url
		orig_title = xbmc.getInfoLabel('ListItem.Title')
		html = client.request(url)
		link = re.findall("src='(https://videoapi.my.mail.ru/.+?)'",html)[0]
		link = link.replace('https://videoapi.my.mail.ru/videos/embed/mail/','http://videoapi.my.mail.ru/videos/mail/')
		link = link.replace('html','json')
		cookieJar = cookielib.CookieJar()
		opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookieJar), urllib2.HTTPHandler())
		conn = urllib2.Request(link)
		connection = opener.open(conn)
		f = connection.read()
		connection.close()
		js = json.loads(f)
		for cookie in cookieJar:
			token = cookie.value
		js = js['videos']
		for x in js:
			url = x['url'] 
			host  = urlparse.urlparse(url).netloc
			url = url + '|%s'%(urllib.urlencode({'Cookie':'video_key=%s'%token, 'User-Agent':client.agent(), 'Referer':ref, 'Host':host, 'X-Requested-With':constants.get_shockwave()} ))
			title = orig_title + ' ' + x['key']
			out.append((title,url,img))
		return out
Exemplo n.º 8
0
def parse_biggestplayer(params):
    try:
        url = params["url"]
        ref = url
        referer = params["referer"]
                
        html = client.request(url,referer=referer)
        url = re.search('file: "(.+?)"', html).group(1)
        url += '|%s' %urllib.urlencode({'User-agent':client.agent(),'Referer':ref,'X-Requested-With':constants.get_shockwave()})
        return url
    except:
        return ""