def __getMediaLinkForGuest(self):
        oRequestHandler = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequestHandler.request()

        sAmfUrl = self.__getAmfUrl(sHtmlContent)
        logger.info('amf: ' + str(sAmfUrl))
        if (sAmfUrl == False):
            return False, ''
        
        oRequestHandler = cRequestHandler(sAmfUrl)
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        sAmfContent = oRequestHandler.request()

        sRtmp = self.__getRtmp(sAmfContent)
        logger.info('rtmp: ' + str(sRtmp))
        if (sRtmp == False):
            return False, ''

        sPageUrl = self.__getPageUrl()
        logger.info('pageurl: ' + str(sPageUrl))
        if (sPageUrl == False):
            return False, ''
        
        sSwf = self.__getSwf(sHtmlContent)
        logger.info('swf: ' + str(sSwf))
        if (sSwf == False):
            return False, ''
        
        sMediaLink = sRtmp + ' swfUrl=' + sSwf + ' swfVfy=1 live=true pageUrl=' + sPageUrl
        logger.info('medialink: ' + str(sMediaLink))
        
        return True, sMediaLink
예제 #2
0
    def __getMediaLinkForGuest(self):
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()

        sPattern = 'vid=([^;]+);'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0] == True):
            videoId = aResult[1][0]
           
            oRequest = cRequestHandler(self.URL_XML)
            oRequest.addParameters('vid', videoId)
            oRequest.addParameters('hiLoPref', 'lo')
            sHtmlContent = oRequest.request()

            sPattern = '<src>([^<]+)</src>'
            oParser = cParser()
            aResult = oParser.parse(sHtmlContent, sPattern)

            if (aResult[0] == True):
                sStreamUrl = aResult[1][0]
                return True, sStreamUrl

        return False, False
예제 #3
0
    def __getMediaLinkForGuest(self):
        
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()

        sPattern = 'flashvars.initItemXML = "([^"]+)";'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0] == True):
            sXmlFile = aResult[1][0]

            try:
                oRequest = cRequestHandler(sXmlFile)
                sHtmlContent = oRequest.request()
            except:
                try:
                    oRequest = cRequestHandler(sXmlFile)
                    sHtmlContent = oRequest.request()
                except:
                    # http error 502 :(
                    return False

            sPattern = '<url>(.*?)</url>'
            oParser = cParser()
            aResult = oParser.parse(sHtmlContent, sPattern)           

            if (aResult[0] == True):
                sStreamUrl = aResult[1][0]
                
                return True, sStreamUrl

        return False, False
예제 #4
0
def __getSecurityCookieValue():
    oRequestHandler = cRequestHandler(URL_MAIN)
    sHtmlContent = oRequestHandler.request()

    sPattern = "<HTML><HEAD><SCRIPT language=\"javascript\" src=\"([^\"]+)\">"+\
    "</SCRIPT></HEAD><BODY onload=\"scf\('(.*?)'\+'(.*?)','/'\);\"></BODY></HTML>"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0] == False:
        return ''
    sScriptFile = URL_MAIN + str(aResult[1][0][0])
    sHashSnippet = str(aResult[1][0][1])+str(aResult[1][0][2])

    oRequestHandler = cRequestHandler(sScriptFile)
    oRequestHandler.addHeaderEntry('Referer', 'http://g-stream.in/')
    oRequestHandler.addHeaderEntry('Accept', '*/*')
    oRequestHandler.addHeaderEntry('Host', 'g-stream.in')
    sHtmlContent = oRequestHandler.request()

    sPattern = "escape\(hsh \+ \"([^\"]+)\"\)"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    sHash = aResult[1][0]
    sHash = sHashSnippet + sHash
    sSecurityCookieValue = 'sitechrx=' + str(sHash)
    print 'Token: '+sSecurityCookieValue
    return sSecurityCookieValue 
예제 #5
0
    def __getMediaLinkForGuest(self):
        api_call = False

        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()

        oParser = cParser()
        sPattern =  "var vsuri = \'(.+?)\'"
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0]):
            oRequest = cRequestHandler(aResult[1][0])
            sHtmlContent1 = oRequest.request()

            sPattern1 =  '"([^"]+)":"([^"]+)"'
            aResult1 = oParser.parse(sHtmlContent1, sPattern1)

        if (aResult1[0]):

            url=[]
            qua=[]
            api_call = False

            for aEntry in aResult1[1]:
                url.append(aEntry[1])
                qua.append(aEntry[0])

            api_call = dialog().VSselectqual(qua, url)

            if (api_call):
                return True, api_call

        return False, False
def listShow():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('showUrl')):
        sShowUrl = oInputParameterHandler.getValue('showUrl')

        #Video im Player
        sPattern = '<h3 class="imgHeadline black defaultMarginBottom">\s*(.*?)\s*</h3>'
        sTitleCurrent = cParser().parse(cRequestHandler(sShowUrl).request(), sPattern)[1][0].strip()    
        __showHoster(oGui, sTitleCurrent, sShowUrl)
        
        #andere Videos
        sPattern = '<li class="half (?:playlist )?dashed_bottom".*?<a title="([^"]+)"\s*href="([^"]+)".*?</li>'

        oRequest = cRequestHandler(sShowUrl)
        sHtmlContent = oRequest.request()
     
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sUrl = URL_MAIN + str(aEntry[1])
                __showHoster(oGui, aEntry[0], sUrl)

    oGui.setEndOfDirectory()
def getMovieUrl():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHosterIdentifier = oInputParameterHandler.getValue('hosterIdentifier')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();

    sPattern = '<br><br><script type="text/javascript" src="([^"]+)"></script><br>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        sMovieUrl = aResult[1][0]
                
        oRequestHandler = cRequestHandler(sMovieUrl)
        sHtmlContent = oRequestHandler.request();
        sPattern = '<embed src="([^"]+)"'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sMovieUrl = aResult[1][0]
            
            oHoster = cHosterHandler().getHoster(sHosterIdentifier)            
            cHosterGui().showHoster(oGui, oHoster, sMovieUrl)


    oGui.setEndOfDirectory()
예제 #8
0
    def __getMediaLinkByPremiumUser(self, sUsername, sPassword):
        oRequestHandler = cRequestHandler('http://www.megavideo.com/?s=account')
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        oRequestHandler.addParameters('login', '1')
        oRequestHandler.addParameters('username', sUsername)
        oRequestHandler.addParameters('password', sPassword)
        oRequestHandler.request()
      
        aHeader = oRequestHandler.getResponseHeader();
        sReponseCookie = aHeader.getheader("Set-Cookie")

        self.__sUrl = self.__getIdFromUrl()
        
        sPattern = 'user=([^;]+);'
        oParser = cParser()
        aResult = oParser.parse(sReponseCookie, sPattern)
        if (aResult[0] == True):
            sUserId = aResult[1][0]
            sUrl = 'http://www.megavideo.com/xml/player_login.php?u=' + str(sUserId) + '&v=' + str(self.__sUrl)
            oRequestHandler = cRequestHandler(sUrl)
            sXmlContent = oRequestHandler.request()

            sPattern = 'downloadurl="([^"]+)"'
            oParser = cParser()
            aResult = oParser.parse(sXmlContent, sPattern)
            
            if (aResult[0] == True):
                sMediaLink = cUtil().urlDecode(str(aResult[1][0]))
                return True, sMediaLink

        return False, ''
    def __getMediaLinkForGuest(self):
        sPattern = '([^/]+)$'
        vid = self.__sUrl
        vidId = cParser().parse(vid,sPattern)
        url = 'http://embed.movshare.net/embed.php?v=' + vidId[1][0]
        oRequest = cRequestHandler(url)
        sHtmlContent = oRequest.request()
        sPattern = '<form id="watch" name="watch" method="post" action=""><input type="hidden" name="wm" value="([^"]+)">'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0] == True):
            sUid = aResult[1][0]

            oRequest = cRequestHandler(self.__sUrl)
            oRequest.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
            oRequest.addParameters('submit.x','149')
            oRequest.addParameters('submit.y', '19')
            oRequest.addParameters('wm', sUid)
            sHtmlContent = oRequest.request()

            aMediaLink = cParser().parse(sHtmlContent, self.getPattern())          
            if (aMediaLink[0] == True):
                link = str(aMediaLink[1][0])
                link = 'http://w00.' + link[link.find('movshare'):]
                return True, link
        else:
            sPattern = 'type="video/divx"\s*src="([^"]+)"'        
            aMediaLink = cParser().parse(sHtmlContent, sPattern)
            if (aMediaLink[0] == True):
                link = str(aMediaLink[1][0])
                link = 'http://w00.' + link[link.find('movshare'):]
                return True, link
    
        return False, False
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    sRealUrl = __checkForRealUrl(sHtmlContent)

    if (sRealUrl != False):
        oRequestHandler = cRequestHandler(sRealUrl)
        sHtmlContent = oRequestHandler.request()

    sPattern = '<iframe.+?src="(.+?)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            sHosterUrl = str(aEntry)
            if sHosterUrl.startswith('//'):
                sHosterUrl = 'https:' + sHosterUrl

            oHoster = cHosterGui().checkHoster(sHosterUrl)
            if (oHoster != False):
                oHoster.setDisplayName(sMovieTitle)
                oHoster.setFileName(sMovieTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)

    oGui.setEndOfDirectory()
예제 #11
0
    def __getMediaLinkForGuest(self):
        sUrlIp = self.__getIpFromUrl()
        
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()
        
        sPattern = "var t=setTimeout\(\"lc\('([^']+)','([^']+)','([^']+)'\)"
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sS = str(aEntry[0])
                sK = str(aEntry[1])
                sT = str(aEntry[2])

                sNextUrl = 'http://' + str(sUrlIp) + '/object.php?s='+sS+'&k='+sK+'&t='+sT
                                
                oRequest = cRequestHandler(sNextUrl)
                sHtmlContent = oRequest.request()

                sPattern = '<param name="flashvars" value="file=(.*?)&'
                oParser = cParser()
                aResult = oParser.parse(sHtmlContent, sPattern)
                
                if (aResult[0] == True):
                    sLinkToFile = 'http://' + str(sUrlIp) + str(aResult[1][0])
                    return True, sLinkToFile
                
        return False, False
예제 #12
0
 def __getMediaLinkForGuest(self):
     
     oRequest = cRequestHandler(self.__sUrl)
     sHtmlContent = oRequest.request()
     
     #aHeader = oRequest.getResponseHeader()
     #sReponseCookie = aHeader.getheader("Set-Cookie")
  
     oParser = cParser()
  
     sPattern = 'file: "([^"]+)"'
     aResult = oParser.parse(sHtmlContent, sPattern)
     
     if not (aResult[0] == True):
         sPattern = '<iframe[^<>]+?src="(.+?)"[^<>]+?><\/iframe>'
         aResult = oParser.parse(sHtmlContent, sPattern)
         
         if (aResult[0] == True):
             url = aResult[1][0]
             
             oRequest = cRequestHandler(url)
             oRequest.addHeaderEntry('Referer',url)
             #oRequest.addHeaderEntry('Host','dowed.info')
             sHtmlContent = oRequest.request()
             
             sPattern = 'file: "([^"]+)"'
             aResult = oParser.parse(sHtmlContent, sPattern)
             
     if (aResult[0] == True):
         api_call = aResult[1][0]
         return True, api_call       
         
     return False, False
def resolveLinkcrypt(sUrl, hosters):
    oRequest = cRequestHandler(sUrl)
    sHtmlContent = oRequest.request()
    pattern = '<form action="http://linkcrypt.ws/out.html"[^>]*?>.*?'
    pattern += '<input[^>]*?value="(.+?)"[^>]*?name="file"'
    aResult = cParser().parse(sHtmlContent, pattern)
    if not aResult[0]:
        return

    for idx, weblink_id in enumerate(aResult[1]):
        try:
            oRequest = cRequestHandler("http://linkcrypt.ws/out.html")
            oRequest.addParameters('file', weblink_id)
            data = oRequest.request()
            link = re.compile("top.location.href=doNotTrack\('(.+?)'\)").findall(data)[0]
            hname = getHosterName(link)
            hname = "Part %d - %s" % (idx + 1, hname)
            logger.info("Resolved LinkCrypt link: %s" % link)
            hoster = dict()
            hoster['link'] = link
            hoster['name'] = hname
            hoster['displayedName'] = hname
            hosters.append(hoster)
        except Exception, detail:
            logger.info(detail)
            pass
def __getSecurityCookieValue():
    oRequestHandler = cRequestHandler(URL_MAIN)
    sHtmlContent = oRequestHandler.request()

    sPattern = (
        '<HTML><HEAD><SCRIPT language="javascript" src="([^"]+)">'
        + "</SCRIPT></HEAD><BODY onload=\"scf\('(.*?)'\+'(.*?)','/'\);\"></BODY></HTML>"
    )
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0] == False:
        return ""
    sScriptFile = URL_MAIN + str(aResult[1][0][0])
    sHashSnippet = str(aResult[1][0][1]) + str(aResult[1][0][2])

    oRequestHandler = cRequestHandler(sScriptFile)
    oRequestHandler.addHeaderEntry("Referer", "http://g-stream.in/")
    sHtmlContent = oRequestHandler.request()

    sPattern = 'escape\(hsh \+ "([^"]+)"\)'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    sHash = aResult[1][0]
    sHash = sHashSnippet + sHash
    sSecurityCookieValue = "sitechrx=" + str(sHash)
    logger.info("Token: " + sSecurityCookieValue)
    return sSecurityCookieValue
