def getMediaUrl(self): sourceCode = self.net.http_GET(self.getNewHost(), headers=self.headers).content if '404 Not Found' in sourceCode: self.messageOk('MrPiracy.xyz', 'Ficheiro nao encontrado ou removido. EScolha outro servidor.') match = re.search('file\s*:\s*"([^"]+)', sourceCode) if match: return match.group(1) + '|Referer=http://vidzi.tv/nplayer/jwpayer.flash.swf' else: for pack in re.finditer('(eval\(function.*?)</script>', sourceCode, re.DOTALL): dataJs = jsunpacker.unpack(pack.group(1)) # Unpacker for Dean Edward's p.a.c.k.e.r | THKS print dataJs #pprint.pprint(dataJs) stream = re.search('file\s*:\s*"([^"]+)', dataJs) """ subtitle = re.compile('tracks:\[\{file:"(.+?)\.srt"').findall(dataJs)[0] subtitle += ".srt" self.subtitle = subtitle""" self.subtitle = "Nao tem legenda!" if stream: return stream.group(1) self.messageOk('MrPiracy.xyz', 'Video nao encontrado. Escolha outro servidor')
def getMediaUrl(self): sourceCode = self.net.http_GET(self.getNewHost(), headers=self.headers).content if '404 Not Found' in sourceCode: self.messageOk('MrPiracy.win', 'Ficheiro nao encontrado ou removido. Escolha outro servidor.') match = re.search('file\s*:\s*"([^"]+)', sourceCode) if match: return match.group(1) + '|Referer=http://vidzi.tv/nplayer/jwpayer.flash.swf' else: for pack in re.finditer('(eval\(function.*?)</script>', sourceCode, re.DOTALL): dataJs = jsunpacker.unpack(pack.group(1)) # Unpacker for Dean Edward's p.a.c.k.e.r | THKS #print dataJs #pprint.pprint(dataJs) stream = re.search('file\s*:\s*"([^"]+)', dataJs) try: subtitle = re.compile('tracks:\[\{file:"(.+?)\.srt"').findall(dataJs)[0] subtitle += ".srt" except: try: subtitle = re.compile('tracks:\[\{file:"(.+?)\.vtt"').findall(dataJs)[0] subtitle += ".vtt" except: subtitle = '' self.subtitle = subtitle if stream: return stream.group(1) self.messageOk('MrPiracy.win', 'Video nao encontrado. Escolha outro servidor')