Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-*- coding: utf-8 -*-
- # https://github.com/Kodi-vStream/venom-xbmc-addons
- from resources.lib.handler.requestHandler import cRequestHandler
- from resources.lib.parser import cParser
- from resources.hosters.hoster import iHoster
- from resources.lib.jsparser import JsParser
- from resources.lib.packer import cPacker
- import re
- from resources.lib.comaddon import VSlog
- UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.'
- class cHoster(iHoster):
- def __init__(self):
- self.__sDisplayName = 'MyStream'
- self.__sFileName = self.__sDisplayName
- def getDisplayName(self):
- return self.__sDisplayName
- def setDisplayName(self, sDisplayName):
- self.__sDisplayName = sDisplayName + ' [COLOR skyblue]' + self.__sDisplayName + '[/COLOR]'
- def setFileName(self, sFileName):
- self.__sFileName = sFileName
- def getFileName(self):
- return self.__sFileName
- def getPluginIdentifier(self):
- return 'mystream'
- def isDownloadable(self):
- return True
- def setUrl(self, sUrl):
- self.__sUrl = str(sUrl)
- # sPattern = '(?:https*:\/\/|\/\/)(?:www.|embed.|)mystream.(?:la|com|to)\/(?:video\/|external\/|embed-|)([0-9a-zA-Z]+)'
- # oParser = cParser()
- # aResult = oParser.parse(sUrl, sPattern)
- # self.__sUrl = 'https://mysembed.net/' + str(aResult[1][0])
- def checkUrl(self, sUrl):
- return True
- def getUrl(self):
- return self.__sUrl
- def getMediaLink(self):
- return self.__getMediaLinkForGuest()
- def __getMediaLinkForGuest(self):
- #VSlog(self.__sUrl)
- 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')
- #oRequest.addHeaderEntry('Accept-Encoding', 'identity')
- oRequest.addHeaderEntry('Referer', 'https://www.voirfilms.ec/voirfilms')
- sHtmlContent = oRequest.request()
- #fh = open('c:\\test.txt', "w")
- #fh.write(sHtmlContent)
- #fh.close()
- #decodage de la page html
- sHtmlContent3 = sHtmlContent
- maxboucle = 10
- while (maxboucle > 0):
- VSlog('loop : ' + str(maxboucle))
- sHtmlContent3 = CheckCpacker(sHtmlContent3)
- #sHtmlContent3 = CheckJJDecoder(sHtmlContent3)
- sHtmlContent3 = CheckAADecoder(sHtmlContent3)
- maxboucle = maxboucle - 1
- sHtmlContent = sHtmlContent3
- fh = open('c:\\test.txt', "w")
- fh.write(sHtmlContent)
- fh.close()
- oParser = cParser()
- api_call = False
- sPattern = '<meta name="og:image" content="(.+?.jpg)">'
- aResult = oParser.parse(sHtmlContent, sPattern)
- if (aResult[0] == True):
- api_call = aResult[1][0].replace('img/','').replace('jpg','mp4')
- # sPattern = '(?:[>;]\s*)(゚ω゚.+?\(\'_\'\);)'
- # aResult = oParser.parse(sHtmlContent, sPattern)
- # if aResult[0]:
- # for i in aResult[1]:
- # decoded = AADecoder(i).decode()
- # #VSlog(decoded)
- # r = re.search("\('src', '([^']+)'\);", decoded, re.DOTALL | re.UNICODE)
- # if r:
- # api_call = r.group(1)
- # break
- # #VSlog(api_call)
- # if 'qziqcysljv' in api_call:
- # api_call = ''
- if (api_call):
- return True, api_call
- return False, False
- #********************************************************************************************************************************
- def CheckCpacker(str):
- sPattern = '(function\(p,a,c,k,e(?:.|\s)+?{}\)\)\s*)'
- aResult = re.search(sPattern, str, re.DOTALL | re.UNICODE)
- if (aResult):
- #VSlog('Cpacker encryption')
- str2 = aResult.group(1)
- if not str2.endswith(';'):
- str2 = str2 + ';'
- #VSlog(str2)
- try:
- tmp = cPacker().unpack(str2)
- except:
- tmp = ''
- #VSlog(tmp)
- return str[:(aResult.start() + 0)] + tmp + str[(aResult.end()-1):]
- return str
- def CheckAADecoder(str):
- aResult = re.search('([>;]\s*)(゚ω゚.+?\(\'_\'\);)', str, re.DOTALL | re.UNICODE)
- if (aResult):
- VSlog('AA encryption')
- #tmp = aResult.group(1) + AADecoder(aResult.group(2)).decode()
- JP = JsParser()
- Liste_var = []
- try:
- JScode = aResult.group(2)
- JScode = unicode(JScode, "utf-8")
- tmp = JP.ProcessJS(JScode, Liste_var)
- tmp = JP.LastEval.decode('string-escape').decode('string-escape')
- return str[:aResult.start()] + tmp + str[aResult.end():]
- except:
- return ''
- return str
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement