示例#1
0
def showHosters():
    # VSlog('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')

    sHtmlContent = Stormwall().GetHtml(sUrl)

    if "zt-protect" in sUrl:
        #Dl Protect present aussi a cette étape.
        oParser = cParser()
        sPattern = '<form action="(.+?)".+?type="hidden" name="_token" value="(.+?)">'
        result = oParser.parse(sHtmlContent, sPattern)

        if (result[0]):
            RestUrl = str(result[1][0][0])
            try:
                token = str(result[1][0][1], 'utf-8')
            except:
                token = result[1][0][1]

        sHtmlContent = Stormwall().GetHtml(RestUrl + "?_token" + token)

    # Si ca ressemble aux lien premiums on vire les liens non premium
    if 'Premium' in sHtmlContent or 'PREMIUM' in sHtmlContent:
        sHtmlContent = CutNonPremiumlinks(sHtmlContent)

    oParser = cParser()

    sPattern = '<font color=red>([^<]+?)</font>|<b><div style=".+?">([^<]+)</div>.+?class="btnToLink".+?href="([^"]+)">([^<]+)'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            if aEntry[0]:
                if ('Interchangeables' not in aEntry[0]):
                    oGui.addText(SITE_IDENTIFIER,
                                 '[COLOR red]' + aEntry[0] + '[/COLOR]')
            else:
                sDisplayTitle = sMovieTitle + ' [COLOR coral]' + aEntry[
                    1] + '[/COLOR] '
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', aEntry[2])
                oOutputParameterHandler.addParameter('baseUrl', sUrl)
                oOutputParameterHandler.addParameter('sMovieTitle',
                                                     sMovieTitle)
                oOutputParameterHandler.addParameter('sThumb', sThumb)
                oOutputParameterHandler.addParameter('sYear', sYear)
                oGui.addLink(SITE_IDENTIFIER, 'Display_protected_link',
                             sDisplayTitle, sThumb, sDesc,
                             oOutputParameterHandler)

    oGui.setEndOfDirectory()
示例#2
0
def DecryptDlProtecte(url):

    if not (url):
        return ''

    sHtmlContent = Stormwall().GetHtml(url)

    oParser = cParser()
    sPattern = '<form action="([^"]+)" method="get">.+?type="hidden" name="_token" value="(.+?)">'
    result = oParser.parse(sHtmlContent, sPattern)

    if (result[0]):
        RestUrl = str(result[1][0][0])
        if not RestUrl.startswith('http'):
            RestUrl = 'https://' + url.split('/')[2] + RestUrl
        try:
            token = str(result[1][0][1], 'utf-8')
        except:
            token = result[1][0][1]

        sHtmlContent = Stormwall().GetHtml(RestUrl + "?_token" + token)

    return str(sHtmlContent)