예제 #15
0
def showHosters():
    oGui = cGui()
    
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()           
     
    oParser = cParser()
    
    sPattern = '\/(www\.alluc\.ee\/embed\/[a-zA-Z0-9%-_]+?)\?alt='
    aResult = oParser.parse(sHtmlContent, sPattern)
    
    if (aResult[0] == True):
        sUrl = 'http://' + aResult[1][0]

        oRequestHandler = cRequestHandler(sUrl)
        sHtmlContent = oRequestHandler.request()

        #fh = open('c:\\test.txt', "w")
        #fh.write(sHtmlContent)
        #fh.close()        
                          
        sPattern = "decrypt\('(.+?)', *'(.+?)'\)"
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        
        if (aResult[0] == True):
            
            sHtmlContent = Decrypt(aResult[1][0][0],aResult[1][0][1])
            
            sPattern = '<iframe.+?src=["|\'](.+?)["|\'].+?<\/iframe>'
            
            aResult = oParser.parse(sHtmlContent, sPattern)
            
            
        else:
            return
            
    
    if (aResult[0] == True):
            
        aEntry = aResult[1]
        
        sTitle = sMovieTitle
        
        sHosterUrl = str(aEntry[0])
        
        oHoster = cHosterGui().checkHoster(sHosterUrl)
        if (oHoster != False):
            oHoster.setDisplayName(sTitle)
            oHoster.setFileName(sMovieTitle)
            cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumbnail)
            
    oGui.setEndOfDirectory()
예제 #16
0
    def __getMediaLinkForGuest(self):
        api_call = False

        sUrl = self.__sUrl

        oParser = cParser()
        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

        if 'rapidvideo' in sUrl:#qual site film illimite
            sPattern = '<a href="([^"]+&q=\d+p)"'
            aResult = oParser.parse(sHtmlContent, sPattern)
            if (aResult[0] == True):
                url=[]
                qua=[]
                for i in aResult[1]:
                    url.append(str(i))
                    qua.append(str(i.rsplit('&q=', 1)[1]))

                if len(url) == 1:
                    sPattern = '<source src="([^"]+)" type="video/.+?"'
                    aResult = oParser.parse(sHtmlContent, sPattern)
                    if (aResult[0] == True):
                        api_call = aResult[1][0]


                elif len(url) > 1:
                    dialog2 = xbmcgui.Dialog()
                    ret = dialog2.select('Select Quality', qua)
                    if (ret > -1):
                        oRequest = cRequestHandler(url[ret])
                        sHtmlContent = oRequest.request()
                        sPattern = '<source src="([^"]+)" type="video/.+?"'
                        aResult = oParser.parse(sHtmlContent, sPattern)
                        if (aResult[0] == True):
                            api_call = aResult[1][0]
        else:
            sPattern = '{"file":"([^"]+)","label":"([^"]+)"'
            aResult = oParser.parse(sHtmlContent, sPattern)
            if (aResult[0] == True):
                url=[]
                qua=[]
                for i in aResult[1]:
                    url.append(str(i[0]))
                    qua.append(str(i[1]))

                if len(url) == 1:
                    api_call = url[0]

                elif len(url) > 1:
                    dialog2 = xbmcgui.Dialog()
                    ret = dialog2.select('Select Quality', qua)
                    if (ret > -1):
                        api_call = url[ret]

        if (api_call):
            return True, api_call

        return False, False
def showMovies(sSearch = ''):
    oGui = cGui()
    oParser = cParser()
    if sSearch:
        sUrl = URL_SEARCH[0] + sSearch.replace(' ','+')


        oRequestHandler = cRequestHandler(sUrl)
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)

        sHtmlContent = oRequestHandler.request()
        sPattern = '<div class="item-box"><a class="item-link" href="([^"]+)"><div class="item-img"><img src="(.+?)".+?<div class="item-title">(.+?)<\/div>(.+?)div>'
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

        oRequestHandler = cRequestHandler(sUrl)
        sHtmlContent = oRequestHandler.request()

        sPattern = '<div class="item-box"><a class="item-link" href="([^"]+)">.+?<img src="(.+?)".+?<div class="item-title">(.+?)<\/div><div class="item-info clearfix">(.+?)<\/div>'

    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)

        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sUrl = aEntry[0]
            sTitle = aEntry[2]
            sThumb = aEntry[1]
            sDesc = aEntry[3]
            if not sThumb.startswith('http'):
                sThumb = URL_MAIN + sThumb


            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oGui.addMisc(SITE_IDENTIFIER, 'showHosters', sTitle, 'doc.png', sThumb, sDesc, oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies', '[COLOR teal]Next >>>[/COLOR]', oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
예제 #18
0
def parseMovieSimpleList():
    oGui = cGui()
    params = ParameterHandler()
    oParser = cParser()
    
    if (params.exist('iPage')):
        iPage = params.getValue('iPage')
    else:
        iPage = 1

    if (params.exist('sUrl')):
        sUrl = params.getValue('sUrl')
        logger.info(sUrl)
        if (sUrl.find('tvshows-season-') != -1):
            sPattern = '<TR>\s*<TD.*?id="tdmovies".*?<a href="([^"]+)">(.*?)\s*</a>.*?<img border=0 src="http://[^/]+/img/([^"]+)".*?</TR>'
            if params.exist('sLanguageToken'):
                sLanguageToken = params.getValue('sLanguageToken')
                oRequest = cRequestHandler(sUrl)
                sHtmlContent = oRequest.request()
                aResult = oParser.parse(sHtmlContent, sPattern)
                if aResult[0] == True:
                    for aEntry in aResult[1]:
                        sUrl = str(aEntry[0]).strip()
                        if not (sUrl.startswith('http')):
                            sUrl = URL_MAIN +'/'+ sUrl
                        if aEntry[2] == sLanguageToken:
                            break
                    oRequest = cRequestHandler(sUrl)
                    sHtmlContent = oRequest.request()
                    aResult = oParser.parse(sHtmlContent, sPattern)
                    if aResult[0] == True:
                        for aEntry in aResult[1]:
                            sUrl = str(aEntry[0]).strip()
                            if not (sUrl.startswith('http')):
                                sUrl = URL_MAIN +'/'+ sUrl
                            if aEntry[2] == sLanguageToken:
                                break
                                
            else:
                oRequest = cRequestHandler(sUrl)
                sHtmlContent = oRequest.request()
                aResult = oParser.parse(sHtmlContent, sPattern)
                if aResult[0] == True:
                    sUrl = str(aResult[1][0][0]).strip()
                    if not (sUrl.startswith('http')):
                        sUrl = URL_MAIN + sUrl
                    oRequest = cRequestHandler(sUrl)
                    sHtmlContent = oRequest.request()
                    aResult = oParser.parse(sHtmlContent, sPattern)
                    if aResult[0] == True:
                        sUrl = str(aResult[1][0][0]).strip()
                        if not (sUrl.startswith('http')):
                            sUrl = URL_MAIN +'/'+ sUrl
            __getAllSeasons(sUrl)
            
        else:
            __parseMovieSimpleList(sUrl, iPage, oGui)
            oGui.setView('movies')
            oGui.setEndOfDirectory()
예제 #19
0
def showHosters():
    UA = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0'
    oGui = cGui()
    oParser = cParser()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb  = oInputParameterHandler.getValue('sThumb')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    #Recuperer variable pour url de base
    sPattern = 'id=.+?trembed=([^"]+).+?frameborder'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        for aEntry in aResult[1]:

            site = URL_MAIN + "?trembed=" + aEntry
            oRequestHandler = cRequestHandler(site)
            sHtmlContent = oRequestHandler.request()

            #Recuperation de l'url suivante
            sPattern1 = '<div class="Video"><iframe.+?src="([^"]+)"'
            aResult = oParser.parse(sHtmlContent, sPattern1)

            Url = ''.join(aResult[1])
            if not 'hdsto' in Url:
                oRequestHandler = cRequestHandler(Url)
                sHtmlContent = oRequestHandler.request()

                #Recuperation de l'id
                sPattern1 = "var id.+?'(.+?)'"
                aResult = oParser.parse(sHtmlContent, sPattern1)
                sPost = ''.join(aResult[1])[::-1]

                oRequestHandler = cRequestHandler(URL_MAIN + '?trhidee=1&trfex=' + sPost)
                oRequestHandler.addHeaderEntry('Referer', Url)
                sHtmlContent = oRequestHandler.request()
                sHosterUrl = oRequestHandler.getRealUrl()

            else:
                 sHosterUrl = 'https://' + Url.split('/')[2] + '/hls/'+Url.split('id=')[1]+'/'+Url.split('id=')[1]+'.playlist.m3u8'
                 VSlog(sHosterUrl)

            oHoster = cHosterGui().checkHoster(sHosterUrl)
            if (oHoster != False):
                oHoster.setDisplayName(sMovieTitle)
                oHoster.setFileName(sMovieTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)

    oGui.setEndOfDirectory()
예제 #20
0
    def __getMediaLinkForGuest(self):
        print self.__sUrl
        
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()
        
        #fh = open('c:\\test.txt', "w")
        #fh.write(sHtmlContent)
        #fh.close()
        
        oParser = cParser()
        
        #lien indirect
        sPattern = '<iframe[^<>]+src="(http:\/\/allvid\.ch\/embed-.+?)"[^<>]+><\/iframe>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            oRequest = cRequestHandler(aResult[1][0])
            sHtmlContent = oRequest.request()
        
        #test pour voir si code
        sPattern = '(eval\(function\(p,a,c,k,e(?:.|\s)+?\))<\/script>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sHtmlContent = cPacker().unpack(aResult[1][0])
        
        sPattern = 'file:"([^"]+\.mp4)"(?:,label:"([^"]+)")*'
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        api_call = False

        if (aResult[0] == True):
            
            #initialisation des tableaux
            url=[]
            qua=[]
            
            #Replissage des tableaux
            for i in aResult[1]:
                url.append(str(i[0]))
                qua.append(str(i[1]))
                
            #Si une seule url
            if len(url) == 1:
                api_call = url[0]
            #si plus de une
            elif len(url) > 1:
                #Afichage du tableau
                dialog2 = xbmcgui.Dialog()
                ret = dialog2.select('Select Quality',qua)
                if (ret > -1):
                    api_call = url[ret]
 
        if (api_call):
            return True, api_call
            
        return False, False
예제 #21
0
def showHosters():
    oGui = cGui()
    
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()           
     
    oParser = cParser()
    
    sPattern = '<iframe.+?src="(.+?)".+?<\/iframe>'
    aResult = oParser.parse(sHtmlContent, sPattern)
    
    if (aResult[0] == True) and aResult[1][0].startswith('/'):
        sUrl = URL_MAIN + aResult[1][0][1:]

        oRequestHandler = cRequestHandler(sUrl)
        sHtmlContent = oRequestHandler.request()           
                          
        sPattern = '<a href="([^<>"]+?)" rel="nofollow" target="_blank">Click to Open The Full Video<\/a>'
        
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0] == True):
            sUrl = aResult[1][0]
            
            oRequestHandler = cRequestHandler(sUrl)
            sHtmlContent = oRequestHandler.request()
            
            sPattern = '<iframe.+?src="(.+?)".+?<\/iframe>'
            aResult = oParser.parse(sHtmlContent, sPattern)
            
        else:
            return
            
        
    
    if (aResult[0] == True):
            
        aEntry = aResult[1]
        
        sTitle = sMovieTitle
        
        sHosterUrl = str(aEntry[0])
        
        oHoster = cHosterGui().checkHoster(sHosterUrl)
        if (oHoster != False):
            oHoster.setDisplayName(sTitle)
            oHoster.setFileName(sMovieTitle)
            cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumbnail)
            
    oGui.setEndOfDirectory()
def parseMovieSimpleList():
    oInputParameterHandler = cInputParameterHandler()
    oParser = cParser()
    
    if (oInputParameterHandler.exist('iPage')):
        iPage = oInputParameterHandler.getValue('iPage')
    else:
        iPage = 1

    if (oInputParameterHandler.exist('sUrl')):
        sUrl = oInputParameterHandler.getValue('sUrl')
        if (sUrl.find('tvshows-season-') != -1):
            sPattern = '<TR>\s*<TD.*?id="tdmovies".*?<a href="([^"]+)">(.*?)\s*</a>.*?<img border=0 src="http://[^/]+/img/([^"]+)".*?</TR>'
            if oInputParameterHandler.exist('sLanguageToken'):
                sLanguageToken = oInputParameterHandler.getValue('sLanguageToken')
                oRequest = cRequestHandler(sUrl)
                sHtmlContent = oRequest.request()
                aResult = oParser.parse(sHtmlContent, sPattern)
                if aResult[0] == True:
                    for aEntry in aResult[1]:
                        sUrl = str(aEntry[0]).strip()
                        if not (sUrl.startswith('http')):
                            sUrl = URL_MAIN + sUrl
                        if aEntry[2] == sLanguageToken:
                            break
                    oRequest = cRequestHandler(sUrl)
                    sHtmlContent = oRequest.request()
                    aResult = oParser.parse(sHtmlContent, sPattern)
                    if aResult[0] == True:
                        for aEntry in aResult[1]:
                            sUrl = str(aEntry[0]).strip()
                            if not (sUrl.startswith('http')):
                                sUrl = URL_MAIN + sUrl
                            if aEntry[2] == sLanguageToken:
                                break
                                
            else:
                oRequest = cRequestHandler(sUrl)
                sHtmlContent = oRequest.request()
                aResult = oParser.parse(sHtmlContent, sPattern)
                if aResult[0] == True:
                    sUrl = str(aResult[1][0][0]).strip()
                    if not (sUrl.startswith('http')):
                        sUrl = URL_MAIN + sUrl
                    oRequest = cRequestHandler(sUrl)
                    sHtmlContent = oRequest.request()
                    aResult = oParser.parse(sHtmlContent, sPattern)
                    if aResult[0] == True:
                        sUrl = str(aResult[1][0][0]).strip()
                        if not (sUrl.startswith('http')):
                            sUrl = URL_MAIN + sUrl
            __showAllSeasons(sUrl)
            
        else:
            __parseMovieSimpleList(sUrl, iPage)
