def __getIdFromUrl(self,sUrl): """ URL trouvées: https://thevideo.me/1a2b3c4e5d6f https://thevideo.me/embed-1a2b3c4e5d6f.html http(s)://thevideo.me/embed-1a2b3c4e5d6f-816x459.html """ sPattern = '\/(?:embed-)?(\w+)(?:-\d+x\d+)?(?:\.html)?$' aResult = cParser().parse( sUrl, sPattern ) if (aResult[0] == True): return aResult[1][0] sPattern = '\/(?:embed/)?(\w+)(?:-\d+x\d+)?(?:/)?$' aResult = cParser().parse( sUrl, sPattern ) if (aResult[0] == True): return aResult[1][0] return ''
def GetHost(self, sUrl): oParser = cParser() sPattern = 'https*:\/\/(.+?)\/' aResult = oParser.parse(sUrl, sPattern) if aResult[0]: return aResult[1][0] return ''
def __getMediaLinkForGuest(self): api_call = False oRequest = cRequestHandler(self.__sUrl) sHtmlContent = oRequest.request() SubTitle = '' SubTitle = self.checkSubtitle(sHtmlContent) #VSlog(SubTitle) oParser = cParser() sPattern = 'src":[\'"]([^<>\'"]+)[\'"],"type":[\'"][^\'"><]+?[\'"],"label":[\'"]([0-9]+p)[\'"].+?"lang":[\'"]([^\'"]+)' aResult = oParser.parse(sHtmlContent, sPattern) #VSlog(str(aResult)) if (aResult[0] == True): url=[] qua=[] lang=[] for aEntry in aResult[1]: url.append(aEntry[0]) tmp_qua = aEntry[1] if (len(aEntry)>2): if 'unknow' not in aEntry[2]: tmp_qua = tmp_qua + ' (' + aEntry[2] + ')' qua.append(tmp_qua) api_call = [qua, url] return True, str(api_call) return False, False
def __getIdFromUrl(self): sPattern = "ref=([^<]+)" oParser = cParser() aResult = oParser.parse(self.__sUrl, sPattern) if (aResult[0] == True): return aResult[1][0] return ''
def __getIdFromUrl(self): sPattern = 'https*:\/\/hqq\.(?:tv|player|watch)\/player\/embed_player\.php\?vid=([0-9A-Za-z]+)' oParser = cParser() aResult = oParser.parse(self.__sUrl, sPattern) if (aResult[0] == True): return aResult[1][0] return ''
def __getIdFromUrl(self, sUrl): #correction ancienne url >> embed depreciated sPattern = '(?:play/|video/|embed\?videoid=|vid=)([0-9]+)' oParser = cParser() aResult = oParser.parse(sUrl, sPattern) if (aResult[0] == True): return aResult[1][0] return ''
def __getKey(self): oRequestHandler = cRequestHandler(self.__sUrl) sHtmlContent = oRequestHandler.request() sPattern = 'flashvars.filekey="(.+?)";' oParser = cParser() aResult = oParser.parse(sHtmlContent, sPattern) if (aResult[0] == True): aResult = aResult[1][0].replace('.', '%2E') return aResult return ''
def CheckCpacker(sHtmlContent): oParser = cParser() sPattern = "(eval\(function\(p,a,c,k,e(?:.|\s)+?\))<\/script>" aResult = oParser.parse(sHtmlContent, sPattern) if (aResult[0] == True): str2 = aResult[1][0] try: result = cPacker().unpack(str2) return result except: pass return False
def Cdecode(sHtmlContent, encodedC): oParser = cParser() sPattern = '<([0-9a-zA-Z]+)><script>([^<]+)<\/script>' aResult = oParser.parse(sHtmlContent, sPattern) z = [] y = [] if (aResult[0] == True): for aEntry in aResult[1]: z.append(JJDecoder(aEntry[1]).decode()) #VSlog(z) for x in z: r1 = re.search("atob\(\'([^']+)\'\)", x, re.DOTALL | re.UNICODE) if r1: y.append(base64.b64decode(r1.group(1))) for w in y: r2 = re.search(encodedC + "='([^']+)'", w) if r2: return r2.group(1)
def checkSubtitle(self,sHtmlContent): oParser = cParser() #On ne charge les sous titres uniquement si vostfr se trouve dans le titre. if not re.search("<h1 class='file-title'>[^<>]+(?:TRUEFRENCH|FRENCH)[^<>]*</h1>", sHtmlContent, re.IGNORECASE): sPattern = '<track type=[\'"].+?[\'"] kind=[\'"]subtitles[\'"] src=[\'"]([^\'"]+).vtt[\'"] srclang=[\'"].+?[\'"] label=[\'"]([^\'"]+)[\'"]>' aResult = oParser.parse(sHtmlContent, sPattern) if (aResult[0] == True): Files = [] for aEntry in aResult[1]: url = aEntry[0] label = aEntry[1] url = url + '.srt' if not url.startswith('http'): url = 'http:' + url if 'Forc' not in label: Files.append(url) return Files return False
def __getMediaLinkForGuest(self): api_call = False sUrl = 'https://www.vidbm.com/embed-' + self.__sUrl + '.html?auto=1' oRequest = cRequestHandler(sUrl) sHtmlContent = oRequest.request() oParser = cParser() packed = CheckCpacker(sHtmlContent) if packed: aa = CheckAADecoder(packed) if aa: sPattern = 'sources: *\[{file:"([^"]+)"' aResult = oParser.parse(aa, sPattern) if (aResult[0] == True): api_call = aResult[1][0] + '|User-Agent=' + UA if (api_call): return True, api_call return False, False
def __getMediaLinkForGuest(self): url = self.__sUrl #url = self.__sUrl.replace('embed.mystream.to','mstream.cloud') #url = 'https://mstream.cloud/gfa35ebu1nt1' oRequest = cRequestHandler(url) oRequest.addHeaderEntry('User-Agent', UA) oRequest.addHeaderEntry( 'Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8') sHtmlContent = oRequest.request() oParser = cParser() api_call = False a = '' b = '' c = '' urlcoded = '' sPattern = '(?:[>;]\s*)(゚ω゚.+?\(\'_\'\);)' aResult = oParser.parse(sHtmlContent, sPattern) if aResult[0]: for i in aResult[1]: decoded = AADecoder(i).decode() #VSlog(decoded) r = re.search("atob\(\'([^']+)\'\)", decoded, re.DOTALL | re.UNICODE) if r: urlcoded = r.group(1) break reducesHtmlContent = oParser.abParse(sHtmlContent, '<z9></z9><script>', '{if(document') sPattern = '(\w+)' aResult = oParser.parse(reducesHtmlContent, sPattern) if aResult[0]: mlist = sorted(aResult[1], key=len) mlist = mlist[-2:] a = mlist[0] b = mlist[1] #VSlog('a= ' + str(a)) #VSlog('b= ' + str(b)) sPattern = "=\['getAttribute','*([^']+)'*\]" aResult = oParser.parse(sHtmlContent, sPattern) if aResult[0]: encodedC = aResult[1][0].replace('window.', '') #VSlog('encodec= ' + str(encodedC)) c = Cdecode(sHtmlContent, encodedC) if c: #VSlog('c= ' + str(c)) api_call = decode(urlcoded, a, b, c) if (api_call): return True, api_call + '|User-Agent=' + UA return False, False
if 'validatehash.php?hashkey=' in url: if 'ref=' in sHtmlContent: a = re.compile('.*?ref="(.+?)".*').findall(sHtmlContent)[0] url = 'http://videomega.tv/cdn.php?ref=' + a request = urllib2.Request(url, None, headers) try: reponse = urllib2.urlopen(request) except URLError, e: print e.read() print e.reason sHtmlContent = reponse.read() oParser = cParser() #Premier test, lien code unescape sPattern = 'unescape.+?"(.+?)"' aResult = oParser.parse(sHtmlContent, sPattern) if (aResult[0] == True): decoder = aResult[1][0] #cUtil().urlDecode(aResult[1][0]) printDBG('decoder=' + str(decoder)) sPattern = 'file: "(.+?)"' aResult = oParser.parse(decoder, sPattern) if (aResult[0] == True): print 'code unescape' api_call = aResult[1][0]