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) """ 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) 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) 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(url): try: hostname = urlparse.urlparse(url).hostname media_id = re.search('embed.php\?c=(.*)', url).group(1) headers = {'User-Agent': common.IE_USER_AGENT} html = net.http_GET(url, headers=headers).content adblock_check(html, headers) headers.update({'Referer': url}) for js_url in get_js_url(html): js = get_js(js_url, headers, hostname) js = unwise.unwise_process(js) adblock_check(js, headers) xhr_check(js, headers) html = cleanse_html(html) for match in re.finditer('''href=['"]([^'"]+)''', html): playvid_url = match.group(1) if '-%s.' % (media_id) in playvid_url: headers.update({'Referer': url}) html = net.http_GET(playvid_url, headers=headers).content common.log_utils.log(html) html = cleanse_html(html) headers['Referer'] = playvid_url sources = [] spans = get_span_ids(html, media_id) for match in re.finditer('<script[^>]*>\s*(eval\(function.*?)</script>', html, re.DOTALL): js_data = jsunpack.unpack(match.group(1)) if not spans or any(span_id in js_data for span_id in spans): js_sources = helpers.parse_sources_list(js_data) sources += js_sources d = {} for source in sources: d[source[1]] = d.setdefault(source[1], 0) + 1 common.log_utils.log(sources) sources = [source for source in sources if d[source[1]] == 1] common.log_utils.log(sources) sources = [source for source in sources if not any([x in source[1].lower() for x in ('/movie.mp4', '/trailer.mp4', '://cdn.flashx.tv')])] common.log_utils.log(sources) sources = [source for source in sources if check_headers(source, headers)] common.log_utils.log(sources) try: sources.sort(key=lambda x: SORT_KEY.get(x[0], 0), reverse=True) except: pass source = helpers.pick_source(sources) return source + helpers.append_headers(headers) except Exception as e: common.log_utils.log_debug('Exception during flashx resolve parse: %s' % e) raise raise ResolverError('Unable to resolve flashx link. Filelink not found.')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'User-Agent': common.FF_USER_AGENT} response = self.net.http_GET(web_url, headers=headers) headers['Referer'] = 'https://embed.%s/' % host html = response.content html = unwise.unwise_process(html) r = re.search("Clappr.+?source:\s*'([^']+)", html) if r: strurl = r.group(1) + helpers.append_headers(headers) else: raise ResolverError('File Not Found or removed') return strurl
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'User-Agent': common.FF_USER_AGENT} response = self.net.http_GET(web_url, headers=headers) headers['Referer'] = 'https://embed.videozupload.net/' html = response.content html = unwise.unwise_process(html) r = re.search("Clappr.+?source:\s*'([^']+)",html) if r: strurl = r.group(1) + helpers.append_headers(headers) else: raise ResolverError('File Not Found or removed') return strurl
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) 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) 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)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = { 'User-Agent': common.FF_USER_AGENT, 'Referer': 'https://waaw.tv/watch_video.php?v=%s&post=1' % media_id } html = self.net.http_GET(web_url, headers=headers).content if html: try: data_unwise = unwise.unwise_process(html) try: at = re.search('&at=(.*?)&', data_unwise, re.I).groups()[0] except: at = "" try: http_referer = re.search('&http_referer=(.*?)&', data_unwise, re.I).groups()[0] except: http_referer = "" player_url = "http://hqq.watch/sec/player/embed_player.php?iss=&vid=%s&at=%s&autoplayed=yes&referer=on&http_referer=%s&pass=&embed_from=&need_captcha=0&hash_from=&secured=0" % ( media_id, at, http_referer) headers.update({'Referer': web_url}) data_player = self.net.http_GET(player_url, headers=headers).content data_unescape = re.findall( 'document.write\(unescape\("([^"]+)"', data_player) data = "" for d in data_unescape: data += urllib.unquote(d) data_unwise_player = "" wise = "" wise = re.search( '''<script type=["']text/javascript["']>\s*;?(eval.*?)</script>''', data_player, re.DOTALL | re.I) if wise: data_unwise_player = unwise.unwise_process(data_player) try: vars_data = re.search('/player/get_md5.php",\s*\{(.*?)\}', data, re.DOTALL | re.I).groups()[0] except: vars_data = "" matches = re.findall('\s*([^:]+):\s*([^,]*)[,"]', vars_data) params = {} for key, value in matches: if key == "adb": params[key] = "0/" elif '"' in value: params[key] = value.replace('"', '') else: try: value_var = re.search( 'var\s*%s\s*=\s*"([^"]+)"' % value, data, re.I).groups()[0] except: value_var = "" if not value_var and data_unwise_player: try: value_var = \ re.search('var\s*%s\s*=\s*"([^"]+)"' % value, data_unwise_player, re.I).groups()[0] except: value_var = "" params[key] = value_var params = urllib.urlencode(params) headers.update({ 'X-Requested-With': 'XMLHttpRequest', 'Referer': player_url }) data = "" data = self.net.http_GET( "http://hqq.watch/player/get_md5.php?" + params, headers=headers).content url_data = json.loads(data) media_url = "https:" + self.tb(url_data["obf_link"].replace( "#", "")) + ".mp4.m3u8" if media_url: del headers['X-Requested-With'] headers.update({'Origin': 'https://hqq.watch'}) return media_url + helpers.append_headers(headers) except Exception as e: raise ResolverError(e) raise ResolverError('Video not found')