def showHosters():
    
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()


    sPattern = '<input type="hidden" name="ep" id="ep" value="([^"]+)".+?name="type" id="type" value="([^"]+)".+?name="np" id="np" value="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        ep = aResult[1][0][0]
        type = aResult[1][0][1]
        np = aResult[1][0][2]
        ref = sUrl.rsplit('/', 1)[0]

        pdata = 'action=electeur&lien_referer=' + ref + '&ep=' + ep + '&type=' + type + '&np=' + np
        

        oRequest = cRequestHandler(URL_MAIN + 'wp-admin/admin-ajax.php')
        oRequest.setRequestType(1)
        oRequest.addHeaderEntry('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:61.0) Gecko/20100101 Firefox/61.0')
        oRequest.addHeaderEntry('Referer', sUrl)
        oRequest.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
        oRequest.addHeaderEntry('Accept-Language', 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
        oRequest.addHeaderEntry('Content-Type', 'application/x-www-form-urlencoded')
        oRequest.addParametersLine(pdata)

        sHtmlContent = oRequest.request()

        if 'serie' in sUrl or 'manga' in sUrl:
            sPattern = "onclick=\"lecteur_.+?\(.+?'([^']+)',.+?\);"
        else:
            sPattern = '<iframe.+?src=[\'|"](.+?)[\'|"]'

        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            for aEntry in aResult[1]:

                sHosterUrl = aEntry

                oHoster = cHosterGui().checkHoster(sHosterUrl)
                if (oHoster != False):
                    oHoster.setDisplayName(sMovieTitle)
                    oHoster.setFileName(sMovieTitle)
                    cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)

    oGui.setEndOfDirectory()
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue("siteUrl")
    sTitle = oInputParameterHandler.getValue("sTitle")

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    sUrl = oRequestHandler.getRealUrl()

    # take care of recaptcha-forms
    while recaptcha.checkForReCaptcha(sHtmlContent):
        aCaptchaParams = recaptcha.getCaptcha(sHtmlContent)
        oSolver = cInputWindow(captcha=aCaptchaParams[0])
        userresponse = oSolver.get()
        if not userresponse:
            break
        params = recaptcha.buildResponse(userresponse, aCaptchaParams[1])
        oRequestHandler = cRequestHandler(sUrl)
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        for param in params.split("&"):
            param = param.split("=")
            oRequestHandler.addParameters(param[0], param[1])
        oRequestHandler.addParameters("submit", "true")
        sHtmlContent = oRequestHandler.request()

    # if the videolink is in an iframe
    sPattern = '<iframe id="iframe" src="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName=sTitle)
        oGui.setEndOfDirectory()
        return

    # if its in a flash-container
    sPattern = '<param name="movie" value="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName=sTitle)
        oGui.setEndOfDirectory()
        return

    # if its done by simple redirects
    else:
        sStreamUrl = oRequestHandler.getRealUrl()
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName=sTitle)
        oGui.setEndOfDirectory()
예제 #25
0
def __getSecurityCookieValue():
    oRequestHandler = cRequestHandler(URL_NEWS, False)
    oRequestHandler.removeNewLines(False)
    oRequestHandler.removeBreakLines(False)
    sHtmlContent = oRequestHandler.request()
    sPattern = "var hash=\[(.*?)\]"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0] == False:
        logger.error("Can't find script file for cookie")
    result = jsunprotect.jsunprotect(sHtmlContent)
    if not result:
        logger.error("Not protected or Deactivator not found")
        return ''
    else:
        logger.info(result)
        oRequestHandler = cRequestHandler(URL_MAIN+'/?'+result, False)
        oRequestHandler.addHeaderEntry('Referer', URL_MAIN)
        #oRequestHandler.addHeaderEntry('Accept', '*/*')
        oRequestHandler.addHeaderEntry('Host', domain)
        oRequestHandler.request()
        return ''
    for aEntry in aResult[1][0].split(","):
		sScriptFile = URL_MAIN +'/'+ str(aEntry).replace("'","").strip()
		sScriptFile.replace(" ","")

		logger.info("scriptfile: %s" % sScriptFile)
		oRequestHandler = cRequestHandler(sScriptFile)
		oRequestHandler.addHeaderEntry('Referer', URL_MAIN)
		oRequestHandler.addHeaderEntry('Accept', '*/*')
		oRequestHandler.addHeaderEntry('Host', domain)
		sHtmlContent = oRequestHandler.request()

    sPattern = "escape\(hsh \+ \"([^\"]+)\"\)"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if not aResult[0]:
        logger.info("No hash value found for the cookie")
        return ''

    sHash = aResult[1][0]

    sHash = sHashSnippet + sHash
    sSecurityCookieValue = "sitechrx=" + str(sHash) + ";Path=/"

    oRequestHandler = cRequestHandler(URL_MAIN)
    oRequestHandler.addHeaderEntry("Cookie", sSecurityCookieValue)
    oRequestHandler.request()

    logger.info("Token: %s" % sSecurityCookieValue)

    return sSecurityCookieValue    
예제 #26
0
def getHosterUrlandPlay(sUrl = False):
  results = []
  oParams = ParameterHandler()
  sSecurityValue = oParams.getValue('securityCookie')
  sTitle = oParams.getValue('title')
  if not sUrl:
    sUrl = oParams.getValue('url')
  sUrl = sUrl.replace('&amp;', '&')
  oRequest = cRequestHandler(sUrl)
  oRequest.addHeaderEntry('Cookie', sSecurityValue)
  oRequest.addHeaderEntry('Referer', URL_MAIN)
  sHtmlContent = oRequest.request()
  #pattern for multipart stream
  sPattern = '<a rel=\\\\"(.*?)\\\\"'
  oParser = cParser()
  aResult = oParser.parse(sHtmlContent, sPattern)
  if (aResult[0]):
    aMovieParts = aResult[1]
    ii = 1
    for sPartUrl in aMovieParts:
        sPartUrl = sPartUrl.replace('\\/', '/')
        oRequest = cRequestHandler(sUrl+'&Part='+str(ii))
        oRequest.addHeaderEntry('Cookie', sSecurityValue)
        oRequest.addHeaderEntry('Referer', URL_MAIN)
        sHtmlContent = oRequest.request()
        #pattern for stream url (single part)
        sPattern = '<a\shref=\\\\".*?(http:.*?)\\\\"'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0]):
            aParts = aResult[1]
            sPartUrl = aParts[0].replace('\\/', '/')
            result = {}
            result['streamUrl'] = sPartUrl
            result['resolved'] = False
            result['title'] = sTitle + ' Part '+str(ii)
            results.append(result)
            ii +=1
  else:
    #pattern for stream url (single part)
    sPattern = '<a\shref=\\\\".*?(http:.*?)\\\\"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0]):
        aMovieParts = aResult[1]
        sPartUrl = aMovieParts[0].replace('\\/', '/')
        result = {}
        result['streamUrl'] = sPartUrl
        result['resolved'] = False
        results.append(result)
  print results
  return results
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHoster = oInputParameterHandler.getValue('hosterName')
    sTitle = oInputParameterHandler.getValue('sTitle')
   
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    sUrl = oRequestHandler.getRealUrl()
    #--> Recaptchabehandlung
    while(recaptcha.checkForReCaptcha(sHtmlContent)):
        aCaptchaParams = recaptcha.getCaptcha(sHtmlContent)
        oSolver = cInputWindow(captcha = aCaptchaParams[0])
        userresponse = oSolver.get()
        if not userresponse:
         break
        params = recaptcha.buildResponse(userresponse, aCaptchaParams[1])
        oRequestHandler = cRequestHandler(sUrl)
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        for param in params.split('&'):
            param = param.split('=')
            oRequestHandler.addParameters(param[0], param[1])
        oRequestHandler.addParameters('submit', 'true')
        sHtmlContent = oRequestHandler.request()
    #<-- Recaptchabehandlung
    #Videolink in einem Iframe?
    sPattern = '<iframe id="iframe" src="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster2(sHoster)  
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName = sTitle)
        oGui.setEndOfDirectory()
        return 
    sPattern = '<param name="movie" value="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster2(sHoster)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName = sTitle)
        oGui.setEndOfDirectory()
        return
    #Link fuehrt ueber redirects direkt zum Hoster
    else:
        sStreamUrl = oRequestHandler.getRealUrl()
        oHoster = cHosterHandler().getHoster2(sHoster)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName = sTitle)
        oGui.setEndOfDirectory()
    #oGui.setEndOfDirectory()
예제 #28
0
    def __getMediaLinkForGuest(self):
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()

        aHeader = oRequest.getResponseHeader()
        sPhpSessionId = self.__getPhpSessionId(aHeader)

        sPattern = 'var time_wait = ([^;]+);'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
                sSecondsForWait = int(aResult[1][0]) + 2

                sPattern = '<input type="hidden" name="code" value="([^"]+)"'
                oParser = cParser()
                aResult = oParser.parse(sHtmlContent, sPattern)
                if (aResult[0] == True):
                    sCode = aResult[1][0]

                    oGui = cGui()
                    oGui.showNofication(sSecondsForWait, 3)
                    time.sleep(sSecondsForWait)

                    rndX = random.randint(1, 99999999-10000000)+10000000
                    rndY = random.randint(1, 999999999-100001000)+100000000
                    ts1 = float(time.time())
                    ts2 = float(time.time())
                    ts3 = float(time.time())
                    ts4 = float(time.time())
                    ts5 = float(time.time())

                    sCookieValue = '__utma=' + str(rndY) + '.' + str(rndX) + '.' + str(ts1) + '.' + str(ts2) + '.' + str(ts3) + '; '
                    sCookieValue = sCookieValue + '__utmz=' + str(rndY) + '.' + str(ts4) + '.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); '
                    sCookieValue = sCookieValue + sPhpSessionId +'; '
                    sCookieValue = sCookieValue + '__utmc=' + str(rndY) + "; "
                    sCookieValue = sCookieValue + '__utmb=' + str(rndY) + '.7.10.' +  str(ts5) + "; ADBLOCK=1"

                    oRequest = cRequestHandler(self.__sUrl)
                    oRequest.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
                    oRequest.addHeaderEntry('Cookie', sCookieValue)
                    oRequest.addParameters('code', sCode)
                    sHtmlContent = oRequest.request()

                    sPattern = '<param name="src" value="([^"]+)"'
                    oParser = cParser()
                    aResult = oParser.parse(sHtmlContent, sPattern)

                    if (aResult[0] == True):
                        return True, aResult[1][0]

        return False, aResult
예제 #29
0
    def __getMediaLinkForGuest(self): 
  
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()
        oParser = cParser()

        api_call = ''
        
        sId = self.__getIdFromhtml(sHtmlContent)
        if sId == '':
            return False,False
            
        oRequest = cRequestHandler('https://thevideo.cc/vsign/player/' + sId)
        sHtmlContent2 = oRequest.request()
        sPattern = "(\s*eval\s*\(\s*function(?:.|\s)+?\)\))"
        aResult = oParser.parse(sHtmlContent2, sPattern)
        if (aResult[0] == True):
            sUnpacked = cPacker().unpack(aResult[1][0])
            sPattern = 'vt=([^"]+)";'
            aResult = oParser.parse(sUnpacked, sPattern)
            if (aResult[0] == True):
                sVt =  aResult[1][0]
        
        sPattern = '"file":"([^"]+)","label":"([^"]+)"'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            #initialisation des tableaux
            url=[]
            qua=[]
        
            #Remplissage des tableaux
            for i in aResult[1]:
                url.append(str(i[0]))
                qua.append(str(i[1]))
                
            #Si une seule url
            if len(url) == 1:
                api_call = url[0]
            #si plus de une
            elif len(url) > 1:
            #Affichage du tableau
                dialog2 = xbmcgui.Dialog()
                ret = dialog2.select('Select Quality', qua)
                if (ret > -1):
                    api_call = url[ret]
        
        if (api_call):
            return True, api_call + '?direct=false&ua=1&vt=' + sVt 
            
        return False, False
  def __getMediaLinkForGuest(self):
    log("Generate direct media link from %s" % self.__sUrl)

    # Get the video id from the link
    sPattern = '(?:http://www.putlocker.com)?/(?:file|embed)?/(.*?)$'
    oParser = cParser()
    aResult = oParser.parse(self.__sUrl, sPattern)

    if not aResult[0]:
      log("The link does not contain a media id.", LOGERROR)
      return [False, ""]

    log("Media ID: %s" % aResult[1][0])

    sMediaID = aResult[1][0]

    # First call the main page for the media.
    oRequest = cRequestHandler(self.__sUrl)
    sHtmlContent = oRequest.request()

    # We have to click on a button and create a valid cookie before we can call the settings with
    # the video link.

    # First call the main page for the media.
    oRequest = cRequestHandler(self.__sUrl)
    sHtmlContent = oRequest.request()


    #get session_hash
    hashPattern = 'value="([0-9a-f]+?)" name="hash"'
    aResult = oParser.parse(sHtmlContent, hashPattern)

    if aResult[0]:
        sPhpSessionId = aResult[1][0]
    else:
        log('putlocker: session hash not found')
        return False

    #post session_hash
    try:
        oRequest = cRequestHandler(self.__sUrl)
        oRequest.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        oRequest.addParameters('hash', sPhpSessionId)
        oRequest.addParameters('confirm', 'Continue as Free User')
        sHtmlContent = oRequest.request()
        log(sHtmlContent)
    except Exception, e:
        log('putlocker: got http error %d posting %s' % (e, self.__sUrl))
        return False
