def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) common.log_utils.log_debug('HugeFiles: get_link: %s' % (web_url)) html = self.net.http_GET(web_url).content r = re.findall('File Not Found', html) if r: raise ResolverError('File Not Found or removed') # Grab data values data = helpers.get_hidden(html) data.update(captcha_lib.do_captcha(html)) common.log_utils.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data)) html = self.net.http_POST(web_url, data).content # Re-grab data values data = helpers.get_hidden(html) data['referer'] = web_url headers = {'User-Agent': common.IE_USER_AGENT} common.log_utils.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data)) request = urllib2.Request(web_url, data=urllib.urlencode(data), headers=headers) try: stream_url = urllib2.urlopen(request).geturl() except: return common.log_utils.log_debug('Hugefiles stream Found: %s' % stream_url) return stream_url
def get_media_url(self, host, media_id): url = self.get_url(host, media_id) common.addon.log_debug('HugeFiles - Requesting GET URL: %s' % url) html = self.net.http_GET(url).content if 'File Not Found' in html: raise UrlResolver.ResolverError('File Not Found or removed') #Set POST data values data = {} r = re.findall(r'type="hidden"\s+name="([^"]+)"\s+value="([^"]+)', html) if r: for name, value in r: data[name] = value else: raise UrlResolver.ResolverError('Cannot find data values') data['method_free'] = 'Free Download' data.update(captcha_lib.do_captcha(html)) common.addon.log_debug('HugeFiles - Requesting POST URL: %s DATA: %s' % (url, data)) html = self.net.http_POST(url, data).content r = re.search('fileUrl\s*=\s*"([^"]+)', html) if r: return r.group(1) raise UrlResolver.ResolverError('Unable to resolve HugeFiles Link')
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 = {} r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html) for name, value in r: data[name] = value data['method_free'] = 'Free Download+>>' data.update(captcha_lib.do_captcha(html)) headers = {'Referer': web_url} common.log_utils.log_debug(data) html = self.net.http_POST(web_url, data, headers=headers).content if tries > 0: xbmc.sleep(6000) if 'File Download Link Generated' in html: r = re.search('href="([^"]+)[^>]+id="downloadbtn"', html) if r: return r.group(1) + '|' + urllib.urlencode( {'User-Agent': common.IE_USER_AGENT}) tries = tries + 1 raise ResolverError('Unable to locate link')
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["method_free"] = "Free Download" data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content # try to find source in packed data if jsunpack.detect(html): js_data = jsunpack.unpack(html) match = re.search('name="src"\s*value="([^"]+)', js_data) 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): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content tries = 0 while tries < MAX_TRIES: data = {} for match in re.finditer('input type="hidden" name="([^"]+)" value="([^"]+)', html): key, value = match.groups() data[key] = value data['method_free'] = 'Free Download' data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content # try to find source in packed data if jsunpack.detect(html): js_data = jsunpack.unpack(html) match = re.search('name="src"\s*value="([^"]+)', js_data) 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 UrlResolver.ResolverError('Unable to resolve kingfiles 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 = {} r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html) for name, value in r: data[name] = value data['method_free'] = 'Free Download+>>' data.update(captcha_lib.do_captcha(html)) headers = { 'Referer': web_url } common.addon.log_debug(data) html = self.net.http_POST(web_url, data, headers=headers).content if tries > 0: xbmc.sleep(6000) if 'File Download Link Generated' in html: r = re.search('href="([^"]+)[^>]+id="downloadbtn"', html) if r: return r.group(1) + '|' + urllib.urlencode({ 'User-Agent': common.IE_USER_AGENT }) tries = tries + 1 raise UrlResolver.ResolverError('Unable to locate link')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) resp = self.net.http_GET(web_url) html = resp.content if "No such file or the file has been removed due to copyright infringement issues." in html: raise UrlResolver.ResolverError('File Not Found or removed') filename = re.compile('<input name="fname" type="hidden" value="(.+?)">').findall(html)[0] data = {'op': 'download1', 'method_free': '1', 'usr_login': '', 'id': media_id, 'fname': filename} data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(resp.get_url(), data).content # find packed javascript embed code r = re.search('(eval.*?)\s*</script>', html, re.DOTALL) if r: packed_data = r.group(1) else: raise UrlResolver.ResolverError('packed javascript embed code not found') try: decrypted_data = jsunpack.unpack(packed_data) except: pass decrypted_data = decrypted_data.replace('\\', '') # First checks for a flv url, then the if statement is for the avi url r = re.search('[\'"]file[\'"]\s*,\s*[\'"]([^\'"]+)', decrypted_data) if not r: r = re.search('src="(.+?)"', decrypted_data) if r: stream_url = r.group(1) else: raise UrlResolver.ResolverError('stream url not found') 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 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.get_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): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content tries = 0 while tries < MAX_TRIES: data = {} r = re.findall(r'type="hidden"\s*name="([^"]+)"\s*value="([^"]+)', html) for name, value in r: data[name] = value data['method_free'] = 'Free Download' data.update(captcha_lib.do_captcha(html)) headers = {'Referer': web_url} html = self.net.http_POST(web_url, data, headers=headers).content if tries > 0: xbmc.sleep(6000) if '>File Download Link Generated<' in html: r = re.search("onClick\s*=\s*\"window\.open\('([^']+)", html) if r: return r.group(1) + '|' + urllib.urlencode( {'User-Agent': common.IE_USER_AGENT}) tries = tries + 1 raise ResolverError('Unable to locate link')
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 = {} r = re.findall(r'type="hidden"\s*name="([^"]+)"\s*value="([^"]+)', html) for name, value in r: data[name] = value data['method_free'] = 'Free Download' data.update(captcha_lib.do_captcha(html)) headers = { 'Referer': web_url } html = self.net.http_POST(web_url, data, headers=headers).content if tries > 0: xbmc.sleep(6000) if '>File Download Link Generated<' in html: r = re.search("onClick\s*=\s*\"window\.open\('([^']+)", html) if r: return r.group(1) + '|User-Agent=%s' % (common.IE_USER_AGENT) tries = tries + 1 raise UrlResolver.ResolverError('Unable to locate link')
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.findall('The file you were looking for could not be found', html) if r: raise ResolverError('File Not Found or removed') tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html) data['method_free'] = 'Free+Download+>>' data.update(captcha_lib.do_captcha(html)) headers = {'Referer': web_url} common.log_utils.log_debug(data) html = self.net.http_POST(web_url, data, headers=headers).content if tries > 0: xbmc.sleep(6000) if 'File Download Link Generated' in html: r = re.search('href="([^"]+)[^>]>Download<', html, re.I) if r: return r.group(1) + '|' + urllib.urlencode( {'User-Agent': common.IE_USER_AGENT}) tries = tries + 1 raise ResolverError('Unable to locate link')
def get_media_url(self, host, media_id): try: url = self.get_url(host, media_id) html = self.net.http_GET(url).content dialog = xbmcgui.DialogProgress() dialog.create('Resolving', 'Resolving Limevideo Link...') dialog.update(0) data = {} r = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', html) for name, value in r: data[name] = value data.update({'method_free': 'Continue to Video'}) html = net.http_POST(url, data).content r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html) for name, value in r: data[name] = value data.update(captcha_lib.do_captcha(html)) html = net.http_POST(url, data).content sPattern = '<script type=(?:"|\')text/javascript(?:"|\')>(eval\(' sPattern += 'function\(p,a,c,k,e,d\)(?!.+player_ads.+).+np_vid.+?)' sPattern += '\s+?</script>' r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE) if r: sJavascript = r.group(1) sUnpacked = jsunpack.unpack(sJavascript) sPattern = '<embed id="np_vid"type="video/divx"src="(.+?)' sPattern += '"custommode=' r = re.search(sPattern, sUnpacked) if r: dialog.update(100) dialog.close() return r.group(1) else: num = re.compile( 'false\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|divx').findall(html) for u1, u2, u3, u4 in num: urlz = u4 + '.' + u3 + '.' + u2 + '.' + u1 pre = 'http://' + urlz + ':182/d/' preb = re.compile('custommode\|(.+?)\|(.+?)\|182').findall( html) for ext, link in preb: r = pre + link + '/video.' + ext dialog.update(100) dialog.close() return r except Exception, e: common.addon.log('**** Limevideo Error occured: %s' % e) common.addon.show_small_popup('Error', str(e), 5000, '') return self.unresolvable(code=0, msg=e)
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) common.log_utils.log_debug('HugeFiles: get_link: %s' % (web_url)) html = self.net.http_GET(web_url).content r = re.findall('File Not Found', html) if r: raise ResolverError('File Not Found or removed') # Grab data values data = {} r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html) if r: for name, value in r: data[name] = value else: raise ResolverError('Unable to resolve link') data['method_free'] = 'Free Download' data.update(captcha_lib.do_captcha(html)) common.log_utils.log_debug( 'HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data)) html = self.net.http_POST(web_url, data).content # Re-grab data values data = {} r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html) if r: for name, value in r: data[name] = value else: raise ResolverError('Unable to resolve link') data['referer'] = web_url headers = {'User-Agent': common.IE_USER_AGENT} common.log_utils.log_debug( 'HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data)) request = urllib2.Request(web_url, data=urllib.urlencode(data), headers=headers) try: stream_url = urllib2.urlopen(request).geturl() except: return common.log_utils.log_debug('Hugefiles stream Found: %s' % stream_url) return stream_url
def __get_link(self, url): headers = {'User-Agent': common.IE_USER_AGENT} common.addon.log_debug('180upload: get_link: %s' % (url)) html = self.net.http_GET(url, headers).content #Re-grab data values data = {} r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)"', html) if r: for name, value in r: data[name] = value else: raise UrlResolver.ResolverError('Unable to resolve link') # ignore captchas in embedded pages if 'embed' not in url: data.update(captcha_lib.do_captcha(html)) common.addon.log_debug( '180Upload - Requesting POST URL: %s with data: %s' % (url, data)) data['referer'] = url html = self.net.http_POST(url, data, headers).content # try download link link = re.search('id="lnk_download[^"]*" href="([^"]+)', html) stream_url = None if link: common.addon.log_debug('180Upload Download Found: %s' % link.group(1)) stream_url = link.group(1) else: # try flash player link packed = re.search('id="player_code".*?(eval.*?)</script>', html, re.DOTALL) if packed: js = jsunpack.unpack(packed.group(1)) link = re.search('name="src"\s*value="([^"]+)', js.replace('\\', '')) if link: common.addon.log_debug('180Upload Src Found: %s' % link.group(1)) stream_url = link.group(1) else: link = re.search("'file'\s*,\s*'([^']+)", js.replace('\\', '')) if link: common.addon.log_debug('180Upload Link Found: %s' % link.group(1)) stream_url = link.group(1) if stream_url: return stream_url + '|User-Agent=%s&Referer=%s' % ( common.IE_USER_AGENT, url) else: raise UrlResolver.ResolverError('Unable to resolve link')
def get_media_url(self, host, media_id): try: url = self.get_url(host, media_id) html = self.net.http_GET(url).content dialog = xbmcgui.DialogProgress() dialog.create('Resolving', 'Resolving Limevideo Link...') dialog.update(0) data = {} r = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', html) for name, value in r: data[name] = value data.update({'method_free':'Continue to Video'}) html = net.http_POST(url, data).content r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html) for name, value in r: data[name] = value data.update(captcha_lib.do_captcha(html)) html = net.http_POST(url, data).content sPattern = '<script type=(?:"|\')text/javascript(?:"|\')>(eval\(' sPattern += 'function\(p,a,c,k,e,d\)(?!.+player_ads.+).+np_vid.+?)' sPattern += '\s+?</script>' r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE) if r: sJavascript = r.group(1) sUnpacked = jsunpack.unpack(sJavascript) sPattern = '<embed id="np_vid"type="video/divx"src="(.+?)' sPattern += '"custommode=' r = re.search(sPattern, sUnpacked) if r: dialog.update(100) dialog.close() return r.group(1) else: num = re.compile('false\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|divx').findall(html) for u1, u2, u3, u4 in num: urlz = u4+'.'+u3+'.'+u2+'.'+u1 pre = 'http://'+urlz+':182/d/' preb = re.compile('custommode\|(.+?)\|(.+?)\|182').findall(html) for ext, link in preb: r = pre+link+'/video.'+ext dialog.update(100) dialog.close() return r except Exception, e: common.addon.log('**** Limevideo Error occured: %s' % e) common.addon.show_small_popup('Error', str(e), 5000, '') return self.unresolvable(code=0, msg=e)
def __get_link(self, url): headers = {'User-Agent': common.IE_USER_AGENT} common.addon.log_debug('HugeFiles: get_link: %s' % (url)) html = self.net.http_GET(url, headers).content # Re-grab data values data = {} r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)"', html) if r: for name, value in r: data[name] = value else: raise UrlResolver.ResolverError('Unable to resolve link') data.update(captcha_lib.do_captcha(html)) common.addon.log_debug( 'HugeFiles - Requesting POST URL: %s with data: %s' % (url, data)) data['referer'] = url html = self.net.http_POST(url, data, headers).content # try download link link = re.search('id="lnk_download[^"]*" href="([^"]+)', html) stream_url = None if link: common.addon.log_debug('HugeFiles Download Found: %s' % link.group(1)) stream_url = link.group(1) else: # try flash player link packed = re.search('id="player_code".*?(eval.*?)</script>', html, re.DOTALL) if packed: js = jsunpack.unpack(packed.group(1)) js = js.replace('\\', '') patterns = [ "name=[\"']src[\"']\s*value=['\"]([^'\"]+)", "['\"]file['\"]\s*,\s*['\"]([^'\"]+)", "<source[^>]+src=['\"]([^'\"]+)" ] for pattern in patterns: link = re.search(pattern, js) if link: common.addon.log_debug('Hugefiles Src Found: %s' % link.group(1)) stream_url = link.group(1) break if stream_url: return stream_url + '|User-Agent=%s&Referer=%s' % ( common.IE_USER_AGENT, url) else: raise UrlResolver.ResolverError('Unable to resolve link')
def __get_link(self, url): try: headers = { 'User-Agent': USER_AGENT } common.addon.log_debug('180upload: get_link: %s' % (url)) html = net.http_GET(url, headers).content #Re-grab data values data = {} r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)"', html) if r: for name, value in r: data[name] = value else: raise Exception('Unable to resolve 180Upload Link') # ignore captchas in embedded pages if 'embed' not in url: data.update(captcha_lib.do_captcha(html)) common.addon.log_debug('180Upload - Requesting POST URL: %s with data: %s' % (url, data)) data['referer'] = url html = net.http_POST(url, data, headers).content # try download link link = re.search('id="lnk_download[^"]*" href="([^"]+)', html) if link: common.addon.log_debug('180Upload Download Found: %s' % link.group(1)) return link.group(1) else: # try flash player link packed = re.search('id="player_code".*?(eval.*?)</script>', html, re.DOTALL) if packed: js = jsunpack.unpack(packed.group(1)) link = re.search('name="src"\s*value="([^"]+)', js.replace('\\', '')) if link: common.addon.log_debug('180Upload Src Found: %s' % link.group(1)) return link.group(1) else: link = re.search("'file'\s*,\s*'([^']+)", js.replace('\\', '')) if link: common.addon.log_debug('180Upload Link Found: %s' % link.group(1)) return link.group(1) raise Exception('Unable to resolve 180Upload Link') except urllib2.URLError as e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, url)) return self.unresolvable(code=3, msg=e) except Exception as e: common.addon.log_error('**** 180upload Error occured: %s' % e) return self.unresolvable(code=0, msg=e)
def __get_link(self, url): headers = { 'User-Agent': USER_AGENT } common.addon.log_debug('180upload: get_link: %s' % (url)) html = self.net.http_GET(url, headers).content #Re-grab data values data = {} r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)"', html) if r: for name, value in r: data[name] = value else: raise UrlResolver.ResolverError('Unable to resolve link') # ignore captchas in embedded pages if 'embed' not in url: data.update(captcha_lib.do_captcha(html)) common.addon.log_debug('180Upload - Requesting POST URL: %s with data: %s' % (url, data)) data['referer'] = url html = self.net.http_POST(url, data, headers).content # try download link link = re.search('id="lnk_download[^"]*" href="([^"]+)', html) stream_url = None if link: common.addon.log_debug('180Upload Download Found: %s' % link.group(1)) stream_url = link.group(1) else: # try flash player link packed = re.search('id="player_code".*?(eval.*?)</script>', html, re.DOTALL) if packed: js = jsunpack.unpack(packed.group(1)) link = re.search('name="src"\s*value="([^"]+)', js.replace('\\', '')) if link: common.addon.log_debug('180Upload Src Found: %s' % link.group(1)) stream_url = link.group(1) else: link = re.search("'file'\s*,\s*'([^']+)", js.replace('\\', '')) if link: common.addon.log_debug('180Upload Link Found: %s' % link.group(1)) stream_url = link.group(1) if stream_url: return stream_url + '|User-Agent=%s' % (USER_AGENT) else: raise UrlResolver.ResolverError('Unable to resolve link')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) common.log_utils.log_debug('HugeFiles: get_link: %s' % (web_url)) html = self.net.http_GET(web_url).content r = re.findall('File Not Found', html) if r: raise ResolverError('File Not Found or removed') # Grab data values data = {} r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html) if r: for name, value in r: data[name] = value else: raise ResolverError('Unable to resolve link') data['method_free'] = 'Free Download' data.update(captcha_lib.do_captcha(html)) common.log_utils.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data)) html = self.net.http_POST(web_url, data).content # Re-grab data values data = {} r = re.findall(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html) if r: for name, value in r: data[name] = value else: raise ResolverError('Unable to resolve link') data['referer'] = web_url headers = {'User-Agent': common.IE_USER_AGENT} common.log_utils.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data)) request = urllib2.Request(web_url, data=urllib.urlencode(data), headers=headers) try: stream_url = urllib2.urlopen(request).geturl() except: return common.log_utils.log_debug('Hugefiles stream Found: %s' % stream_url) return stream_url
def get_media_url(self, host, media_id): embed_url = 'http://vidplay.net/vidembed-%s' % (media_id) response = urllib2.urlopen(embed_url) if response.getcode() == 200 and response.geturl( ) != embed_url and response.geturl()[-3:].lower() in [ 'mp4', 'avi', 'mkv' ]: return response.geturl() web_url = self.get_url(host, media_id) try: html = net.http_GET(web_url).content if re.search('File Not Found ', html): msg = 'File Not Found or removed' return self.unresolvable(code=1, msg=msg) data = {} r = re.findall(r'type="hidden".*?name="([^"]+)".*?value="([^"]+)', html) if r: for name, value in r: data[name] = value else: raise Exception('Unable to resolve vidplay Link') data.update(captcha_lib.do_captcha(html)) common.addon.log_debug( 'VIDPLAY - Requesting POST URL: %s with data: %s' % (web_url, data)) html = net.http_POST(web_url, data).content r = re.search('id="downloadbutton".*?href="([^"]+)', html) if r: return r.group(1) else: r = re.search("file\s*:\s*'([^']+)", html) if r: return r.group(1) else: common.addon.log('***** VidPlay - Cannot find final link') raise Exception('Unable to resolve VidPlay Link') except urllib2.URLError, e: common.addon.log_error(self.name + ': 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) html = self.net.http_GET(web_url).content tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html, index=0) data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content match = re.search('href="([^"]+)[^>]*>Download<', html, re.DOTALL) if match: return match.group(1) tries += 1 raise ResolverError('Unable to resolve uploadz.co link. Filelink not found.')
def __get_link(self, url): headers = { 'User-Agent': common.IE_USER_AGENT } common.addon.log_debug('HugeFiles: get_link: %s' % (url)) html = self.net.http_GET(url, headers).content # Re-grab data values data = {} r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)"', html) if r: for name, value in r: data[name] = value else: raise UrlResolver.ResolverError('Unable to resolve link') data.update(captcha_lib.do_captcha(html)) common.addon.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (url, data)) data['referer'] = url html = self.net.http_POST(url, data, headers).content # try download link link = re.search('id="lnk_download[^"]*" href="([^"]+)', html) stream_url = None if link: common.addon.log_debug('HugeFiles Download Found: %s' % link.group(1)) stream_url = link.group(1) else: # try flash player link packed = re.search('id="player_code".*?(eval.*?)</script>', html, re.DOTALL) if packed: js = jsunpack.unpack(packed.group(1)) js = js.replace('\\', '') patterns = ["name=[\"']src[\"']\s*value=['\"]([^'\"]+)", "['\"]file['\"]\s*,\s*['\"]([^'\"]+)", "<source[^>]+src=['\"]([^'\"]+)"] for pattern in patterns: link = re.search(pattern, js) if link: common.addon.log_debug('Hugefiles Src Found: %s' % link.group(1)) stream_url = link.group(1) break if stream_url: return stream_url + '|User-Agent=%s&Referer=%s' % (common.IE_USER_AGENT, url) else: raise UrlResolver.ResolverError('Unable to resolve link')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content headers = {'User-Agent': common.RAND_UA, 'Referer': web_url} tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html, index=0) data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, headers=headers, form_data=data).content match = re.search('href="([^"]+)[^>]*>Click here to download<', html, re.DOTALL | re.I) if match: return match.group(1) + helpers.append_headers(headers) tries += 1 raise ResolverError('Unable to resolve uploadz.co 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['method_free'] = 'Free Download >>' data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content match = re.search('href="([^"]+)[^>]*>Download<', html, re.DOTALL) if match: return match.group(1) tries += 1 raise ResolverError('Unable to resolve upload.af link. Filelink not found.')
def get_media_url(self, host, media_id): embed_url = 'http://vidplay.net/vidembed-%s' % (media_id) response = urllib2.urlopen(embed_url) if response.getcode() == 200 and response.geturl( ) != embed_url and response.geturl()[-3:].lower() in [ 'mp4', 'avi', 'mkv' ]: return response.geturl() + '|User-Agent=%s' % ( common.IE_USER_AGENT) web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content if re.search('File Not Found ', html): raise UrlResolver.ResolverError('File Not Found or removed') data = {} r = re.findall(r'type="hidden".*?name="([^"]+)".*?value="([^"]+)', html) if r: for name, value in r: data[name] = value else: raise UrlResolver.ResolverError('Unable to resolve vidplay Link') data.update(captcha_lib.do_captcha(html)) common.addon.log_debug( 'VIDPLAY - Requesting POST URL: %s with data: %s' % (web_url, data)) html = self.net.http_POST(web_url, data).content r = re.search('id="downloadbutton".*?href="([^"]+)', html) if r: stream_url = r.group(1) else: r = re.search("file\s*:\s*'([^']+)", html) if r: stream_url = r.group(1) else: raise UrlResolver.ResolverError( 'Unable to resolve VidPlay Link') if stream_url: return stream_url + '|User-Agent=%s' % (common.IE_USER_AGENT) else: raise UrlResolver.ResolverError('Unable to resolve link')
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 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, data, headers=headers).content r = re.search(r'''class="downloadbtn"[^>]+onClick\s*=\s*\"window\.open\('([^']+)''', html) if r: return r.group(1) + helpers.append_headers(headers) common.kodi.sleep(1000) tries = tries + 1 raise ResolverError('Unable to locate link')
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 tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html, index=0) data.update(captcha_lib.do_captcha(html)) headers.update({'Referer': web_url}) html = self.net.http_POST(web_url, data, headers=headers).content r = re.search('href="([^"]+)[^>]+>Click here to download<', html, re.DOTALL | re.I) if r: return r.group(1) + helpers.append_headers(headers) tries = tries + 1 raise ResolverError('Unable to locate link')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content data = {} r = re.findall(r'type="hidden"\s*name="([^"]+)"\s*value="([^"]+)', html) for name, value in r: data[name] = value data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, data).content if '>File Download Link Generated<' in html: # find the href on the same line as the download button image r = re.search('href="([^"]+).*?downdown\.png', html) if r: return r.group(1) + '|User-Agent=%s' % (USER_AGENT) raise UrlResolver.ResolverError('Unable to locate link')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content data = {} r = re.findall(r'type="hidden"\s*name="([^"]+)"\s*value="([^"]+)', html) for name, value in r: data[name] = value data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, data).content if '>File Download Link Generated<' in html: # find the href on the same line as the download button image r = re.search('href="([^"]+).*?downdown\.png', html) if r: return r.group(1) + '|User-Agent=%s' % (common.IE_USER_AGENT) raise UrlResolver.ResolverError('Unable to locate link')
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 tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html, index=0) data.update(captcha_lib.do_captcha(html)) common.log_utils.log_debug(data) html = self.net.http_POST(web_url, data, headers=headers).content if 'File Download Link Generated' in html: r = re.search('href="([^"]+)[^>]>Download<', html, re.I) if r: return r.group(1) + helpers.append_headers({'User-Agent': common.IE_USER_AGENT}) tries = tries + 1 raise ResolverError('Unable to locate link')
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 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, data, headers=headers).content r = re.search("""class="downloadbtn"[^>]+onClick\s*=\s*\"window\.open\('([^']+)""", html) if r: return r.group(1) + helpers.append_headers(headers) if tries > 0: xbmc.sleep(1000) tries = tries + 1 raise ResolverError("Unable to locate link")
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 tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html, index=1) data.update(captcha_lib.do_captcha(html)) logger.log_debug(data) html = self.net.http_POST(web_url, data, headers=headers).content if 'downloadbtn222' in html: r = re.search('class="downloadbtn222".*?href="([^"]+)', html, re.I | re.DOTALL) if r: return r.group(1) + helpers.append_headers({'User-Agent': common.IE_USER_AGENT}) tries = tries + 1 raise ResolverError('Unable to locate link')
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) resp = self.net.http_GET(web_url) html = resp.content if "No such file or the file has been removed due to copyright infringement issues." in html: raise UrlResolver.ResolverError('File Not Found or removed') filename = re.compile( '<input name="fname" type="hidden" value="(.+?)">').findall( html)[0] data = { 'op': 'download1', 'method_free': '1', 'usr_login': '', 'id': media_id, 'fname': filename } data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(resp.get_url(), data).content # find packed javascript embed code r = re.search('(eval.*?)\s*</script>', html, re.DOTALL) if r: packed_data = r.group(1) else: raise UrlResolver.ResolverError( 'packed javascript embed code not found') try: decrypted_data = jsunpack.unpack(packed_data) except: pass decrypted_data = decrypted_data.replace('\\', '') # First checks for a flv url, then the if statement is for the avi url r = re.search('[\'"]file[\'"]\s*,\s*[\'"]([^\'"]+)', decrypted_data) if not r: r = re.search('src="(.+?)"', decrypted_data) if r: stream_url = r.group(1) else: raise UrlResolver.ResolverError('stream url not found') return stream_url
def get_media_url(self, host, media_id): try: url = self.get_url(host, media_id) common.addon.log('HugeFiles - Requesting GET URL: %s' % url) html = self.net.http_GET(url).content r = re.findall('File Not Found', html) if r: raise Exception('File Not Found or removed') #Check page for any error msgs if re.search('<b>File Not Found</b>', html): common.addon.log('***** HugeFiles - File Not Found') raise Exception('File Not Found') #Set POST data values data = {} r = re.findall(r'type="hidden"\s+name="([^"]+)"\s+value="([^"]+)', html) if r: for name, value in r: data[name] = value else: common.addon.log('***** HugeFiles - Cannot find data values') raise Exception('Unable to resolve HugeFiles Link') data['method_free'] = 'Free Download' data.update(captcha_lib.do_captcha(html)) common.addon.log('HugeFiles - Requesting POST URL: %s DATA: %s' % (url, data)) html = net.http_POST(url, data).content r = re.search('fileUrl\s*=\s*"([^"]+)', html) if r: return r.group(1) raise Exception('Unable to resolve HugeFiles Link') except urllib2.HTTPError, e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, url)) 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 tries = 0 while tries < MAX_TRIES: data = {} for match in re.finditer(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html): key, value = match.groups() data[key] = value data['method_free'] = 'Free Download >>' data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content match = re.search('href="([^"]+)[^>]*>Download<', html, re.DOTALL) if match: return match.group(1) tries += 1 raise ResolverError('Unable to resolve upload.af 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, 'Referer': web_url} html = self.net.http_GET(web_url, headers=headers).content tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html, index=0) data.update(captcha_lib.do_captcha(html)) common.log_utils.log_debug(data) html = self.net.http_POST(web_url, data, headers=headers).content if 'File Download Link Generated' in html: r = re.search('href="([^"]+)[^>]>Download<', html, re.I) if r: return r.group(1) + helpers.append_headers( {'User-Agent': common.IE_USER_AGENT}) tries = tries + 1 raise ResolverError('Unable to locate link')
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 = {} for match in re.finditer('input type="hidden" name="([^"]+)" value="([^"]+)', html): key, value = match.groups() data[key] = value data["method_free"] = "Free Download" data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content match = re.search('class="btn_down.*?href="([^"]+)', html, re.DOTALL) if match: return match.group(1) tries += 1 raise UrlResolver.ResolverError("Unable to resolve 24uploading link. Filelink not found.")
def get_media_url(self, host, media_id): embed_url = 'http://vidplay.net/vidembed-%s' % (media_id) response = urllib2.urlopen(embed_url) if response.getcode() == 200 and response.geturl() != embed_url and response.geturl()[-3:].lower() in ['mp4', 'avi', 'mkv']: return response.geturl() web_url = self.get_url(host, media_id) try: html = net.http_GET(web_url).content if re.search('File Not Found ', html): msg = 'File Not Found or removed' return self.unresolvable(code=1, msg=msg) data = {} r = re.findall(r'type="hidden".*?name="([^"]+)".*?value="([^"]+)', html) if r: for name, value in r: data[name] = value else: raise Exception('Unable to resolve vidplay Link') data.update(captcha_lib.do_captcha(html)) common.addon.log_debug('VIDPLAY - Requesting POST URL: %s with data: %s' % (web_url, data)) html = net.http_POST(web_url, data).content r = re.search('id="downloadbutton".*?href="([^"]+)', html) if r: return r.group(1) else: r = re.search("file\s*:\s*'([^']+)", html) if r: return r.group(1) else: common.addon.log('***** VidPlay - Cannot find final link') raise Exception('Unable to resolve VidPlay Link') except urllib2.URLError, e: common.addon.log_error(self.name + ': 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) html = self.net.http_GET(web_url).content tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html) data["method_free"] = "Free+Download" data.update(captcha_lib.do_captcha(html)) headers = {"Referer": web_url} html = self.net.http_POST(web_url, data, headers=headers).content if tries > 0: xbmc.sleep(6000) if ">File Download Link Generated<" in html: r = re.search("onClick\s*=\s*\"window\.open\('([^']+)", html) if r: return r.group(1) + "|" + urllib.urlencode({"User-Agent": common.IE_USER_AGENT}) tries = tries + 1 raise ResolverError("Unable to locate link")
def get_media_url(self, host, media_id): url = self.get_url(host, media_id) html = self.net.http_GET(url).content data = {} r = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', html) for name, value in r: data[name] = value data.update({'method_free': 'Continue to Video'}) html = self.net.http_POST(url, data).content r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html) for name, value in r: data[name] = value data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(url, data).content sPattern = '<script type=(?:"|\')text/javascript(?:"|\')>(eval\(' sPattern += 'function\(p,a,c,k,e,d\)(?!.+player_ads.+).+np_vid.+?)' sPattern += '\s+?</script>' r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE) if r: sJavascript = r.group(1) sUnpacked = jsunpack.unpack(sJavascript) sPattern = '<embed id="np_vid"type="video/divx"src="(.+?)' sPattern += '"custommode=' r = re.search(sPattern, sUnpacked) if r: return r.group(1) else: num = re.compile( 'false\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|divx').findall(html) for u1, u2, u3, u4 in num: urlz = u4 + '.' + u3 + '.' + u2 + '.' + u1 pre = 'http://' + urlz + ':182/d/' preb = re.compile('custommode\|(.+?)\|(.+?)\|182').findall(html) for ext, link in preb: r = pre + link + '/video.' + ext return r
def get_media_url(self, host, media_id): url = self.get_url(host, media_id) html = self.net.http_GET(url).content data = {} r = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', html) for name, value in r: data[name] = value data.update({'method_free': 'Continue to Video'}) html = self.net.http_POST(url, data).content r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html) for name, value in r: data[name] = value data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(url, data).content sPattern = '<script type=(?:"|\')text/javascript(?:"|\')>(eval\(' sPattern += 'function\(p,a,c,k,e,d\)(?!.+player_ads.+).+np_vid.+?)' sPattern += '\s+?</script>' r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE) if r: sJavascript = r.group(1) sUnpacked = jsunpack.unpack(sJavascript) sPattern = '<embed id="np_vid"type="video/divx"src="(.+?)' sPattern += '"custommode=' r = re.search(sPattern, sUnpacked) if r: return r.group(1) else: num = re.compile('false\|(.+?)\|(.+?)\|(.+?)\|(.+?)\|divx').findall(html) for u1, u2, u3, u4 in num: urlz = u4 + '.' + u3 + '.' + u2 + '.' + u1 pre = 'http://' + urlz + ':182/d/' preb = re.compile('custommode\|(.+?)\|(.+?)\|182').findall(html) for ext, link in preb: r = pre + link + '/video.' + ext return r
def get_media_url(self, host, media_id): url = self.get_url(host, media_id) html = self.net.http_GET(url).content data = {} r = re.findall( r'type="(?:hidden|submit)?" name="(.+?)"\s* value="?(.+?)">', html) for name, value in r: data[name] = value html = self.net.http_POST(url, data).content r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html) for name, value in r: data[name] = value data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(url, data).content sPattern = '<script type=(?:"|\')text/javascript(?:"|\')>(eval\(' sPattern += 'function\(p,a,c,k,e,d\)(?!.+player_ads.+).+np_vid.+?)' sPattern += '\s+?</script>' r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE) if r: sJavascript = r.group(1) sUnpacked = jsunpack.unpack(sJavascript) sPattern = '<embed id="np_vid"type="video/divx"src="(.+?)' sPattern += '"custommode=' r = re.search(sPattern, sUnpacked) if r: return r.group(1) else: num = re.compile('donevideo\|(.+?)\|http').findall(html) pre = 'http://' + num[0] + '.donevideo.com:182/d/' preb = re.compile('image\|(.+?)\|video\|(.+?)\|').findall(html) for ext, link in preb: r = pre + link + '/video.' + ext return r
def get_media_url(self, host, media_id): url = self.get_url(host, media_id) html = self.net.http_GET(url).content data = {} r = re.findall(r'type="(?:hidden|submit)?" name="(.+?)"\s* value="?(.+?)">', html) for name, value in r: data[name] = value html = self.net.http_POST(url, data).content r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html) for name, value in r: data[name] = value data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(url, data).content sPattern = '<script type=(?:"|\')text/javascript(?:"|\')>(eval\(' sPattern += 'function\(p,a,c,k,e,d\)(?!.+player_ads.+).+np_vid.+?)' sPattern += '\s+?</script>' r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE) if r: sJavascript = r.group(1) sUnpacked = jsunpack.unpack(sJavascript) sPattern = '<embed id="np_vid"type="video/divx"src="(.+?)' sPattern += '"custommode=' r = re.search(sPattern, sUnpacked) if r: return r.group(1) else: num = re.compile('donevideo\|(.+?)\|http').findall(html) pre = 'http://'+num[0]+'.donevideo.com:182/d/' preb = re.compile('image\|(.+?)\|video\|(.+?)\|').findall(html) for ext, link in preb: r = pre+link+'/video.'+ext return r
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): web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content tries = 0 while tries < MAX_TRIES: data = {} for match in re.finditer( 'input type="hidden" name="([^"]+)" value="([^"]+)', html): key, value = match.groups() data[key] = value data['method_free'] = 'Free Download' data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, form_data=data).content match = re.search('class="btn_down.*?href="([^"]+)', html, re.DOTALL) if match: return match.group(1) tries += 1 raise UrlResolver.ResolverError( 'Unable to resolve 24uploading 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, 'Referer': web_url } html = self.net.http_GET(web_url, headers=headers).content tries = 0 while tries < MAX_TRIES: data = helpers.get_hidden(html) data['method_free'] = 'Free+Download+>>' data.update(captcha_lib.do_captcha(html)) html = self.net.http_POST(web_url, data, headers=headers).content r = re.search('''class="downloadbtn"[^>]+onClick\s*=\s*\"window\.open\('([^']+)''', html) if r: return r.group(1) + '|' + urllib.urlencode({'User-Agent': common.FF_USER_AGENT}) if tries > 0: xbmc.sleep(1000) tries = tries + 1 raise ResolverError('Unable to locate link')
def get_media_url(self, host, media_id): embed_url = 'http://vidplay.net/vidembed-%s' % (media_id) response = urllib2.urlopen(embed_url) if response.getcode() == 200 and response.geturl() != embed_url and response.geturl()[-3:].lower() in ['mp4', 'avi', 'mkv']: return response.geturl() + '|User-Agent=%s' % (common.IE_USER_AGENT) web_url = self.get_url(host, media_id) html = self.net.http_GET(web_url).content if re.search('File Not Found ', html): raise UrlResolver.ResolverError('File Not Found or removed') data = {} r = re.findall(r'type="hidden".*?name="([^"]+)".*?value="([^"]+)', html) if r: for name, value in r: data[name] = value else: raise UrlResolver.ResolverError('Unable to resolve vidplay Link') data.update(captcha_lib.do_captcha(html)) common.addon.log_debug('VIDPLAY - Requesting POST URL: %s with data: %s' % (web_url, data)) html = self.net.http_POST(web_url, data).content r = re.search('id="downloadbutton".*?href="([^"]+)', html) if r: stream_url = r.group(1) else: r = re.search("file\s*:\s*'([^']+)", html) if r: stream_url = r.group(1) else: raise UrlResolver.ResolverError('Unable to resolve VidPlay Link') if stream_url: return stream_url + '|User-Agent=%s' % (common.IE_USER_AGENT) else: raise UrlResolver.ResolverError('Unable to resolve link')
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['method_free'] = 'Free+Download+>>' data.update(captcha_lib.do_captcha(html)) headers = { 'Referer': web_url } common.log_utils.log_debug(data) html = self.net.http_POST(web_url, data, headers=headers).content if tries > 0: xbmc.sleep(6000) if 'File Download Link Generated' in html: r = re.search('href="([^"]+)[^>]>Download<', html, re.I) if r: return r.group(1) + '|' + urllib.urlencode({'User-Agent': common.IE_USER_AGENT}) tries = tries + 1 raise ResolverError('Unable to locate link')
def __get_link(self, url): try: headers = {'User-Agent': USER_AGENT} common.addon.log_debug('180upload: get_link: %s' % (url)) html = net.http_GET(url, headers).content #Re-grab data values data = {} r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)"', html) if r: for name, value in r: data[name] = value else: raise Exception('Unable to resolve 180Upload Link') # ignore captchas in embedded pages if 'embed' not in url: data.update(captcha_lib.do_captcha(html)) common.addon.log_debug( '180Upload - Requesting POST URL: %s with data: %s' % (url, data)) data['referer'] = url html = net.http_POST(url, data, headers).content # try download link link = re.search('id="lnk_download[^"]*" href="([^"]+)', html) if link: common.addon.log_debug('180Upload Download Found: %s' % link.group(1)) return link.group(1) else: # try flash player link packed = re.search('id="player_code".*?(eval.*?)</script>', html, re.DOTALL) if packed: js = jsunpack.unpack(packed.group(1)) link = re.search('name="src"\s*value="([^"]+)', js.replace('\\', '')) if link: common.addon.log_debug('180Upload Src Found: %s' % link.group(1)) return link.group(1) else: link = re.search("'file'\s*,\s*'([^']+)", js.replace('\\', '')) if link: common.addon.log_debug('180Upload Link Found: %s' % link.group(1)) return link.group(1) raise Exception('Unable to resolve 180Upload Link') except urllib2.URLError as e: common.addon.log_error(self.name + ': got http error %d fetching %s' % (e.code, url)) return self.unresolvable(code=3, msg=e) except Exception as e: common.addon.log_error('**** 180upload Error occured: %s' % e) return self.unresolvable(code=0, msg=e)