示例#3
0
def showSeriesHosters():
    # VSlog('showSeriesHosters')
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sThumb = oInputParameterHandler.getValue('sThumb')
    sDesc = oInputParameterHandler.getValue('sDesc')

    try:
        sDesc = unicodedata.normalize('NFD', sDesc).encode(
            'ascii', 'ignore').decode('unicode_escape')
        sDesc = sDesc.encode('latin-1')
    except:
        pass

    sHtmlContent = Stormwall().GetHtml(sUrl)

    if "zt-protect" in sUrl:
        #Dl Protect present aussi a cette étape.
        oParser = cParser()
        sPattern = '<form action="(.+?)".+?type="hidden" name="_token" value="(.+?)">'
        result = oParser.parse(sHtmlContent, sPattern)

        if (result[0]):
            RestUrl = str(result[1][0][0])
            try:
                token = str(result[1][0][1], 'utf-8')
            except:
                token = result[1][0][1]

        sHtmlContent = Stormwall().GetHtml(RestUrl + "?_token" + token)

    # Pour les series on fait l'inverse des films on vire les liens premiums
    if 'Premium' in sHtmlContent or 'PREMIUM' in sHtmlContent or 'premium' in sHtmlContent:
        sHtmlContent = CutPremiumlinks(sHtmlContent)

    sPattern = '<div style="font-weight:bold;color:.+?">(.+?)</div>|<a class="btnToLink".+?href="(.+?)">(.+?)</a></b>'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            if aEntry[0]:
                if 'Télécharger' in aEntry[0]:
                    oGui.addText(SITE_IDENTIFIER,
                                 '[COLOR olive]' + aEntry[0] + '[/COLOR]')
                else:
                    oGui.addText(SITE_IDENTIFIER,
                                 '[COLOR red]' + aEntry[0] + '[/COLOR]')
            else:
                sName = aEntry[2]
                sName = sName.replace('Télécharger', '')
                sName = sName.replace('pisodes', 'pisode')
                sUrl2 = aEntry[1]
                sTitle = sMovieTitle + ' ' + sName

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('baseUrl', sUrl)
                oOutputParameterHandler.addParameter('siteUrl', sUrl2)
                oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
                oOutputParameterHandler.addParameter('sThumb', sThumb)
                oGui.addEpisode(SITE_IDENTIFIER, 'Display_protected_link',
                                sTitle, '', sThumb, sDesc,
                                oOutputParameterHandler)

    oGui.setEndOfDirectory()
示例#4
0
def showSeriesLinks():
    # VSlog('mode serie')
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')
    sUrl = oInputParameterHandler.getValue('siteUrl')

    sHtmlContent = Stormwall().GetHtml(sUrl)

    if "zt-protect" in sUrl:
        #Dl Protect present aussi a cette étape.
        oParser = cParser()
        sPattern = '<form action="(.+?)".+?type="hidden" name="_token" value="(.+?)">'
        result = oParser.parse(sHtmlContent, sPattern)

        if (result[0]):
            RestUrl = str(result[1][0][0])
            try:
                token = str(result[1][0][1], 'utf-8')
            except:
                token = result[1][0][1]

        sHtmlContent = Stormwall().GetHtml(RestUrl + "?_token" + token)

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

    # récupération du Synopsis
    sDesc = sMovieTitle  # Ne pas laisser vide sinon un texte automatique faux va être calculé
    try:
        sPattern = 'synopsis.+(alt="">|<!--dle_image_end-->)(.+?)</div>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if aResult[0]:
            sDesc = cUtil().removeHtmlTags(aResult[1][0][1])
    except:
        pass

    # on recherche d'abord la qualité courante
    sPattern = '<div style="[^"]+?">.+?Qualité (.+?) [|] (.+?)<.+?img src="(([^"]+))"'
    aResult = oParser.parse(sHtmlContent, sPattern)

    sQual = ''
    sLang = ''
    if (aResult[1]):
        aEntry = aResult[1][0]
        sQual = aEntry[0]
        sLang = aEntry[1]
        sThumb = aEntry[
            2]  # change pour chaque saison, il faut la rechercher si on navigue entre saisons
    sDisplayTitle = ('%s [%s] (%s)') % (sMovieTitle, sQual, sLang)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', sUrl)
    oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
    oOutputParameterHandler.addParameter('sThumb', sThumb)
    oOutputParameterHandler.addParameter('sDesc', sDesc)
    oGui.addEpisode(SITE_IDENTIFIER, 'showSeriesHosters', sDisplayTitle, '',
                    sThumb, sDesc, oOutputParameterHandler)

    # on regarde si dispo dans d'autres qualités
    sHtmlContent1 = CutQual(sHtmlContent)
    sPattern1 = 'href="([^"]+)"><span class="otherquality"><span style="color:#.{6}"><b>([^<]+)</b></span><span style="color:#.{6}"><b>([^<]+)'
    aResult1 = oParser.parse(sHtmlContent1, sPattern1)

    if (aResult1[0] == True):
        for aEntry in aResult1[1]:
            if 'animes' in sUrl:
                sUrl = URL_MAIN + 'animes' + aEntry[0]
            else:
                sUrl = URL_MAIN + 'telecharger-serie' + aEntry[0]
            sQual = aEntry[1]
            sLang = aEntry[2]
            sDisplayTitle = ('%s [%s] %s') % (sMovieTitle, sQual, sLang)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)
            oGui.addEpisode(SITE_IDENTIFIER, 'showSeriesLinks', sDisplayTitle,
                            '', sThumb, sDesc, oOutputParameterHandler)

    # on regarde si dispo d'autres saisons
    # Une ligne par saison, pas besoin d'afficher les qualités ici
    saisons = []
    sHtmlContent2 = CutSais(sHtmlContent)
    sPattern2 = 'href="([^"]+)"><span class="otherquality">([^<]+)<b>([^<]+)<span style="color:#.{6}">([^<]+)</span><span style="color:#.{6}">([^<]+)'
    aResult2 = oParser.parse(sHtmlContent2, sPattern2)

    # Affichage du texte
    if (aResult2[0] == True):
        oGui.addText(SITE_IDENTIFIER,
                     '[COLOR olive]Autres saisons disponibles :[/COLOR]')

        for aEntry in aResult2[1]:
            sSaison = aEntry[2].strip()
            if sSaison in saisons:
                continue
            saisons.append(sSaison)

            if 'animes' in sUrl:
                sUrl = URL_MAIN + 'animes' + aEntry[0]
            else:
                sUrl = URL_MAIN + 'telecharger-serie' + aEntry[0]
            sMovieTitle = aEntry[1] + aEntry[2]
            sTitle = '[COLOR skyblue]' + sMovieTitle + '[/COLOR]'

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oGui.addEpisode(SITE_IDENTIFIER, 'showSeriesLinks', sTitle,
                            'series.png', sThumb, sMovieTitle,
                            oOutputParameterHandler)

    oGui.setEndOfDirectory()