예제 #31
0
def DecryptddlProtect(url):
    #print 'entering DecryptddlProtect'
    if not (url): return ''

    #Get host
    tmp = url.split('/')
    host = tmp[0] + '//' + tmp[2] + '/'

    cookies = ''
    #try to get previous cookie
    cookies = GestionCookie().Readcookie('liens_free-telechargement_org')

    oRequestHandler = cRequestHandler(url)
    if cookies:
        oRequestHandler.addHeaderEntry('Cookie', cookies)
    sHtmlContent = oRequestHandler.request()

    #A partir de la on a les bon cookies pr la protection cloudflare

    #Si ca demande le captcha
    if 'Veuillez recopier le captcha ci-dessus' in sHtmlContent:
        if cookies:
            GestionCookie().DeleteCookie('liens_free-telechargement_org')
            oRequestHandler = cRequestHandler(url)
            sHtmlContent = oRequestHandler.request()

        s = re.findall('src=".\/([^<>"]+?)" alt="CAPTCHA Image"', sHtmlContent)
        if host in s[0]:
            image = s[0]
        else:
            image = host + s[0]

        captcha, cookies2 = get_response(image, cookies)
        cookies = cookies + '; ' + cookies2

        oRequestHandler = cRequestHandler(url)
        oRequestHandler.setRequestType(1)
        oRequestHandler.addHeaderEntry('User-Agent', UA)
        oRequestHandler.addHeaderEntry('Accept-Language',
                                       'fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4')
        oRequestHandler.addHeaderEntry(
            'Accept',
            'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
        )
        oRequestHandler.addHeaderEntry('Cookie', cookies)
        oRequestHandler.addHeaderEntry('Referer', url)

        oRequestHandler.addParameters('do', 'contact')
        oRequestHandler.addParameters('ct_captcha', captcha)

        sHtmlContent = oRequestHandler.request()

        if 'Code de securite incorrect' in sHtmlContent:
            cConfig().showInfo("Erreur", 'Mauvais Captcha', 5)
            return 'rate'

        if 'Veuillez recopier le captcha ci-dessus' in sHtmlContent:
            cConfig().showInfo("Erreur", 'Rattage', 5)
            return 'rate'

        #si captcha reussi
        #save cookies
        GestionCookie().SaveCookie('liens_free-telechargement_org', cookies)

    return sHtmlContent
예제 #32
0
def showMoviesLinks():
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sThumb = oInputParameterHandler.getValue('sThumb')
    sDesc = oInputParameterHandler.getValue('sDesc')
    sYear = oInputParameterHandler.getValue('sYear')

    oRequestHandler = cRequestHandler(sUrl.replace(' ', '%20'))
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    oRequestHandler.addHeaderEntry('Accept-Encoding', 'gzip, deflate')
    sHtmlContent = oRequestHandler.request()

    # Affichage du texte
    oGui.addText(SITE_IDENTIFIER, '[COLOR olive]Qualités disponibles pour ce film:[/COLOR]')

    # récupération du Synopsis
    sPattern = '<span style="color: #aaa;">([^<]+)</span>'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        sDesc = aResult[1][0]
        sDesc = sDesc.replace('<span>', '').replace('</span>', '')
        sDesc = sDesc.replace('<b>', '').replace('</b>', '')
        sDesc = sDesc.replace('<i>', '').replace('</i>', '')
        sDesc = sDesc.replace('<br>', '').replace('<br />', '')

    # on recherche d'abord la qualité courante
    sPattern = '<span><h2 style="font-size: 16px;font-weight: lighter;">([^"]+)</h2></span>'
    aResult = oParser.parse(sHtmlContent, sPattern)

    sTitle = sMovieTitle
    if (aResult[0]):
        sLang = aResult[1][1]
        sTitle = ('%s (%s)') % (sMovieTitle, sLang)

    # On ajoute le lien même si on n'a pas réussi à déterminer la qualité
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', sUrl)
    oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
    oOutputParameterHandler.addParameter('sThumb', sThumb)
    oOutputParameterHandler.addParameter('sDesc', sDesc)
    oOutputParameterHandler.addParameter('sYear', sYear)
    oGui.addLink(SITE_IDENTIFIER, 'showHosters', sTitle, sThumb, sDesc, oOutputParameterHandler)

    # on regarde si dispo dans d'autres qualités
    sPattern = '<a href="([^"]+)"><span class="ffas js-guest icon-left" title="([^"]+)">'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        oOutputParameterHandler = cOutputParameterHandler()
        for aEntry in aResult[1]:
            sUrl = aEntry[0]
            sTitle = aEntry[1]

            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)
            oOutputParameterHandler.addParameter('sYear', sYear)
            oGui.addLink(SITE_IDENTIFIER, 'showHosters', sTitle, sThumb, sDesc, oOutputParameterHandler)

    oGui.setEndOfDirectory()
예제 #33
0
def showEpisodes():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    # ([^<]+) .+?
    sPattern = '<a href="([^<]+)" class="col-6 col-s-4 col-m-3 col-l-1 button-block"><h3>الموسم<span>([^<]+)</span></h3></a>'

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sTitle = " الموسم" + aEntry[1]
            sTitle = '[COLOR aqua]' + sTitle + '[/COLOR]'
            siteUrl = str(aEntry[0]) + '/episodes'
            sThumbnail = str(sThumbnail)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', siteUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumbnail', sThumbnail)
            oGui.addMisc(SITE_IDENTIFIER, 'showEps', sTitle, '', sThumbnail,
                         '', oOutputParameterHandler)

        progress_.VSclose(progress_)

# ([^<]+) .+?
    sPattern = '<a href="([^<]+)" class="col-6 col-s-4 col-m-3 col-l-1 button-block"><h3>الحلقة <span>([^<]+)</span></h3></a>'

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sTitle = " الحلقة" + aEntry[1]
            sTitle = sTitle
            siteUrl = str(aEntry[0]).replace("episode", "watch")
            sThumbnail = str(sThumbnail)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', siteUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumbnail', sThumbnail)
            oGui.addMisc(SITE_IDENTIFIER, 'showServers', sTitle, '',
                         sThumbnail, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addDir(SITE_IDENTIFIER, 'showEpisodes',
                        '[COLOR teal]Next >>>[/COLOR]', 'next.png',
                        oOutputParameterHandler)

    oGui.setEndOfDirectory()
예제 #34
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    #print 'ff='+sUrl

    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.addHeaderEntry(
        'User-Agent',
        'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'
    )
    oRequestHandler.addHeaderEntry(
        'Accept',
        'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('X-Requested-With', 'XMLHttpRequest')
    oRequestHandler.addHeaderEntry('Accept-Language',
                                   'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
    sHtmlContent = oRequestHandler.request()
    # (.+?) .+?
    #print sHtmlContent

    sPattern = "([^<]+)"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            url = str(aEntry)
            sTitle = " "
            if 'thevideo.me' in url:
                sTitle = " (thevideo.me)"
            if 'flashx' in url:
                sTitle = " (flashx)"
            if 'mystream' in url:
                sTitle = " (mystream)"
            if 'streamcherry' in url:
                sTitle = " (streamcherry)"
            if 'streamango' in url:
                sTitle = " (streamango)"
            if url.startswith('//'):
                url = 'http:' + url

            sHosterUrl = url
            oHoster = cHosterGui().checkHoster(sHosterUrl)
            if (oHoster != False):
                sDisplayTitle = sTitle
                oHoster.setDisplayName(sDisplayTitle)
                oHoster.setFileName(sMovieTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumbnail)

        progress_.VSclose(progress_)

    oGui.setEndOfDirectory()
예제 #35
0
def showMovies(sSearch = ''):
    oGui = cGui()
    oParser = cParser()

    if sSearch:
        oRequest = cRequestHandler(URL_MAIN)
        sHtmlContent = oRequest.request()
        cook = oRequest.GetCookies()
        
        sCode = getcode(sHtmlContent)
  
        sText = sSearch
        oRequest = cRequestHandler(URL_SEARCH_MOVIES[0])
        oRequest.setRequestType(1)
        oRequest.addHeaderEntry('User-Agent', UA)
        oRequest.addHeaderEntry('Referer', URL_MAIN)
        oRequest.addHeaderEntry('Cookie', cook)
        oRequest.addParametersLine('search='+sText+'&csrf_test_name='+sCode)

        sHtmlContent = oRequest.request()
        sHtmlContent = re.sub('<h2></h2>','<span class="Langue..."></span><span class="qalite">Qualité...</span>',sHtmlContent) #recherche pas de qualité,langue

    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

        oRequestHandler = cRequestHandler(sUrl)
        sHtmlContent = oRequestHandler.request()
        
        #parfois pas de qualité,langue,liens >> BA 
        sHtmlContent = re.sub('<span class="bientot"></span>','<span class="nothing"></span><span class="qalite">nothing</span>',sHtmlContent)
    
    sPattern = '<div class="image">.+?<a href="([^"]+)".+?<img src="([^"]+)".+?title="(.+?)">.+?<span class="(.+?)"></span><span class="qalite">(.+?)</span>'

    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)

        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            if aEntry[3] == 'nothing' and aEntry[4] == 'nothing': #pas de qualité,langue,liens >> BA
                continue
  
            sUrl = aEntry[0]
            sThumb = aEntry[1]
            sTitle = aEntry[2]
            sLang = aEntry[3]
            sQual = aEntry[4]
            
            sDisplayTitle = ('%s [%s] (%s)') % (sTitle, sQual, sLang)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            if 'serie' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sDisplayTitle, '', sThumb, '', oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showLink', sDisplayTitle, '', sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies', '[COLOR teal]Next >>>[/COLOR]', oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
def showMovies(sSearch=''):
    oGui = cGui()
    if sSearch:
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    sPattern = '<div id="(post-[0-9]+)".+?<a class="clip-link".+?title="([^<]+)" href="([^<]+)">.+?<img src="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sTitle = unicode(aEntry[1], 'utf-8')  #converti en unicode
            sTitle = unicodedata.normalize('NFD', sTitle).encode(
                'ascii', 'ignore')  #vire accent
            #sTitle = unescape(str(sTitle))
            sTitle = sTitle.encode("utf-8")

            #mise en page
            sTitle = sTitle.replace('Permalien pour',
                                    '').replace('&prime;', '\'')
            sTitle = re.sub(
                '(?:,)* (?:Replay |Video )*du ([0-9]+ [a-zA-z]+ [0-9]+)',
                ' (\\1)', str(sTitle))
            sTitle = re.sub(', (?:Replay|Video)$', '', str(sTitle))
            sUrl = str(aEntry[2])
            sThumb = str(aEntry[3])

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)

            oGui.addMisc(SITE_IDENTIFIER, 'showHosters', sTitle, 'doc.png',
                         sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies',
                         '[COLOR teal]Next >>>[/COLOR]',
                         oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
예제 #37
0
def showSearchResult(sSearch=''):
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()

    sUrl = sSearch

    HD = 0
    SD = 0

    #uniquement si c'est la premiere page
    if sSearch:
        sType = oInputParameterHandler.getValue('type')

        loop = 1

        if sType:
            if sType == "film":
                sUrl = sUrl + '&rech_cat=video'
                loop = 2
            if sType == "serie":
                sUrl = sUrl + '&rech_cat=serie'
                loop = 2
            if sType == "anime":
                sUrl = sUrl + '&rech_cat=Animations'

    else:
        sUrl = oInputParameterHandler.getValue('siteUrl')
        loop = 1
        SD = HD = -1

    oParser = cParser()
    aResult = []
    NextPage = []

    while (loop):
        oRequestHandler = cRequestHandler(sUrl)
        sHtmlContent = oRequestHandler.request()
        sHtmlContent = sHtmlContent.replace(
            '<span style="background-color: yellow;"><font color="red">', '')
        sPattern = '<b><p style="font-size: 18px;"><A href="([^"]+)">(.+?)<\/A.+?<td align="center">\s*<img src="([^"]+)".+?<b>Description : <\/b><\/br><\/br>(.+?)<'
        aResult1 = oParser.parse(sHtmlContent, sPattern)

        if (aResult1[0] == False):
            oGui.addText(SITE_IDENTIFIER)

        if aResult1[0]:
            aResult = aResult + aResult1[1]

            sNextPage = __checkForNextPage(sHtmlContent)

            if (sNextPage != False):
                n = '[COLOR teal]Next >>>[/COLOR]'
                if sSearch:
                    n = '[COLOR teal]Next SD >>>[/COLOR]'
                if loop == 2:
                    n = '[COLOR teal]Next HD >>>[/COLOR]'
                NextPage.append((n, sNextPage))

        loop = loop - 1
        if (loop == 1):
            HD = len(aResult)
            if sUrl.endswith('video'):
                sUrl = sUrl.replace('=video', '=Films+HD')
            if sUrl.endswith('serie'):
                sUrl = sUrl.replace('=serie', '=seriehd')

    if (aResult):
        total = len(aResult)
        i = 0
        for aEntry in aResult:

            #titre ?
            if i == SD:
                oGui.addText(SITE_IDENTIFIER,
                             '[COLOR olive]Qualitee SD[/COLOR]')
            if i == HD:
                oGui.addText(SITE_IDENTIFIER,
                             '[COLOR olive]Qualitee HD[/COLOR]')
            i = i + 1

            sQual = 'SD'
            if '-hd/' in aEntry[0] or 'bluray' in aEntry[
                    0] or 'hdlight' in aEntry[0]:
                sQual = 'HD'
            if '-3d/' in aEntry[0]:
                sQual = '3D'

            sTitle = str(aEntry[1])
            sTitle = cUtil().removeHtmlTags(sTitle)
            sUrl2 = aEntry[0]

            sDesc = aEntry[3]
            sDesc = sDesc.decode("unicode_escape").encode("latin-1")
            sThumb = aEntry[2]

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', URL_MAIN + sUrl2)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)
            sDisplayTitle = cUtil().DecoTitle('(' + sQual + ') ' + sTitle)

            if 'series-' in sUrl or '-Saison' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showHosters', sDisplayTitle, '',
                           sThumb, sDesc, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sDisplayTitle,
                              '', sThumb, sDesc, oOutputParameterHandler)

        for n, u in NextPage:
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', u)
            oGui.addNext(SITE_IDENTIFIER, 'showSearchResult', n,
                         oOutputParameterHandler)
    if not sSearch:
        oGui.setEndOfDirectory()
예제 #38
0
def showHosters():

    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail  = oInputParameterHandler.getValue('sThumbnail')
   
   #modif url par Gregwar  
    if '?' in sUrl:
        sUrl += '&r=n'
    else:
        sUrl += '?r=n'
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
     
    oParser = cParser()
    sPattern = '<video><source type="video/mp4" src="([^"]+)"'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0]):
        BA = aResult[1][0]
    else:
        BA = False

    sPattern = '<script>function(.+?)</script>'
    aResult = re.search(sPattern,sHtmlContent)
    sHtmlContent = aResult.group(1).replace('return de("$")','') #serie
    #redirection sur hdstream pour les new videos
    sPattern = '"([^"]+)"'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        for aEntry in aResult[1]:
            url = Decode(str(aEntry))
            if 'manifest.mpd' in url:
                continue
                
            if '/mp4/' in url: #lien upto,1fich,direct ou inutilisable
                sId = re.search('\/mp4\/([^-]+)',url)
                if sId:
                    chaine = sId.group(1)
                    vUrl = base64.b64decode(chaine + "==")

                    if 't411.li' in vUrl:
                        continue
                    elif 'uptobox' in vUrl:
                        sHosterUrl = vUrl
                    elif '1fichier' in vUrl:
                        sHosterUrl = vUrl
                    else:
                        sHosterUrl = url

            else:
                sHosterUrl = url

            oHoster = cHosterGui().checkHoster(sHosterUrl)
            if (oHoster != False):
                oHoster.setDisplayName(xbmc.getInfoLabel('ListItem.title'))
                oHoster.setFileName(sMovieTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, '')
            
        if (BA != False):
            sHosterUrl2 = str(BA)
            oHoster2 = cHosterGui().checkHoster(sHosterUrl2)
            if (oHoster2 != False):
                oHoster2.setDisplayName(sMovieTitle + '[COLOR coral]' + (' [Bande Annonce] ') + '[/COLOR]')
                oHoster2.setFileName(sMovieTitle)
                cHosterGui().showHoster(oGui, oHoster2, sHosterUrl2, '')
                  
    oGui.setEndOfDirectory()
