def get_media_url(url, media_id): headers = {'User-Agent': common.RAND_UA} html = net.http_GET(url, headers=headers).content if html: html = html.encode('utf-8') aa_text = re.findall("""(゚ω゚ノ\s*=\s*/`m´\s*)\s*ノ.+?)</SCRIPT>""", html, re.I) if aa_text: try: aa_decoded = '' for i in aa_text: try: aa_decoded += str(aadecode.decode(re.sub('\(+゚Д゚\)+\s*\[゚o゚\]\)*\s*\+(.+?)\(+゚Д゚\s*\)+\[゚o゚\]\)+', r'(゚Д゚)[゚o゚]+\1(゚Д゚)[゚o゚])', i))) except: pass href = re.search("""\.location\s*=\s*['"]\/([^"']+)""", aa_decoded) if href: href = href.group(1) if href.startswith("http"): location = href elif href.startswith("//"): location = "http:%s" % href else: location = "http://www.speedvid.net/%s" % href headers.update({'Referer': url, 'Cookie': str((int(math.floor((900-100)*random())+100))*(int(time.time()))*(128/8))}) _html = net.http_GET(location, headers=headers).content sources = helpers.scrape_sources(_html, patterns=['''file\s*:\s*.["'](?P<url>(?=http://s(?:02|06))[^"']+)''']) if sources: del headers['Cookie'] headers.update({'Referer': location}) return helpers.pick_source(sources) + helpers.append_headers(headers) except Exception as e: raise ResolverError(e) 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.RAND_UA} html = self.net.http_GET(web_url, headers=headers).content if html: file_id = re.search("file_id',\s*'([^']+)", html) if file_id: headers.update( {'cookie': 'lang=1; file_id={}'.format(file_id.group(1))}) html = self.net.http_GET(web_url, headers=headers).content else: html = None if html: html = html.encode('utf-8') aa_text = re.search("""(゚ω゚ノ\s*=\s*/`m´\s*)\s*ノ.+?;)\svar""", html, re.I) if aa_text: try: aa_decoded = str(aadecode.decode(aa_text.group(1))) except: raise ResolverError('Error decoding') sources = helpers.scrape_sources(aa_decoded) if sources: headers.update({'Referer': web_url}) return helpers.pick_source( sources) + helpers.append_headers(headers) raise ResolverError('Video not found')
def get_video_url(page_url, url_referer=''): logger.info("(page_url='%s')" % page_url) video_urls = [] page_url = page_url.replace('speedvid.net', 'speedvideo.net') data = httptools.downloadpage(page_url).data # ~ logger.debug(data) if data == 'File was deleted': return 'El archivo no existe o ha sido eliminado' js = scrapertools.find_single_match(data, "<script type='text/javascript'>\s*゚ω゚(.*?)</script>") if js: decoded = aadecode.decode(js) # ~ logger.debug(decoded) # ~ url = 'http://speedvid.net' + scrapertools.find_single_match(decoded, "'([^']+)") url = 'http://speedvideo.net' + scrapertools.find_single_match(decoded, "'([^']+)") data = httptools.downloadpage(url).data # ~ logger.debug(data) packeds = scrapertools.find_multiple_matches(data, "<script type='text/javascript'>(eval.function.p,a,c,k,e,d..*?)</script>") for packed in packeds: unpacked = jsunpack.unpack(packed) # ~ logger.debug(unpacked) url = scrapertools.find_single_match(unpacked, "http://[^\\\\]+/v\.mp4") if url != '': video_urls.append(['mp4', url]) return video_urls
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'User-Agent': common.RAND_UA} html = self.net.http_GET(web_url, headers=headers).content if html: file_id = re.search("file_id',\s*'([^']+)",html) if file_id: headers.update({'cookie': 'lang=1; file_id={}'.format(file_id.group(1))}) html = self.net.http_GET(web_url, headers=headers).content else: html = None if html: html = html.encode('utf-8') aa_text = re.search("""(゚ω゚ノ\s*=\s*/`m´\s*)\s*ノ.+?;)\svar""", html, re.I) if aa_text: try: aa_decoded = str(aadecode.decode(aa_text.group(1))) except: raise ResolverError('Error decoding') sources = helpers.scrape_sources(aa_decoded) if sources: headers.update({'Referer': web_url}) return helpers.pick_source(sources) + helpers.append_headers(headers) raise ResolverError('Video not found')
def get_video_url(page_url, premium=False, user="", password="", video_password=""): global data logger.debug("URL", page_url) video_urls = [] packed = support.match( data, patron=r"(eval\(function\(p,a,c,k,e,d\).*?)\s*<").match unpack = jsunpack.unpack(packed) for m in support.match(unpack, patron='var (\w+)="([^"]+)').matches: globals()[m[0]] = m[1] videojs = httptools.downloadpage( 'https://userload.co/api/assets/userload/js/videojs.js').data videojs_decoded = aadecode.decode(videojs) post = eval( support.match(videojs_decoded, patron="t.send\(([^\)]+)").match) logger.debug(post) url = support.match('https://userload.co/api/request/', post=post, patron=r'([^\s\r\n]+)').match if url: video_urls.append(["{} [Userload]".format(url.split('.')[-1]), url]) return video_urls
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'Referer': web_url, 'User-Agent': common.FF_USER_AGENT} html = self.net.http_GET(web_url, headers=headers).content try: html = html.encode('utf-8') except: pass if "This video doesn't exist." in html: raise ResolverError('The requested video was not found.') match = re.search("split\('\|'\)\)\)\s*(.*?)</script>", html) if match: aa_text = aadecode.decode(match.group(1)) match = re.search("'([^']+)", aa_text) if match: stream_url = match.group(1) return stream_url + helpers.append_headers({'User-Agent': common.FF_USER_AGENT}) raise ResolverError('Video Link Not Found')
def get_video_url(item): logger.trace() itemlist = list() url = item.url data = httptools.downloadpage(url).data if 'File Not Found' in data: return ResolveError(0) headers = {'referer': url} for i in range(0, 3): if '゚ω゚ノ' in data: break else: url = scrapertools.find_single_match(data, '"iframe" src="([^"]+)') if not url: url = scrapertools.find_single_match( data, '<input type="hidden" id="link" value="([^"]+)') data = httptools.downloadpage(url, headers=headers).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) try: text_decode = aadecode.decode( scrapertools.find_single_match( data, '(?s)<script>\s*゚ω゚(.*?)</script>').strip()) clave = scrapertools.find_single_match( text_decode, "func\.innerHTML\s?=[^(]+\('([^']+)") func = base64.b64decode( scrapertools.find_single_match( data, '<input type="hidden" value="([^"]+)" id="func"')) js = base64.b64decode( scrapertools.find_single_match( data, '<input type="hidden" value="([^"]+)" id="js"')) res = js2py.eval_js(re.sub(r'function (\w+)', 'function res', js)) itemlist.append( Video(url=scrapertools.find_single_match( res(clave, func), "source.setAttribute\('src', '([^']+)'"))) return itemlist except Exception, e: return e
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'Referer': web_url, 'User-Agent': common.FF_USER_AGENT} html = self.net.http_GET(web_url, headers=headers).content if "unable to find the video" in html: raise ResolverError( 'The requested video was not found or may have been removed.') match = re.search(r'type="file".+?script>\s*([^<]+)', html, re.DOTALL) if match: aa_text = aadecode.decode(match.group(1).encode('utf8')) match = re.search(r"atob\('([^']+)", aa_text) if match: etext = match.group(1).decode("base64") secret = self.vv_secret(html) stream_url = self.vv_decrypt(secret, etext) return stream_url + helpers.append_headers(headers) raise ResolverError('Video Link Not Found')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'Referer': web_url, 'User-Agent': common.FF_USER_AGENT} html = self.net.http_GET(web_url, headers=headers).content try: html = html.encode('utf-8') except: pass if "unable to find the video" in html: raise ResolverError( 'The requested video was not found or may have been removed.') match = re.search(r'type="file".+?script>\s*([^<]+)', html) if match: aa_text = aadecode.decode(match.group(1)) match = re.search(r"'src',\s*'([^']+)", aa_text) if match: stream_url = match.group(1) return stream_url + helpers.append_headers(headers) raise ResolverError('Video Link Not Found')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'Referer': web_url, 'User-Agent': common.FF_USER_AGENT} html = self.net.http_GET(web_url, headers=headers).content try: html = html.encode('utf-8') except: pass if "This video doesn't exist." in html: raise ResolverError('The requested video was not found.') match = re.search("split\('\|'\)\)\)\s*(.*?)</script>", html) if match: aa_text = aadecode.decode(match.group(1)) match = re.search("'([^']+)", aa_text) if match: stream_url = match.group(1) return stream_url + helpers.append_headers( {'User-Agent': common.FF_USER_AGENT}) raise ResolverError('Video Link Not Found')
def get_media_url(url, media_id): headers = {'User-Agent': common.RAND_UA} html = net.http_GET(url, headers=headers).content if html: html = html.encode('utf-8') aa_text = re.findall("""(゚ω゚ノ\s*=\s*/`m´\s*)\s*ノ.+?)</SCRIPT>""", html, re.I) if aa_text: try: aa_decoded = '' for i in aa_text: try: aa_decoded += str( aadecode.decode( re.sub( '\(+゚Д゚\)+\s*\[゚o゚\]\)*\s*\+(.+?)\(+゚Д゚\s*\)+\[゚o゚\]\)+', r'(゚Д゚)[゚o゚]+\1(゚Д゚)[゚o゚])', i))) except: pass href = re.search("""location\.href=.*/(.*?html)""", aa_decoded) if href: href = href.group(1) if href.startswith("http"): location = href elif href.startswith("//"): location = "http:%s" % href else: location = "http://www.speedvid.net/%s" % href headers.update({ 'Referer': url, 'Cookie': str((int(math.floor((900 - 100) * random()) + 100)) * (int(time.time())) * (128 / 8)) }) _html = net.http_GET(location, headers=headers).content output = re.findall("""file :.*'(.*?)'""", str(_html))[0] return output except Exception as e: raise ResolverError(e) raise ResolverError('File not found')