示例#5
0
def showMoviesLinks():
    # VSlog('mode film')
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sDisplayTitle = oInputParameterHandler.getValue('sDisplayTitle')
    if not sDisplayTitle:  # Si on arrive par un marque-page
        sDisplayTitle = sMovieTitle
    sThumb = oInputParameterHandler.getValue('sThumb')
    sUrl = oInputParameterHandler.getValue('siteUrl')

    sHtmlContent = Stormwall().GetHtml(sUrl)

    if "zt-protect" in sUrl:
        #Dl Protect present aussi a cette étape.
        oParser = cParser()
        sPattern = '<form action="(.+?)".+?type="hidden" name="_token" value="(.+?)">'
        result = oParser.parse(sHtmlContent, sPattern)

        if (result[0]):
            RestUrl = str(result[1][0][0])
            try:
                token = str(result[1][0][1], 'utf-8')
            except:
                token = result[1][0][1]

        sHtmlContent = Stormwall().GetHtml(RestUrl + "?_token" + token)

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

    # récupération du Synopsis et de l'année
    sDesc = ''
    sYear = ''
    try:
        sPattern = '(<u>Date de .+</u>.+(\d{4}(-| *<))|<u>Critiques.+?</u>).+synopsis.+?>(.+?)</div>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if aResult[0]:
            aEntry = aResult[1][0]
            sYear = aEntry[1]
            sDesc = cUtil().removeHtmlTags(aEntry[3])
    except:
        pass

    # la qualité courante est le lien en cours ici-même
    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', sDisplayTitle, sThumb, sDesc,
                 oOutputParameterHandler)

    # on regarde si dispo dans d'autres qualités
    sPattern = '<a href="([^"]+)"><span class="otherquality"><span style="color:#.{6}"><b>([^<]+)</b></span><span style="color:#.{6}"><b>([^<]+)</b></span>'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            sUrl = URL_MAIN[:-1] + aEntry[0]
            sQual = aEntry[1]
            sLang = aEntry[2]
            sTitle = ('%s [%s] %s') % (sMovieTitle, sQual, sLang)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sDisplayTitle', sTitle)
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)
            oOutputParameterHandler.addParameter('sYear', sYear)
            oGui.addLink(SITE_IDENTIFIER, 'showMoviesLinks', sTitle, sThumb,
                         sDesc, oOutputParameterHandler)

    oGui.setEndOfDirectory()