예제 #39
0
def showSeries(sSearch=''):
    oGui = cGui()
    if sSearch:
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    oParser = cParser()

    if 'Récemment ajoutées' in sHtmlContent:
        sStart = 'Récemment ajoutées'
        sEnd = 'Séries streaming les plus populaires'
        sHtmlContent = oParser.abParse(sHtmlContent, sStart, sEnd)

    sPattern = 'center-icons".+?src="([^"]+)" alt="([^"]+).+?href="([^"]+).+?(?:|story\'>([^<]+).+?)movie-cast'
    if sSearch:
        sPattern = 'center-icons".+?src="([^"]+)" alt="([^"]+).+?href="([^"]+)'

    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        oOutputParameterHandler = cOutputParameterHandler()
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sThumb = aEntry[0]
            sTitle = re.sub('\(\d{4}\)', '', aEntry[1])
            sUrl = aEntry[2]
            sDesc = ''  # absente pour la recherche
            if len(aEntry) > 3:
                sDesc = aEntry[3]

            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)

            oGui.addTV(SITE_IDENTIFIER, 'showEpisodes', sTitle, '', sThumb,
                       sDesc, oOutputParameterHandler)

        progress_.VSclose(progress_)

    if not sSearch:
        sNextPage, sPaging = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showSeries', 'Page ' + sPaging,
                         oOutputParameterHandler)

        oGui.setEndOfDirectory()
예제 #40
0
def showMovies():
    oGui = cGui()
    
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    
    # modif url par Gregwar  
    if '?' in sUrl:
        sUrl += '&r=n'
    else:
        sUrl += '?r=n'
        
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    
    sPattern1 = '<img src="([^"]+?)" width=".+?<h2>(.+?)</h2>.*?<h3>(.+?)</h3>.+?<p>([^<]+)</p><a class="btn.+?href="(.+?)"'

    sPattern2 = '<img src="([^"]+)" width=".+?<a href="([^"]+)">.+?title="(.+?)".+?data-tooltip="Synopsis *: *([^<]+)">.+?<h3>(.+?)</h3>'

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern2)
    if not (aResult[0] == True):
        aResult = oParser.parse(sHtmlContent, sPattern1)
    if (aResult[0] == True):
        total = len(aResult[1])
        dialog = cConfig().createDialog(SITE_NAME)
        for aEntry in aResult[1]:
            cConfig().updateDialog(dialog, total)
            if dialog.iscanceled():
                break

            if not sUrl.startswith(URL_MAIN + 'series.php') and 'serie' in sUrl or 'genre' in sUrl:
                sThumbnail = URL_MAIN + str(aEntry[0])
                siteUrl = URL_MAIN + str(aEntry[4])
                sCom = str(aEntry[3])
                sTitle = ('%s (%s)') % (str(aEntry[1]) , str(aEntry[2]).replace(' - COMP', 'COMP'))
                title = aEntry[1]
            else:
                sThumbnail = URL_MAIN + str(aEntry[0])
                siteUrl = URL_MAIN + str(aEntry[1])
                sCom = str(aEntry[3])
                sTitle = ('%s (%s)') % (str(aEntry[2]) , str(aEntry[4]))
                title = aEntry[2]
                
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', siteUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', title)
            oOutputParameterHandler.addParameter('sThumbnail', sThumbnail) 
            if 'details-serie.php' in siteUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showSeries', sTitle, 'series.png', sThumbnail, sCom, oOutputParameterHandler)
            elif '/series' in siteUrl:
                oGui.addTV(SITE_IDENTIFIER, 'seriesHosters', sTitle, 'series.png', sThumbnail, sCom, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, 'films.png', sThumbnail, sCom, oOutputParameterHandler)
           
        cConfig().finishDialog(dialog)
 
        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies', '[COLOR teal]Next >>>[/COLOR]', oOutputParameterHandler)

    oGui.setEndOfDirectory()
예제 #41
0
def showSeries(sSearch = ''):
    oGui = cGui()
    oParser = cParser()

    if sSearch:
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    sPattern = '<a class="short-poster.+?href="([^<]+)"><img src="([^"]+)".*?(?:alt|title)="(.+?)"'

    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)

        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            #Si recherche et trop de resultat, on nettoye
            if sSearch and total > 2:
                if cUtil().CheckOccurence(sUrl.replace(URL_SEARCH_SERIE[0], ''), aEntry[2]) == 0:
                    continue

            sUrl2 = str(aEntry[0])
            sThumb = str(aEntry[1]).replace('/img/french-stream.com.php?src=', '')
            sThumb = sThumb.split('&')[0]
            if sThumb.startswith ('/'):
                sThumb = URL_MAIN[:-1] + sThumb

            #filtre pour réorienter les mangas
            if '/mangas/' in sUrl:
                sType = 'mangas'
            else:
                sType = 'autre'

            sTitle = aEntry[2].replace('- Saison', ' Saison')

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl2)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sType', sType)

            oGui.addTV(SITE_IDENTIFIER, 'showEpisode', sTitle, '', sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showSeries', '[COLOR teal]Next >>>[/COLOR]', oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
예제 #42
0
def showMovies(sSearch = ''):
    oGui = cGui()
    oParser = cParser()

    if sSearch:
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    sPattern = 'film-ripz"><a href=".+?">([^<]+)</a>.+?film-verz"><a href=".+?">([^<]+)</a>.+?href="([^"]+)"><img src="([^"]+)".+?(?:alt|title)="(.+?)"'

    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)

        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            #Si recherche et trop de resultat, on nettoye
            if sSearch and total > 2:
                if cUtil().CheckOccurence(sUrl.replace(URL_SEARCH_MOVIE[0], ''), aEntry[4]) == 0:
                    continue

            sQual = str(aEntry[0])
            sLang = str(aEntry[1])
            sUrl2 = str(aEntry[2])
            sThumb = str(aEntry[3]).replace('/img/french-stream.com.php?src=', '')
            sThumb = sThumb.split('&')[0]
            if sThumb.startswith ('/'):
                sThumb = URL_MAIN[:-1] + sThumb
            sTitle = str(aEntry[4])
            sDisplayTitle = ('%s [%s] (%s)') % (sTitle, sQual, sLang)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl2)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)

            oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sDisplayTitle, '', sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies', '[COLOR teal]Next >>>[/COLOR]', oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
예제 #43
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sThumb = oInputParameterHandler.getValue('sThumb')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    oParser = cParser()

    #recuperation nom de la release
    if 'elease :' in sHtmlContent:
        sPattern = 'elease :([^<]+)<'
    else:
        sPattern = '<br /> *([^<]+)</p></center>'

    aResult1 = oParser.parse(sHtmlContent, sPattern)
    #print aResult1

    if (aResult1[0] == True):
        if 'Forced' in aResult1[1][0]:
            aResult1[1][0] = ''

    #cut de la zone des liens
    if 'Lien Premium' in sHtmlContent:
        sPattern = 'Lien Premium(.+?)</div>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if not aResult[0]:
            return
        sHtmlContent = aResult[1][0]

        if 'Interchangeables' in sHtmlContent:
            #cut de restes de liens non premiums
            sPattern = '--(.+?)Interchangeables'
            aResult = oParser.parse(sHtmlContent, sPattern)
            if not aResult[0]:
                return
            sHtmlContent = aResult[1][0]

    else:
        sPattern = '<div id="link">(.+?)</div>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if not aResult[0]:
            return
        sHtmlContent = aResult[1][0]
        sHtmlContent = sHtmlContent.replace('&nbsp;', '')

    if '-multi' in sHtmlContent:
        sPattern = '<a href="link.php\?lien\=([^"]+)"'
    else:
        sPattern = '<b>(.+?)<\/b>.+?<a href="link.php\?lien\=([^"]+)" target="_blank" *><b>Cliquer ici pour Télécharger'

    aResult = oParser.parse(sHtmlContent, sPattern)
    #print aResult

    if (aResult[0] == True):
        total = len(aResult[1])
        dialog = cConfig().createDialog(SITE_NAME)
        for aEntry in aResult[1]:
            if '-multi' in aEntry:
                sHostName = 'Liens Multi'
            else:
                sHostName = aEntry[0]
                sHostName = cUtil().removeHtmlTags(sHostName)

            cConfig().updateDialog(dialog, total)
            if dialog.iscanceled():
                break
            oOutputParameterHandler = cOutputParameterHandler()
            sTitle = '[COLOR skyblue]' + sHostName + '[/COLOR]'
            if '-multi' in aEntry:
                oOutputParameterHandler.addParameter('siteUrl', aEntry)
            else:
                oOutputParameterHandler.addParameter('siteUrl', aEntry[1])

            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oGui.addMovie(SITE_IDENTIFIER, 'Display_protected_link', sTitle,
                          '', sThumb, '', oOutputParameterHandler)

        cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()
