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(aa_decoder.AADecoder(re.sub('\(+゚Д゚\)+\s*\[゚o゚\]\)*\s*\+(.+?)\(+゚Д゚\s*\)+\[゚o゚\]\)+', r'(゚Д゚)[゚o゚]+\1(゚Д゚)[゚o゚])', i)).decode()) 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(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.search( """(゚ω゚ノ=\s*/`m´)ノ\s*~┻━┻\s*//\*´∇`\*/\s*\['_'\];\s*o=\(゚ー゚\)\s*=_=3;.+?)</SCRIPT>""", html, re.I) if aa_text: try: aa_decoded = aa_decoder.AADecoder( re.sub('\(+゚Д゚\)+\[゚o゚\]\)*\+\s*', '(゚Д゚)[゚o゚]+ ', aa_text.group(1))).decode() href = re.search("""href\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}) _html = net.http_GET(location, headers=headers).content sources = helpers.scrape_sources( _html, patterns=[ '''file:["'](?P<url>(?!http://s(?:13|35|51|57|58|59))[^"']+)''' ]) if sources: headers.update({'Referer': location}) return helpers.pick_source( sources) + helpers.append_headers(headers) except: pass raise ResolverError('File 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 = aa_decoder.AADecoder(match.group(1)).decode() match = re.search("'([^']+)", aa_text) if match: stream_url = match.group(1) return stream_url + '|User-Agent=%s' % (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( aa_decoder.AADecoder( re.sub( '\(+゚Д゚\)+\s*\[゚o゚\]\)*\s*\+(.+?)\(+゚Д゚\s*\)+\[゚o゚\]\)+', r'(゚Д゚)[゚o゚]+\1(゚Д゚)[゚o゚])', i)).decode()) except: pass href = re.search('''location.*?\"(.*)\"''', 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 = re.search("""file : '(.*)'""", _html) sources = sources.group(1) if sources: del headers['Cookie'] headers.update({'Referer': location}) return str(sources) + "|User-Agent=Mozilla/5.0" except Exception as e: raise ResolverError(e) raise ResolverError('File not found')