示例#6
0
def showMovies(sSearch=''):
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')

    if sSearch:
        sUrl = sSearch

    sHtmlContent = Stormwall().GetHtml(sUrl)

    sPattern = '<img class="mainimg.+?src="([^"]+)"(?:.|\s)+?<a href="([^"]+)">([^"]+)</a>.+?<span class=".+?<b>([^"]+)</span>.+?">([^<]+)</span>'

    aResult = oParser.parse(sHtmlContent, sPattern)

    titles = set()

    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

            sThumb = aEntry[0]
            sUrl2 = aEntry[1]
            sTitle = aEntry[2]
            sQual = aEntry[3]
            sLang = aEntry[4]

            # on vire le tiret des series
            sTitle = sTitle.replace(' - Saison',
                                    ' Saison').replace('COMPLETE', 'Complete')
            if not '[Complete]' in sTitle:
                sTitle = sTitle.replace('COMPLETE', '[Complete]')

            # nettoyage du titre
            sTitle = sTitle.replace('Complete', 'Complète')
            sTitle = re.sub('\[\w+]', '', sTitle)

            try:
                sTitle = str(sTitle.encode('latin-1'), encoding="utf-8")
            except:
                pass

            # Enlever les films en doublons (même titre et même pochette)
            # il s'agit du même film dans une autre qualité qu'on retrouvera au moment du choix de la qualité
            key = sTitle + "-" + sThumb
            if key in titles:
                continue
            titles.add(key)

            sDisplayTitle = ('%s [%s] %s') % (sTitle, sQual, sLang)

            if not sThumb.startswith('https'):
                sThumb = URL_MAIN + sThumb

            if not sUrl2.startswith('https'):
                sUrl2 = URL_MAIN + sUrl2

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

            if 'anime' in sUrl or 'anime' in sUrl2:
                oGui.addAnime(SITE_IDENTIFIER, 'showSeriesLinks', sTitle, '',
                              sThumb, '', oOutputParameterHandler)
            elif 'serie' in sUrl or 'serie' in sUrl2:
                oGui.addTV(SITE_IDENTIFIER, 'showSeriesLinks', sTitle, '',
                           sThumb, '', oOutputParameterHandler)
            elif DOC_NEWS[0] in sUrl or TV_NEWS[0] in sUrl or SPECT_NEWS[
                    0] in sUrl or CONCERT_NEWS[0] in sUrl:
                oGui.addMisc(SITE_IDENTIFIER, 'showSeriesLinks', sTitle, '',
                             sThumb, '', oOutputParameterHandler)
            elif 'collection' in sUrl or 'integrale' in sUrl:
                oGui.addMoviePack(SITE_IDENTIFIER, 'showMoviesLinks',
                                  sDisplayTitle, '', sThumb, '',
                                  oOutputParameterHandler)
            elif ' Saison ' in sTitle:
                oGui.addTV(SITE_IDENTIFIER, 'showSeriesLinks', sTitle, '',
                           sThumb, '', oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showMoviesLinks', sTitle, '',
                              sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

        if 'controller.php' in sUrl:
            sPattern = '<a href="#" class="nav" data-cstart="([^"]+)">Suivant</a></div>'
            aResult = oParser.parse(sHtmlContent, sPattern)
            if (aResult[0] == True):
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter(
                    'siteUrl',
                    re.sub('cstart=(\d+)', 'cstart=' + str(aResult[1][0]),
                           sUrl))
                number = re.search('([0-9]+)', aResult[1][0]).group(1)
                oGui.addNext(SITE_IDENTIFIER, 'showMovies',
                             '[COLOR teal]Page ' + number + ' >>>[/COLOR]',
                             oOutputParameterHandler)

        else:
            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 ' + number + ' >>>[/COLOR]',
                             oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()