예제 #44
0
def showMovies(sSearch=''):
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMisc = oInputParameterHandler.getValue('misc')  # Autre contenu

    if sSearch:
        sUrl = sSearch

    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    sHtmlContent = oRequestHandler.request()
    sPattern = 'th-in" href="([^"]+).+?src="([^"]+)" alt="([^"]+).+?th-tip-meta.+?(?:|<span>([^\D]+).+?)#aaa;">([^<]+)'

    aResult = oParser.parse(sHtmlContent, sPattern)

    titles = set()
    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        oOutputParameterHandler = cOutputParameterHandler()
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sUrl2 = aEntry[0]
            if not sUrl2.startswith('http'):
                sUrl2 = URL_MAIN[:-1] + sUrl2

            sThumb = aEntry[1]
            if not sThumb.startswith('http'):
                sThumb = URL_MAIN[:-1] + sThumb

            sTitle = aEntry[2]
            sYear = aEntry[3]
            sDesc = aEntry[4]

            # On enleve les résultats en doublons (même titre et même année)
            # il s'agit du même dans une autre qualité ils seront proposé à l'étape suivante de nouveau
            key = sTitle + "-" + sYear
            if key in titles:
                continue
            titles.add(key)

            sDesc = re.sub('<[^<]+?>', '', sDesc)
            sDisplayTitle = ('%s (%s)') % (sTitle, sYear)

            oOutputParameterHandler.addParameter('siteUrl', sUrl2)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)
            oOutputParameterHandler.addParameter('sYear', sYear)

            if sMisc:
                oGui.addMisc(SITE_IDENTIFIER, 'showSeriesHosters', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)
            elif 'animes' in sUrl and not 'films' in sUrl:
                oGui.addAnime(SITE_IDENTIFIER, 'showSeriesHosters', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)
            elif '/series/' in sUrl or 'emissions-tv' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showSeriesHosters', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)
            elif '-saison-' in sUrl2:
                oGui.addTV(SITE_IDENTIFIER, 'showSeriesHosters', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showMoviesLinks', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sUrl, sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oOutputParameterHandler.addParameter('misc', sMisc)
            sNumPage = re.search('/([0-9]+)', sNextPage).group(1)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies', 'Page ' + sNumPage, oOutputParameterHandler)

    if not sSearch:  # Le moteur de recherche du site est correct, laisser le nextPage même en globalSearch
        oGui.setEndOfDirectory()
예제 #45
0
def showEntries(entryUrl=False, sGui=False):
    oGui = sGui if sGui else cGui()
    params = ParameterHandler()
    if not entryUrl: entryUrl = params.getValue('sUrl')

    isTvshow = True if 'serien/' in entryUrl else False
    showEpisodes = True if params.getValue('showEpisodes') == 'True' else False

    sView = 'movies'
    sMediaType = 'movie'
    if isTvshow and showEpisodes:
        sView = 'tvshows'
        sMediaType = 'tvshow'
    elif isTvshow and not showEpisodes:
        sView = 'episodes'
        sMediaType = 'episode'

    sHtmlContent = cRequestHandler(entryUrl,
                                   ignoreErrors=(sGui is not False)).request()
    pattern = '<a[^>]*href="([^"]*)"[^>]*title="([^"]*)"[^>]*>[^<]*'  # link / title
    pattern += '<img[^>]*src=["\']([^"\']*)["\'][^>]*class="cover-opacity"[^>]*>'  # thumbnail
    parser = cParser()
    isMatch, aResult = parser.parse(sHtmlContent, pattern)

    if not isMatch:
        if not sGui:
            oGui.showInfo('streamon', 'Es wurde kein Eintrag gefunden')
        return

    for sUrl, sName, sThumbnail in aResult:
        sFunction = "showSeasons" if isTvshow and showEpisodes else "showHosters"
        sThumbnail = __checkUrl(sThumbnail)

        oGuiElement = cGuiElement(sName, SITE_IDENTIFIER, sFunction)
        oGuiElement.setMediaType(sMediaType)
        oGuiElement.setThumbnail(sThumbnail)
        if isTvshow:
            res = re.search('(.*?) S(\d+)\s?E(\d+)', sName)
            if res:
                oGuiElement.setTVShowTitle(res.group(1))
                if showEpisodes:
                    sName = res.group(1)
                    oGuiElement.setTitle(res.group(1))
                else:
                    oGuiElement.setTitle(
                        '%s - Staffel %s / Episode %s' %
                        (res.group(1), int(res.group(2)), int(res.group(3))))
                    oGuiElement.setEpisode(res.group(2))
                    oGuiElement.setSeason(res.group(3))

        oParams = ParameterHandler()
        oParams.setParam('Thumbnail', sThumbnail)
        oParams.setParam('sName', sName)
        oParams.setParam('entryUrl', __checkUrl(sUrl))
        oGui.addFolder(oGuiElement,
                       oParams,
                       bIsFolder=(isTvshow and showEpisodes))

    if not sGui:
        pattern = '<a[^>]*class="[^"]*pageing[^"]*"[^>]*href=\'([^\']*)\'[^>]*>[^\d+-]'
        isMatch, sUrl = parser.parseSingleResult(sHtmlContent, pattern)
        if isMatch:
            params.setParam('sUrl', sUrl)
            oGui.addNextPage(SITE_IDENTIFIER, 'showEntries', params)

        oGui.setView(sView)
        oGui.setEndOfDirectory()
예제 #46
0
def showSerie(sSearch=''):
    oGui = cGui()
    if sSearch:
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    sPattern = '<div class="content-box"><a href="([^<]+)" class=.+?data-src="([^<]+)" class="image"></a>.+?<h3>([^<]+)</h3></a><p>([^<]+)</p>'

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sTitle = aEntry[2].decode("utf8")
            sTitle = cUtil().unescape(sTitle).encode("utf8")
            sTitle = sTitle.replace("مشاهدة", "").replace(
                "مترجمة",
                "").replace("مترجمة", "").replace("مترجم", "").replace(
                    "فيلم",
                    "").replace("اون لاين", "").replace("WEB-DL", "").replace(
                        "BRRip",
                        "").replace("720p", "").replace("HD-TC", "").replace(
                            "HDRip", "").replace("HD-CAM", "").replace(
                                "DVDRip", "").replace("BluRay", "").replace(
                                    "1080p", "").replace("WEBRip", "").replace(
                                        "WEB-dl",
                                        "").replace("مترجم ", "").replace(
                                            "مشاهدة وتحميل",
                                            "").replace("اون لاين", "")
            siteUrl = str(aEntry[0])
            sThumbnail = str(aEntry[1])
            sInfo = ""

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', siteUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumbnail', sThumbnail)

            oGui.addMovie(SITE_IDENTIFIER, 'showEpisodes', sTitle, '',
                          sThumbnail, sInfo, oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addDir(SITE_IDENTIFIER, 'showSerie',
                        '[COLOR teal]Next >>>[/COLOR]', 'next.png',
                        oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
예제 #47
0
def showHosters():
    #VSlog('showHosters')
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sThumb=oInputParameterHandler.getValue('sThumb')

    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.addHeaderEntry('User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0')
    oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Language', 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
    sHtmlContent = oRequestHandler.request()

    #fh = open('c:\\test.txt', "w")
    #fh.write(sHtmlContent.replace('\n', ''))
    #fh.close()

    #Fonction pour recuperer uniquement les liens
    #sHtmlContent = Cutlink(sHtmlContent)

    #Si ca ressemble aux lien premiums on vire les liens non premium
    if 'Premium' in sHtmlContent or 'PREMIUM' in sHtmlContent:
        oParser = cParser()
        sPattern = '<font color=red>([^<]+?)</font>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        sHtmlContent = CutNonPremiumlinks(sHtmlContent)

        #print sHtmlContent
    oParser = cParser()

    sPattern = '<font color=red>([^<]+?)</font>|<div style="font-weight:bold.+?">([^>]+?)</div></b><b><a target="_blank" href="([^<>"]+?)">T.+?charger<\/a>|>\[(Liens Premium) \]<|<span style="color:#FF0000">(.+?)</div></b><b><a target="_blank" href=href="https://([^"]+)/([^"]+?)">'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)

        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            if aEntry[0]:
                if ('Interchangeables' not in aEntry[0]):
                    oGui.addText(SITE_IDENTIFIER, '[COLOR red]' + str(aEntry[0]) + '[/COLOR]')

            #elif aEntry[1]:
                #oOutputParameterHandler = cOutputParameterHandler()
                #oOutputParameterHandler.addParameter('siteUrl', str(sUrl))
                #oOutputParameterHandler.addParameter('sMovieTitle', str(sMovieTitle))
                #oOutputParameterHandler.addParameter('sThumb', str(sThumb))
                #if 'Télécharger' in aEntry[1]:
                    #oGui.addText(SITE_IDENTIFIER, '[COLOR olive]'+str(aEntry[1])+'[/COLOR]')
                #else:
                    #oGui.addText(SITE_IDENTIFIER, '[COLOR red]'+str(aEntry[1])+'[/COLOR]')

            else:

                sTitle = '[COLOR skyblue]' + aEntry[1] + '[/COLOR] ' + sMovieTitle
                URL_DECRYPT = aEntry[3]
                oOutputParameterHandler = cOutputParameterHandler()
                if sUrl.startswith('http'):
                    oOutputParameterHandler.addParameter('siteUrl', aEntry[2].replace('https','http'))
                else:
                    sUrl2 = 'http://' + str(aEntry[3]) + '/' + str(aEntry[4])
                    oOutputParameterHandler.addParameter('siteUrl', sUrl2)

                oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
                oOutputParameterHandler.addParameter('sThumb', sThumb)
                oGui.addMovie(SITE_IDENTIFIER, 'Display_protected_link', sTitle, '', sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

    oGui.setEndOfDirectory()
예제 #48
0
def parseUrl():
    params = ParameterHandler()

    # If no function is set, we set it to the default "load" function
    if params.exist('function'):
        sFunction = params.getValue('function')
        if sFunction == 'spacer':
            return True
        elif sFunction == 'clearCache':
            from resources.lib.handler.requestHandler import cRequestHandler
            cRequestHandler('dummy').clearCache()
            return
        elif sFunction == 'changeWatched':
            changeWatched(params)
            return
        elif sFunction == 'updateMeta':
            updateMeta(params)
            return
        elif sFunction == 'searchAlter':
            searchAlter(params)
            return
    else:
        sFunction = 'load'

    # Test if we should run a function on a special site
    if params.exist('site'):
        sSiteName = params.getValue('site')
        logger.info(params.getAllParameters())

        if params.exist('playMode'):
            from resources.lib.gui.hoster import cHosterGui
            url = False
            playMode = params.getValue('playMode')
            isHoster = params.getValue('isHoster')
            url = params.getValue('url')
            manual = params.exist('manual')

            if cConfig().getSetting(
                    'hosterSelect'
            ) == 'auto' and playMode != 'jd' and playMode != 'pyload' and not manual:
                cHosterGui().streamAuto(playMode, sSiteName, sFunction)
            else:
                cHosterGui().stream(playMode, sSiteName, sFunction, url)
            return

        else:
            logger.info("Call function '%s' from '%s'" %
                        (sFunction, sSiteName))
            # If the hoster gui is called, run the function on it and return
            if sSiteName == 'cHosterGui':
                showHosterGui(sFunction)
                return
            # If global search is called
            elif sSiteName == 'globalSearch':
                searchGlobal()
                return
            elif sSiteName == 'favGui':
                showFavGui(sFunction)
                return
            # If addon settings are called
            elif sSiteName == 'xStream':
                oGui = cGui()
                oGui.openSettings()
                oGui.updateDirectory()
                return
            # If the urlresolver settings are called
            elif sSiteName == 'urlresolver':
                import urlresolver
                urlresolver.display_settings()
                return
            # If metahandler settings are called
            elif sSiteName == 'metahandler':
                import metahandler
                metahandler.display_settings()
                return
            else:
                # Else load any other site as plugin and run the function
                plugin = __import__(sSiteName, globals(), locals())
                function = getattr(plugin, sFunction)
                function()

    else:
        xbmc.executebuiltin('XBMC.RunPlugin(%s?function=clearCache)' %
                            sys.argv[0])
        # As a default if no site was specified, we run the default starting gui with all plugins
        showMainMenu(sFunction)
예제 #49
0
def showSeries(sSearch=''):
    oGui = cGui()
    oParser = cParser()

    if sSearch:
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    sPattern = '<a class="short-poster img-box with-mask" href="([^<]+)".+?<img src="([^<]+)" alt="(.+?)"'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        dialog = cConfig().createDialog(SITE_NAME)
        for aEntry in aResult[1]:
            cConfig().updateDialog(dialog, total)
            if dialog.iscanceled():
                break

            #Si recherche et trop de resultat, on nettoye
            if sSearch and total > 2:
                if cUtil().CheckOccurence(
                        sUrl.replace(URL_SEARCH_SERIE[0], ''), aEntry[2]) == 0:
                    continue

            sUrl2 = str(aEntry[0])
            sThumb = str(aEntry[1]).replace('/img/french-stream.com.php?src=',
                                            '')
            sThumb = sThumb.split('&')[0]
            if sThumb.startswith('/'):
                sThumb = URL_MAIN[:-1] + sThumb

            sTitle = str(aEntry[2])

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl2)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)

            oGui.addTV(SITE_IDENTIFIER, 'showLinks', sTitle, '', sThumb, '',
                       oOutputParameterHandler)

        cConfig().finishDialog(dialog)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showSeries',
                         '[COLOR teal]Next >>>[/COLOR]',
                         oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
        try:
            reponse = urllib2.urlopen(request)
        except URLError, e:
            print e.read()
            print e.reason

        sHtmlContent = reponse.read()

        sPattern = '<div onmouseover=.+?<img src=([^<]+) border.+?font-size:14px>([^<]+)<.font>.+?<i>(.+?)<.i>(?:.|\n)+?<a href="([^<]+)" class='
        #sPattern = '<div onmouseover=.+?<img src=([^<]+) border.+?font-size:14px>([^<]+)<.font>.+?Synopsis : <.b> <i>(.+?)<.i>(.|\n)+?<a href="([^<]+)" class='

    else:

        sUrl = oInputParameterHandler.getValue('siteUrl')

        oRequestHandler = cRequestHandler(sUrl)
        sHtmlContent = oRequestHandler.request()

        sPattern = 'Tip\(\'<center><b>(.+?)<.b>.+?Synopsis : <.b> <i>(.+?)<.i>(?:.|\n)+?<a href="(.+?)"><img src="(.+?)" alt'

    #fh = open('c:\\serie.txt', "w")
    #fh.write(sHtmlContent)
    #fh.close()

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    print aResult

    if (aResult[0] == True):
        total = len(aResult[1])
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
 
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
   
    oParser = cParser()
   
    #Recuperation qualitee
    qualite = ''
    sPattern = '<b>Qualité :<\/b><\/span> +?<p class="text">([^<>()|]+)(?:\(.+?\))*[ |]*.+?<\/p>'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        qualite = ' [' + aResult[1][0] + ']'
        qualite = qualite.replace('VF','')
        qualite = qualite.replace('VOSTFR','')
        qualite = qualite.replace(' ]',']')
   
    #Recup langue
    langue = ''
    sPattern = '<a href="#(video[0-9]+?)" title=".+?" class="border-3"><span>.+?(\[.+?\])<\/span><\/a><\/li>'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        langue = aResult[1]
 
    sPattern = '<div class="fstory-video-block" id="(.+?)">.+?<iframe.+?src=[\'|"](.+?)[\'|"]'
    aResult = oParser.parse(sHtmlContent, sPattern)
   
    sMovieTitle = sMovieTitle + qualite
   
    if (aResult[0] == True):
        total = len(aResult[1])
        dialog = cConfig().createDialog(SITE_NAME)
        for aEntry in aResult[1]:
            cConfig().updateDialog(dialog, total)
            if dialog.iscanceled():
                break
 
            sMovieTitle2 = sMovieTitle
            #Rajout lanques
            for aEntry9 in langue:
                if aEntry9[0] == aEntry[0]:
                    #sMovieTitle2 = sMovieTitle + aEntry9[1]
                    sMovieTitle2 = '%s %s' % (sMovieTitle, aEntry9[1])
           
            sHosterUrl = str(aEntry[1])
            oHoster = cHosterGui().checkHoster(sHosterUrl)
           
            sMovieTitle2 = cUtil().DecoTitle(sMovieTitle2)
       
            if (oHoster != False):
                oHoster.setDisplayName(sMovieTitle2)
                oHoster.setFileName(sMovieTitle2)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumbnail)
 
        cConfig().finishDialog(dialog)
 
        oGui.setEndOfDirectory()
