def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html) data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content html = helpers.add_packed_data(html) match = re.search('name="src"\s*value="([^"]+)', html) if match: return match.group(1) # try to find source in html match = re.search('<span[^>]*>\s*<a\s+href="([^"]+)', html, re.DOTALL) if match: return match.group(1) tries += 1 raise ResolverError( 'Unable to resolve kingfiles link. Filelink not found.')
def get_media_url(self, host, media_id): try: web_url = self.get_url(host, media_id) headers = {'User-Agent': common.FF_USER_AGENT} html = self.net.http_GET(web_url, headers=headers).content html = helpers.add_packed_data(html) print html sources = [] for match in re.finditer( 'file:\s*"([^"]+)"\s*,\s*label:\s*"([^"]+)', html): stream_url, label = match.groups() sources.append((label, stream_url)) print sources sources = sorted(sources, key=lambda x: x[0])[::-1] headers = { "Referer": "http://static.vidto.me/player7.9.3/jwplayer.flash.swf" } time.sleep(3) return helpers.pick_source(sources) + helpers.append_headers( headers) #return helpers.pick_source(sources) except: raise ResolverError("File Link Not Found")
def get_media_url(self, host, media_id): # need fix web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content data = helpers.get_hidden(html) furl = 'http://happystreams.net/dl' headers = {'User-Agent': common.FF_USER_AGENT, 'Referer': web_url, 'Cookie': self.__get_cookies(host, html)} html = self.net.http_POST(url=furl, form_data=data, headers=headers).content html = helpers.add_packed_data(html) source = re.search(r'file:\"(.*?)\"', html).groups()[0] return source
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) self.headers['Referer'] = web_url html = self.net.http_GET(web_url, headers=self.headers).content html = helpers.add_packed_data(html) match = re.search('vurl\d+="([^"]+)', html) if match: self.headers.update({'Referer': web_url}) return match.group(1) + helpers.append_headers(self.headers) else: raise ResolverError('File 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} html = self.net.http_GET(web_url, headers=headers).content html = helpers.add_packed_data(html) sources = [] for match in re.finditer('label:\s*"([^"]+)"\s*,\s*file:\s*"([^"]+)', html): label, stream_url = match.groups() sources.append((label, stream_url)) sources = sorted(sources, key=lambda x: x[0])[::-1] print helpers.pick_source(sources) + helpers.append_headers(headers)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'User-Agent': common.IE_USER_AGENT, 'Referer': web_url} html = self.net.http_GET(web_url, headers=headers).content iframe = re.findall('<iframe\s+src\s*=\s*"([^"]+)', html, re.DOTALL)[0] if iframe: html = self.net.http_GET(iframe, headers=headers).content html = helpers.add_packed_data(html) sources = helpers.scrape_sources(html, result_blacklist=['dl']) return helpers.pick_source(sources) + helpers.append_headers(headers)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'User-Agent': common.FF_USER_AGENT} html = self.net.http_GET(web_url, headers=headers).content html = helpers.add_packed_data(html) sources = [] for match in re.finditer('label:\s*"([^"]+)"\s*,\s*file:\s*"([^"]+)', html): label, stream_url = match.groups() sources.append((label, stream_url)) sources = sorted(sources, key=lambda x: x[0])[::-1] return helpers.pick_source(sources) + helpers.append_headers(headers) raise ResolverError("File Link Not Found")
def get_media_url(url): try: hostname = urlparse.urlparse(url).hostname headers = {'User-Agent': common.FF_USER_AGENT} html = net.http_GET(url, headers=headers).content headers.update({'Referer': url}) for match in re.finditer('''<script[^>]*src=["']([^'"]+)''', html): _html = get_js(match.group(1), headers, hostname) match = re.search('''href=['"]([^'"]+)''', html) if match: playvid_url = match.group(1) html = net.http_GET(playvid_url, headers=headers).content headers.update({'Referer': playvid_url}) for match in re.finditer('''<script[^>]*src=["']([^'"]+)''', html): js = get_js(match.group(1), headers, hostname) match = re.search( '''!=\s*null.*?get\(['"]([^'"]+).*?\{([^:]+)''', js, re.DOTALL) if match: fx_url, fx_param = match.groups() fx_url = resolve_url( urlparse.urljoin('http://www.flashx.tv', fx_url) + '?' + urllib.urlencode({fx_param: 1})) common.log_utils.log('fxurl: %s' % (fx_url)) _html = net.http_GET(fx_url, headers=headers).content headers.update({'Referer': url}) html = net.http_GET(playvid_url, headers=headers).content html = helpers.add_packed_data(html) common.log_utils.log(html) sources = helpers.parse_sources_list(html) 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, 'Accept': '*/*'} html = self.net.http_GET(web_url, headers=headers).content html = helpers.add_packed_data(html) match = re.findall('[\'"]?file[\'"]?\s*:\s*[\'"]([^\'"]+)', html) if match: stream_url = [i for i in match if i.endswith('.mp4')] if stream_url: match = re.search("\$\.get\('([^']+)", html) if match: headers.update({'Referer': web_url, 'X-Requested-With': 'XMLHttpRequest'}) self.net.http_GET(match.group(1), headers=headers) # returned stream still doesn't work, probably either a header issue or a pre-http call needed # commenting out until someone else can fix it # return stream_url[0] + helpers.append_headers({'User-Agent': common.FF_USER_AGENT}) raise ResolverError('File 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, 'Referer': web_url} html = self.net.http_GET(web_url, headers=headers).content html = helpers.add_packed_data(html) match = re.search('playlist\s*:\s*"([^"]+)', html) if match: xml = self.net.http_GET(match.group(1), headers=headers).content count = 1 sources = [] streams = set() for match in re.finditer('''file="([^'"]*mp4)''', xml): stream_url = match.group(1) if stream_url not in streams: sources.append(('Source %s' % (count), stream_url)) streams.add(stream_url) count += 1 return helpers.pick_source(sources) + helpers.append_headers(headers)
def get_media_url(self, host, media_id): try: web_url = self.get_url(host, media_id) headers = {'User-Agent': common.FF_USER_AGENT} html = self.net.http_GET(web_url, headers=headers).content html = helpers.add_packed_data(html) print html sources = [] for match in re.finditer('file:\s*"([^"]+)"\s*,\s*label:\s*"([^"]+)', html): stream_url,label = match.groups() sources.append((label, stream_url)) print sources sources = sorted(sources, key=lambda x: x[0])[::-1] headers = {"Referer":"http://static.vidto.me/player7.9.3/jwplayer.flash.swf"} time.sleep(3) return helpers.pick_source(sources) + helpers.append_headers(headers) #return helpers.pick_source(sources) except: raise ResolverError("File Link 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, 'Accept': '*/*'} html = self.net.http_GET(web_url, headers=headers).content html = helpers.add_packed_data(html) match = re.findall('[\'"]?file[\'"]?\s*:\s*[\'"]([^\'"]+)', html) if match: stream_url = [i for i in match if i.endswith('.mp4')] if stream_url: match = re.search("\$\.get\('([^']+)", html) if match: headers.update({ 'Referer': web_url, 'X-Requested-With': 'XMLHttpRequest' }) self.net.http_GET(match.group(1), headers=headers) # returned stream still doesn't work, probably either a header issue or a pre-http call needed # commenting out until someone else can fix it # return stream_url[0] + helpers.append_headers({'User-Agent': common.FF_USER_AGENT}) raise ResolverError('File not found')
def get_media_url(url): try: hostname = urlparse.urlparse(url).hostname headers = {'User-Agent': common.FF_USER_AGENT} html = net.http_GET(url, headers=headers).content headers.update({'Referer': url}) for match in re.finditer('''<script[^>]*src=["']([^'"]+)''', html): _html = get_js(match.group(1), headers, hostname) match = re.search('''href=['"]([^'"]+)''', html) if match: playvid_url = match.group(1) html = net.http_GET(playvid_url, headers=headers).content headers.update({'Referer': playvid_url}) for match in re.finditer('''<script[^>]*src=["']([^'"]+)''', html): js = get_js(match.group(1), headers, hostname) match = re.search('''!=\s*null.*?get\(['"]([^'"]+).*?\{([^:]+)''', js, re.DOTALL) if match: fx_url, fx_param = match.groups() fx_url = resolve_url(urlparse.urljoin('http://www.flashx.tv', fx_url) + '?' + urllib.urlencode({fx_param: 1})) common.log_utils.log('fxurl: %s' % (fx_url)) _html = net.http_GET(fx_url, headers=headers).content headers.update({'Referer': url}) html = net.http_GET(playvid_url, headers=headers).content html = helpers.add_packed_data(html) common.log_utils.log(html) sources = helpers.parse_sources_list(html) 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) html = self.net.http_GET(web_url).content tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html) data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content html = helpers.add_packed_data(html) match = re.search('name="src"\s*value="([^"]+)', html) if match: return match.group(1) # try to find source in html match = re.search('<span[^>]*>\s*<a\s+href="([^"]+)', html, re.DOTALL) if match: return match.group(1) tries += 1 raise ResolverError('Unable to resolve kingfiles link. Filelink not found.')