def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) #find key try: html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #get stream url from api api = 'http://www.nowvideo.sx/api/player.api.php?key=%s&file=%s' % (filekey, media_id) html = self.net.http_GET(api).content r = re.search('url=(.+?)&title', html) if r: stream_url = urllib.unquote(r.group(1)) else: r = re.search('file no longer exists',html) if r: raise Exception ('File Not Found or removed') raise Exception ('Failed to parse url') return stream_url except urllib2.URLError, e: common.addon.log_error('Nowvideo: got http error %d fetching %s' % (e.code, web_url)) return self.unresolvable(code=3, msg=e)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) # grab stream details html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "vars.key") error_url = None stream_url = None # try to resolve 3 times then give up for x in range(0, 2): link = self.__get_stream_url(media_id, filekey, error_num=x, error_url=error_url) if link: active = self.__is_stream_url_active(link) if active: stream_url = urllib.unquote(link) break else: # link inactive error_url = link else: # no link found raise ResolverError('File Not Found or removed') if stream_url: return stream_url else: raise ResolverError('File Not Found or removed')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) try: html = self.net.http_GET(web_url).content r = re.search('<param name="src" value="(.+?)"', html) if r: stream_url = r.group(1) else: html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") player_url = 'http://www.divxstage.eu/api/player.api.php?user=undefined&key='+filekey+'&pass=undefined&codes=1&file='+media_id html = self.net.http_GET(player_url).content r = re.search('url=(.+?)&', html) if r: stream_url = r.group(1) else: raise Exception ('File Not Found or removed') return stream_url except urllib2.URLError, e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, web_url)) common.addon.show_small_popup('Error','Http error: '+str(e), 5000, error_logo) return self.unresolvable(code=3, msg=e)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) #find key try: html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #get stream url from api api = 'http://www.nowvideo.sx/api/player.api.php?key=%s&file=%s' % ( filekey, media_id) html = self.net.http_GET(api).content r = re.search('url=(.+?)&title', html) if r: stream_url = urllib.unquote(r.group(1)) else: r = re.search('file no longer exists', html) if r: raise Exception('File Not Found or removed') return stream_url except urllib2.URLError, e: common.addon.log_error('Nowvideo: got http error %d fetching %s' % (e.code, web_url)) return False
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) dialog = xbmcgui.Dialog() #grab stream details try: html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #use api to find stream address api_call = ('http://www.videoweed.es/api/player.api.php?user=undefined&codes=1&file=%s' + '&pass=undefined&key=%s') % (media_id, filekey) api_html = self.net.http_GET(api_call).content rapi = re.search('url=(.+?)&title=', api_html) if rapi: stream_url = rapi.group(1) else: raise Exception ('File Not Found or removed') return stream_url except urllib2.URLError, e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, web_url)) common.addon.show_small_popup('Error','Http error: '+str(e), 8000, error_logo) return self.unresolvable(code=3, msg=e)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) """ Human Verification """ try: self.net.http_HEAD(web_url) html = self.net.http_GET(web_url).content """movshare can do both flv and avi. There is no way I know before hand if the url going to be a flv or avi. So the first regex tries to find the avi file, if nothing is present, it will check for the flv file. "param name="src" is for avi "flashvars.file=" is for flv """ r = re.search('<param name="src" value="(.+?)"', html) if not r: html = unwise.unwise_process(html) html = re.compile(r'eval\(function\(p,a,c,k,e,(?:d|r)\).+?\.split\(\'\|\'\).*?\)\)').search(html).group() html = jsunpack.unpack(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #get stream url from api api = 'http://www.movshare.net/api/player.api.php?key=%s&file=%s' % (filekey, media_id) html = self.net.http_GET(api).content r = re.search('url=(.+?)&title', html) if r: stream_url = r.group(1) else: raise Exception ('File Not Found or removed') return stream_url except urllib2.URLError, e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, web_url)) common.addon.show_small_popup('Error','Http error: '+str(e), 5000, error_logo) return self.unresolvable(code=3, msg=e)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) try: html = self.net.http_GET(web_url).content r = re.search('<param name="src" value="(.+?)"', html) if r: stream_url = r.group(1) else: html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") player_url = 'http://www.divxstage.eu/api/player.api.php?user=undefined&key=' + filekey + '&pass=undefined&codes=1&file=' + media_id html = self.net.http_GET(player_url).content r = re.search('url=(.+?)&', html) if r: stream_url = r.group(1) else: raise Exception('File Not Found or removed') return stream_url except urllib2.URLError, e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, web_url)) common.addon.show_small_popup('Error', 'Http error: ' + str(e), 5000, error_logo) return self.unresolvable(code=3, msg=e)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) dialog = xbmcgui.Dialog() #grab stream details try: html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #use api to find stream address api_call = ( 'http://www.cloudy.ec/api/player.api.php?user=undefined&codes=1&file=%s' + '&pass=undefined&key=%s') % (media_id, filekey) api_html = self.net.http_GET(api_call).content rapi = re.search('url=(.+?)&title=', api_html) if rapi: stream_url = urllib.unquote(rapi.group(1)) else: raise Exception('File Not Found or removed') return stream_url except urllib2.URLError, e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, web_url)) common.addon.show_small_popup('Error', 'Http error: ' + str(e), 8000, error_logo) return self.unresolvable(code=3, msg=e)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #use api to find stream address api_call = ('http://www.videoweed.es/api/player.api.php?user=undefined&codes=1&file=%s' + '&pass=undefined&key=%s') % (media_id, filekey) api_html = self.net.http_GET(api_call).content rapi = re.search('url=(.+?)&title=', api_html) if rapi: stream_url = rapi.group(1) else: raise UrlResolver.ResolverError('File Not Found or removed') return stream_url
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content r = re.search('<param name="src" value="(.+?)"', html) if r: stream_url = r.group(1) else: html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") player_url = 'http://www.cloudtime.to/api/player.api.php?user=undefined&key=' + filekey + '&pass=undefined&codes=1&file=' + media_id html = self.net.http_GET(player_url).content r = re.search('url=(.+?)&', html) if r: stream_url = r.group(1) else: raise UrlResolver.ResolverError('File Not Found or removed') return stream_url
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #get stream url from api api = 'http://www.novamov.com/api/player.api.php?key=%s&file=%s' % (filekey, media_id) html = self.net.http_GET(api).content r = re.search('url=(.+?)&title', html) if r: stream_url = urllib.unquote(r.group(1)) else: r = re.search('file no longer exists', html) if r: raise UrlResolver.ResolverError('File Not Found or removed') raise UrlResolver.ResolverError('Failed to parse url') return stream_url
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) dialog = xbmcgui.Dialog() #grab stream details try: html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") error_url = None stream_url = None # try to resolve 3 times then give up for x in range(0, 2): link = self.__get_stream_url(media_id, filekey, error_num=x, error_url=error_url) if link: active = self.__is_stream_url_active(link) if active: stream_url = urllib.unquote(link) break else: # link inactive error_url = link else: # no link found raise Exception('File Not Found or removed') if stream_url: return stream_url else: raise Exception('File Not Found or removed') except urllib2.URLError, e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, web_url)) common.addon.show_small_popup('Error', 'Http error: ' + str(e), 8000, error_logo) return self.unresolvable(code=3, msg=e)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #use api to find stream address api_call = ( 'http://www.videoweed.es/api/player.api.php?user=undefined&codes=1&file=%s' + '&pass=undefined&key=%s') % (media_id, filekey) api_html = self.net.http_GET(api_call).content rapi = re.search('url=(.+?)&title=', api_html) if rapi: stream_url = rapi.group(1) else: raise UrlResolver.ResolverError('File Not Found or removed') return stream_url
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") #get stream url from api api = 'http://www.novamov.com/api/player.api.php?key=%s&file=%s' % ( filekey, media_id) html = self.net.http_GET(api).content r = re.search('url=(.+?)&title', html) if r: stream_url = urllib.unquote(r.group(1)) else: r = re.search('file no longer exists', html) if r: raise UrlResolver.ResolverError('File Not Found or removed') raise UrlResolver.ResolverError('Failed to parse url') return stream_url
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) dialog = xbmcgui.Dialog() #grab stream details try: html = self.net.http_GET(web_url).content html = unwise.unwise_process(html) filekey = unwise.resolve_var(html, "flashvars.filekey") error_url = None stream_url = None # try to resolve 3 times then give up for x in range(0, 2): link = self.__get_stream_url(media_id, filekey, error_num=x, error_url=error_url) if link: active = self.__is_stream_url_active(link) if active: stream_url = urllib.unquote(link) break; else: # link inactive error_url = link else: # no link found raise Exception ('File Not Found or removed') if stream_url: return stream_url else: raise Exception ('File Not Found or removed') except urllib2.URLError, e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, web_url)) common.addon.show_small_popup('Error','Http error: '+str(e), 8000, error_logo) return self.unresolvable(code=3, msg=e)