def showAlpha(sLettre=''):
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sLettre = oInputParameterHandler.getValue('sLettre')

    dialog = cConfig().createDialog(SITE_NAME)

    if not sLettre:
        for i in range(0, 27):
            cConfig().updateDialog(dialog, 27)
            if dialog.iscanceled():
                break

            sTitle = chr(64 + i)
            if sTitle == '@':
                sTitle = '[0-9]'

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sLettre', sTitle)
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oGui.addTV(
                SITE_IDENTIFIER, 'showAlpha',
                '[COLOR teal] Lettre [COLOR red]' + sTitle +
                '[/COLOR][/COLOR]', '', '', '', oOutputParameterHandler)
    else:

        oRequestHandler = cRequestHandler(sUrl)
        sHtmlContent = oRequestHandler.request()

        sPattern = 'font-size:10px;font-weight:bold;" href="([^<]+)" class="b">(' + str(
            sLettre) + '.*?)<\/a>'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0] == True):
            total = len(aResult[1])
            dialog = cConfig().createDialog(SITE_NAME)

            for aEntry in aResult[1]:
                cConfig().updateDialog(dialog, total)
                if dialog.iscanceled():
                    break

                sTitle = aEntry[1]

                #Unicode convertion
                sTitle = unicode(sTitle, 'iso-8859-1')
                sTitle = unicodedata.normalize('NFD', sTitle).encode(
                    'ascii', 'ignore')
                sTitle = unescape(sTitle)

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter(
                    'siteUrl',
                    str(URL_MAIN) + '/' + str(aEntry[0]))
                oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
                oGui.addTV(SITE_IDENTIFIER, 'showEpisode', sTitle, '', '', '',
                           oOutputParameterHandler)

    cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()
예제 #53
0
def showServers():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    #Affichage du menu
    oGui.addText(SITE_IDENTIFIER,
                 '[COLOR olive]-------سيرفرات المشاهدة--------[/COLOR]')

    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.addHeaderEntry(
        'User-Agent',
        'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'
    )
    oRequestHandler.addHeaderEntry(
        'Accept',
        'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('X-Requested-With', 'XMLHttpRequest')
    oRequestHandler.addHeaderEntry('Accept-Language',
                                   'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
    sHtmlContent = oRequestHandler.request()

    #print sHtmlContent

    oParser = cParser()

    sId = '0'
    # (.+?) ([^<]+)

    sPattern = 'url: "([^<]+)",.+?data: {serverid: id},'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

        for i in range(0, 8):

            sId = str(aEntry)

            #print sId

            sTitle = 'server ' + ': ' + str(i)
            siteUrl = sId + '&serverid=' + str(i)
            sInfo = ""

            #print siteUrl
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', siteUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumbnail', sThumbnail)

            oGui.addMisc(SITE_IDENTIFIER, 'showHosters', sTitle, '',
                         sThumbnail, sInfo, oOutputParameterHandler)

#Affichage du menu
    oGui.addText(SITE_IDENTIFIER,
                 '[COLOR olive]-------سيرفرات التحميل--------[/COLOR]')

    #Recuperation infos
    sId = ''
    sUrl2 = ''

    sPattern = '&_post_id=([^<]+)",'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0]):
        sId = aResult[1][0]
        sUrl2 = 'https://ww.shahid4u.net/ajaxCenter?_action=getdownloadlinks&postId=' + sId

    oRequestHandler = cRequestHandler(sUrl2)
    oRequestHandler.addHeaderEntry(
        'User-Agent',
        'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'
    )
    oRequestHandler.addHeaderEntry(
        'Accept',
        'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('X-Requested-With', 'XMLHttpRequest')
    oRequestHandler.addHeaderEntry('Accept-Language',
                                   'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
    sHtmlContent2 = oRequestHandler.request()

    #print sHtmlContent2
    # (.+?) .+? ([^<]+)
    sPattern = 'href="([^<]+)">'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent2, sPattern)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)
        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            url = str(aEntry)
            sTitle = sMovieTitle
            if 'thevideo.me' in url:
                sTitle = " (thevideo.me)"
            if 'flashx' in url:
                sTitle = " (flashx)"
            if 'streamcherry' in url:
                sTitle = " (streamcherry)"
            if 'cloudvideo' in url:
                sTitle = " (cloudvideo)"
            if 'streamcloud' in url:
                sTitle = " (streamcloud)"
            if 'userscloud' in url:
                sTitle = " (userscloud)"
            if 'clicknupload' in url:
                sTitle = " (clicknupload)"
            if url.startswith('//'):
                url = 'http:' + url

            sHosterUrl = url
            oHoster = cHosterGui().checkHoster(sHosterUrl)
            if (oHoster != False):
                sDisplayTitle = sTitle
                oHoster.setDisplayName(sDisplayTitle)
                oHoster.setFileName(sMovieTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumbnail)

    oGui.setEndOfDirectory()
예제 #54
0
def showMovies(sSearch=''):
    oGui = cGui()
    if sSearch:
        sUrl = sSearch.replace(' ', '+')
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    sHtmlContent = sHtmlContent.replace('en illimité', 'en illimite')

    oParser = cParser()
    sPattern = 'class="item">.+?href="([^"]+).+?src="([^"]+)" alt="([^"]+).+?ttx">([^<]+).+?(?:|class="year">([^<]+).+?)class="calidad2'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)

        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sTitle = aEntry[2].replace(' Streaming Ultra-HD', '').replace(' Streaming Full-HD', '')\
                              .replace(' en Streaming HD', '').replace(' Streaming HD', '')\
                              .replace(' streaming', '').replace('HD', '')

            sUrl2 = aEntry[0]
            sThumb = re.sub('/w\d+', '/w342', aEntry[1])
            if sThumb.startswith('//'):
                sThumb = 'http:' + sThumb
            sDesc = aEntry[3].split('en illimite')[1].replace('&#160;', '')
            sYear = aEntry[4]

            # Si recherche et trop de resultat, on filtre
            if sSearch and total > 2:
                if cUtil().CheckOccurence(sSearch.replace(URL_SEARCH[0], ''),
                                          sTitle) == 0:
                    continue

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl2)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)
            oOutputParameterHandler.addParameter('sYear', sYear)

            sPattern1 = '.+?saison [0-9]+'
            aResult1 = oParser.parse(sTitle, sPattern1)

            if aResult1[0]:
                oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sTitle, '', sThumb,
                           sDesc, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, '',
                              sThumb, sDesc, oOutputParameterHandler)

        progress_.VSclose(progress_)

    if not sSearch:
        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            number = re.search('page/([0-9]+)', sNextPage).group(1)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies',
                         '[COLOR teal]Page ' + str(number) + ' >>>[/COLOR]',
                         oOutputParameterHandler)

        oGui.setEndOfDirectory()
예제 #55
0
def play__():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    #http://hdfauthftv-a.akamaihd.net/esi/TA?url=http://live.francetv.fr/simulcast/France_3/hls_v1/index.m3u8
    #sUrl = '[REGEX]{"url": "([^"]+)"}[URL]http://hdfauthftv-a.akamaihd.net/esi/TA?format=json&url=http%3A%2F%2Flive.francetv.fr%2Fsimulcast%2FFrance_2%2Fhds%2Fmanifest.f4m&callback=_jsonp_loader_callback_request_2'

    sUrl = '[REGEX](.+$)[URL]http://hdfauthftv-a.akamaihd.net/esi/TA?url=http://live.francetv.fr/simulcast/France_3/hls_v1/index.m3u8'

    #Special url
    if '[REGEX]' in sUrl:
        sUrl = GetRealUrl(sUrl)
        xbmc.log("Url : " + sUrl)

        c = ""
        oParser = cParser()
        sPattern = '\?(.+$)'
        aResult = oParser.parse(sUrl, sPattern)
        if (aResult):
            c = aResult[1][0]

        xbmc.log('Cookie : ' + c)
        #sUrl = sUrl + '|User-Agent=Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.116 Chrome/48.0.2564.116 Safari/537.36'
        #sUrl = sUrl + '|Cookie=' + c
        #sUrl = sUrl + '|Cookie=' + urllib.quote(c)

        oRequestHandler = cRequestHandler(sUrl)
        oRequestHandler.addHeaderEntry(
            'User-Agent',
            'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'
        )
        oRequestHandler.addHeaderEntry('Cookie', c)
        sHtmlContent = oRequestHandler.request()

        oParser = cParser()
        sPattern = '(France.+?m3u8)'
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult):
            sUrl = 'http://live.francetv.fr/simulcast/France_3/hls_v1/' + aResult[
                1][0] + '|Cookie=' + urllib.quote(
                    c
                ) + '&User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'

    xbmc.log(sUrl)

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setTitle(sTitle)
    oGuiElement.setMediaUrl(sUrl)
    oGuiElement.setThumbnail(sThumbnail)

    #cConfig().log("Hoster - play " + str(sTitle))
    oPlayer = cPlayer()
    oPlayer.clearPlayList()
    oPlayer.addItemToPlaylist(oGuiElement)
    #tout repetter
    #xbmc.executebuiltin("xbmc.playercontrol(RepeatAll)")

    oPlayer.startPlayer()
    return

    oGui.setEndOfDirectory()
예제 #56
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sThumb = oInputParameterHandler.getValue('sThumb')
    sDesc = oInputParameterHandler.getValue('sDesc')
    sYear = oInputParameterHandler.getValue('sYear')

    oRequestHandler = cRequestHandler(sUrl.replace(' ', '%20'))
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    oRequestHandler.addHeaderEntry('Accept-Encoding', 'gzip, deflate')
    sHtmlContent = oRequestHandler.request()

    oParser = cParser()

    sPattern = '<i class="fas fa-cloud-download-alt".+?</i>([^<]+)</div>.+?<a href="([^"]+)"'
    aResult = oParser.parse(sHtmlContent, sPattern)

    # Le site dipose de plusieurs paterne.
    if (aResult[0] == False):
        sPattern = '<a href="([^"]+)".+?rel="noopener external noreferrer">(?!Partie)([^<]+)</a>'
        aResult = oParser.parse(sHtmlContent, sPattern)

        oOutputParameterHandler = cOutputParameterHandler()
        for aEntry in aResult[1]:
            sHoster = aEntry[1]
            sUrl2 = aEntry[0]
            sTitle = ('%s [COLOR coral]%s[/COLOR]') % (sMovieTitle, sHoster)

            oOutputParameterHandler.addParameter('siteUrl', sUrl2)
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)
            oOutputParameterHandler.addParameter('sYear', sYear)
            oGui.addLink(SITE_IDENTIFIER, 'Display_protected_link', sTitle, sThumb, sDesc, oOutputParameterHandler)

    elif (aResult[0] == True):
        oOutputParameterHandler = cOutputParameterHandler()
        for aEntry in aResult[1]:
            sHoster = aEntry[0]
            sUrl2 = aEntry[1]
            sTitle = sMovieTitle

            if "protect" not in sUrl2:
                oHoster = cHosterGui().checkHoster(sUrl2)
                if (oHoster != False):
                    oHoster.setDisplayName(sTitle)
                    oHoster.setFileName(sTitle)
                    cHosterGui().showHoster(oGui, oHoster, sUrl2, sThumb)

            else:

                sTitle = ('%s [COLOR coral]%s[/COLOR]') % (sMovieTitle, sHoster)

                oOutputParameterHandler.addParameter('siteUrl', sUrl2)
                oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
                oOutputParameterHandler.addParameter('sThumb', sThumb)
                oOutputParameterHandler.addParameter('sDesc', sDesc)
                oOutputParameterHandler.addParameter('sYear', sYear)
                oGui.addLink(SITE_IDENTIFIER, 'Display_protected_link', sTitle, sThumb, sDesc, oOutputParameterHandler)

    oGui.setEndOfDirectory()
def showMovies(sSearch=''):
    oGui = cGui()  #ouvre l'affichage
    if sSearch:  #si une url et envoyer directement grace a la fonction showSearch
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue(
            'siteUrl')  #recupere l'url sortie en parametre

    oRequestHandler = cRequestHandler(sUrl)  #envoye une requete a l'url
    sHtmlContent = oRequestHandler.request()  #requete aussi

    sHtmlContent = sHtmlContent.replace('<span class="likeThis">',
                                        '').replace('</span>', '')
    #la fonction replace est pratique pour supprimer un code du resultat

    sPattern = 'class="movie movie-block"><img src="([^<]+)" alt=".+?" title="([^<]+)"/>.+?<h2 onclick="window.location.href=\'([^<]+)\'">.+?<div style="color:#F29000">.+?<div.+?>(.+?)</div>'
    #pour faire simple recherche ce bout de code dans le code source de l'url
    #- ([^<]+) je veut cette partie de code mais y a une suite
    #- .+? je ne veut pas cette partis et peux importe ceux qu'elle contient
    #- (.+?) je veut cette partis et c'est la fin
    #
    #Pour tester vos Regex, vous pouvez utiliser le site https://regex101.com/ en mettant dans les modifiers "gmis"

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    #le plus simple et de faire un  cConfig().log(str(aResult))
    #dans le fichier log d'xbmc vous pourrez voir un array de ce que recupere le script
    #et modifier sPattern si besoin
    cConfig().log(
        str(aResult))  #Commenter ou supprimer cette ligne une fois fini

    #affiche une information si aucun resulat
    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if (aResult[0] == True):
        total = len(aResult[1])
        #dialog barre de progression
        dialog = cConfig().createDialog(SITE_NAME)

        for aEntry in aResult[1]:
            cConfig().updateDialog(dialog, total)  #dialog update
            if dialog.iscanceled():
                break

            #L'array affiche vos info dans l'orde de sPattern en commencant a 0
            sTitle = str(aEntry[1])
            sUrl2 = str(aEntry[2])
            sThumb = str(aEntry[0])
            sLang = str(aEntry[3])
            sQual = str(aEntry[4])
            sHoster = str(aEntry[5])
            sDesc = ''

            sTitle = sTitle.replace('En streaming', '')

            #Si vous avez des information dans aEntry Qualiter lang organiser un peux vos titre exemple.
            #Si vous pouvez la langue et la Qualite en MAJ ".upper()" vostfr.upper() = VOSTFR
            sTitle = ('%s [%s] (%s) [COLOR coral]%s[/COLOR]') % (
                sTitle, sQual, sLang.upper(), sHoster)
            #mettre les information de streaming entre [] et le reste entre () vstream s'occupe de la couleur automatiquement.

            sUrl2 = URL_MAIN + sUrl2

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl',
                                                 sUrl2)  #sortie de l'url
            oOutputParameterHandler.addParameter('sMovieTitle',
                                                 sTitle)  #sortie du titre
            oOutputParameterHandler.addParameter('sThumb',
                                                 sThumb)  #sortie du poster

            if '/series' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'ShowSerieSaisonEpisodes', sTitle,
                           '', sThumb, sDesc, oOutputParameterHandler)
                #addTV pour sortir les series tv (identifiant, function, titre, icon, poster, description, sortie parametre)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, '',
                              sThumb, sDesc, oOutputParameterHandler)
                #addMovies pour sortir les films (identifiant, function, titre, icon, poster, description, sortie parametre)

            #il existe aussis addMisc(identifiant, function, titre, icon, poster, description, sortie parametre)
            #la difference et pour les metadonner serie, films ou sans

        cConfig().finishDialog(dialog)  #fin du dialog

        sNextPage = __checkForNextPage(sHtmlContent)  #cherche la page suivante
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies',
                         '[COLOR teal]Next >>>[/COLOR]',
                         oOutputParameterHandler)
            #Ajoute une entree pour le lien Next | pas de addMisc pas de poster et de description inutile donc

    if not sSearch:
        oGui.setEndOfDirectory()  #ferme l'affichage
예제 #58
0
def showEpisode():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    #info anime et serie
    sThumb = ''
    sDesc = ''
    try:
        oParser = cParser()
        sPattern = '<img itemprop="image".+?src="([^<]+)">.+?<strong>(.+?)</strong>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sThumb = aResult[1][0][0]
            sDesc = aResult[1][0][1]
            sDesc = sDesc.replace('<br />', '')
    except:
        pass

    oParser = cParser()
    sPattern = 'line-height:200px;font-size:26px;text-align:center;">L.anime est licencié<.p>'

    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        oGui.addText(SITE_IDENTIFIER, '[COLOR red]Animé licencié[/COLOR]')

    else:
        sPattern = '<li class="saison">([^<>]+)</li>|<a href="(https:\/\/www\.adkami\.com[^"]+)"[^<>]+>([^<>]+)<\/a><\/li>'

        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            total = len(aResult[1])

            progress_ = progress().VScreate(SITE_NAME)
            for aEntry in aResult[1]:
                progress_.VSupdate(progress_, total)
                if progress_.iscanceled():
                    break

                if aEntry[0]:
                    oGui.addText(
                        SITE_IDENTIFIER,
                        '[COLOR red]' + aEntry[0].capitalize() + '[/COLOR]')
                else:
                    sUrl = aEntry[1]
                    sTitle = sMovieTitle + ' ' + aEntry[2]
                    sTitle = re.sub(' vf', ' (VF)', sTitle, re.IGNORECASE)
                    sDisplayTitle = re.sub(' vostfr', ' (VOSTFR)', sTitle,
                                           re.IGNORECASE)
                    sTitle = sDisplayTitle.replace(' (VF)', '').replace(
                        ' (VOSTFR)', '')

                    oOutputParameterHandler = cOutputParameterHandler()
                    oOutputParameterHandler.addParameter('siteUrl', sUrl)
                    oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
                    oGui.addTV(SITE_IDENTIFIER, 'showLinks', sDisplayTitle,
                               'series.png', sThumb, sDesc,
                               oOutputParameterHandler)

            progress_.VSclose(progress_)

    oGui.setEndOfDirectory()
예제 #59
0
def showMovies(sSearch = ''):
    oGui = cGui()
    oParser = cParser()

    if sSearch:
        sUrl = sSearch

        sTypeSearch = oParser.parseSingleResult(sUrl, '\?type=(.+?)&')
        if sTypeSearch[0]:
            sTypeSearch = sTypeSearch[1]
        else:
            sTypeSearch = False

        oRequest = cRequestHandler(sUrl)
        oRequest.addHeaderEntry('User-Agent', UA)
        oRequest.addHeaderEntry('Referer', URL_MAIN)
        oRequest.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
        oRequest.addHeaderEntry('Accept-Language', 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
        oRequest.addHeaderEntry('Content-Type', 'application/x-www-form-urlencoded')

        sHtmlContent = oRequest.request()

        sPattern = '<div class="unfilm".+?<a href="([^"]+)" title="([^"]+)".+?class="type ([^"]+)".+?<img src="([^"]+)".+?("suivre2">([^<]+)<|<span class="qualite ([^"]+)"|<div class="cdiv")'

    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')
        oRequestHandler = cRequestHandler(sUrl)
        sHtmlContent = oRequestHandler.request()
        sHtmlContent = re.sub('alt="title="', 'alt="', sHtmlContent)#anime
        sPattern = '<div class="unfilm".+?<a href="([^"]+)".+?<img src="([^"]+)" alt="([^"]+)".+?("suivre2">([^<]+)<|<span class="qualite ([^"]+)"|<div class="cdiv")'

    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)

    if not (aResult[0] == False):
        total = len(aResult[1])
        progress_ = progress().VScreate(SITE_NAME)

        for aEntry in aResult[1]:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            if sSearch:
                sTitle = aEntry[1]
                sType = aEntry[2]
                sThumb = aEntry[3]
                sYear = aEntry[5]
                sQual = aEntry[6]
                if sTypeSearch:
                    if sTypeSearch != sType:#genre recherché:  film/serie/anime
                        continue
            else:
                sThumb = aEntry[1]
                sTitle = aEntry[2]
                sYear = aEntry[4]
                sQual = aEntry[5]

            sUrl = aEntry[0]
            if not 'http' in sUrl:
                sUrl = URL_MAIN[:-1] + sUrl

            sTitle = sTitle.replace('film ', '') #genre
            sTitle = sTitle.replace(' streaming', '') #genre
            sDisplayTitle = '%s [%s] (%s)' % (sTitle, sQual, sYear)

            if not 'http' in sThumb:
                sThumb = URL_MAIN + sThumb

            #not found better way
            #sTitle = unicode(sTitle, errors='replace')
            #sTitle = sTitle.encode('ascii', 'ignore').decode('ascii')

            #Vstream don't work with unicode url for the moment
            #sThumb = unicode(sThumb, 'UTF-8')
            #sThumb = sThumb.encode('ascii', 'ignore').decode('ascii')
            #sThumb=sThumb.decode('utf8')

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)

            if '/serie' in sUrl or 'anime' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'serieHosters', sDisplayTitle, sThumb, sThumb, '', oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sDisplayTitle, sThumb, sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies', '[COLOR teal]Suivant >>>[/COLOR]', oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
예제 #60
0
def ShowSpecialHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

    data = re.sub('(.+?f=)', '', sUrl)
    data = data.replace('&c=', '')
    pdata = 'data=' + QuotePlus(data)

    if 'fr-land.me' in sUrl:
        oRequest = cRequestHandler('http://fr-land.me/Htplugins/Loader.php')
        oRequest.setRequestType(1)
        oRequest.addHeaderEntry('User-Agent', UA)
        # oRequest.addHeaderEntry('Host', 'official-film-illimite.to')
        oRequest.addHeaderEntry('Referer', sUrl)
        oRequest.addHeaderEntry(
            'Accept',
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
        oRequest.addHeaderEntry('Accept-Language',
                                'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
        oRequest.addHeaderEntry('Content-Type',
                                'application/x-www-form-urlencoded')
        oRequest.addParametersLine(pdata)

        sHtmlContent = oRequest.request()
        sHtmlContent = sHtmlContent.replace('\\', '')

        # fh = open('c:\\test.txt', "w")
        # fh.write(sHtmlContent)
        # fh.close()

        sPattern = '\[(.+?)\]'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            listurl = aResult[1][0].replace('"', '').split(',http')
            listqual = aResult[1][1].replace('"', '').split(',')

            tab = zip(listurl, listqual)

            for url, qual in tab:
                sHosterUrl = url
                if not sHosterUrl.startswith('http'):
                    sHosterUrl = 'http' + sHosterUrl

                oHoster = cHosterGui().checkHoster(sHosterUrl)
                if (oHoster != False):
                    sDisplayTitle = '[' + qual + '] ' + sMovieTitle
                    oHoster.setDisplayName(sDisplayTitle)
                    oHoster.setFileName(sMovieTitle)
                    cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)

    else:

        oHoster = cHosterGui().checkHoster(sUrl)
        if (oHoster != False):
            oHoster.setDisplayName(sMovieTitle)
            oHoster.setFileName(sMovieTitle)
            cHosterGui().showHoster(oGui, oHoster, sUrl, sThumb)

    oGui.setEndOfDirectory()