Example #1
0
 def direct_epg(self):
     oGuiElement = cGuiElement()
     oInputParameterHandler = cInputParameterHandler()
     #aParams = oInputParameterHandler.getAllParameter()
     #print aParams
     sTitle = oInputParameterHandler.getValue('sMovieTitle')
     sCom = cePg().get_epg(sTitle,'direct')
Example #2
0
 def direct_epg(self):
     oGuiElement = cGuiElement()
     oInputParameterHandler = cInputParameterHandler()
     #aParams = oInputParameterHandler.getAllParameter()
     #print aParams
     sTitle = oInputParameterHandler.getValue('sMovieTitle')
     sCom = cePg().get_epg(sTitle, 'direct')
Example #3
0
 def viewepg(self):
     oGuiElement = cGuiElement()
     oInputParameterHandler = cInputParameterHandler()
     #aParams = oInputParameterHandler.getAllParameter()
     #print aParams
     sCom = cePg().get_epg()
     sTitle = oInputParameterHandler.getValue('sMovieTitle')
     # sId = oInputParameterHandler.getValue('sId')
     cConfig().TextBoxes(sTitle,sCom)
Example #4
0
def showMovies():
    oGui = cGui()
    oParser = cParser()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sFiltre = oInputParameterHandler.getValue('sFiltre')
    bAdulte = oInputParameterHandler.getValue('bAdulte')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    if isMatrix():
        sHtmlContent = sHtmlContent.replace('î', 'î').replace('é', 'é')

    sHtmlContent = oParser.abParse(sHtmlContent, sFiltre,
                                   '<!-- Type Chaîne -->')

    sPattern = 'location.href = \'\.(.+?)\'.+?src=\'(.+?)\'.+?<div align="center">(.+?)</div>'

    aResult = oParser.parse(sHtmlContent, sPattern)

    try:
        EPG = cePg().get_epg('', 'direct')
    except:
        EPG = ""

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

            # Trie des chaines adultes
            if "+18" in str(aEntry[2]):
                if not bAdulte:
                    continue
            elif bAdulte:
                continue

            sTitle = aEntry[2]
            if "<" in sTitle:
                sTitle = sTitle.split('<')[0]

            if 'Canal + Série' in sTitle:
                sTitle = 'Canal + Séries'

            sUrl2 = URL_MAIN + aEntry[0]
            sThumb = URL_MAIN + '/' + aEntry[1]
            sDesc = getEPG(EPG, sTitle)

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

            oGui.addMisc(SITE_IDENTIFIER, 'showHoster', sTitle, sThumb, sThumb,
                         sDesc, oOutputParameterHandler)

    oGui.setEndOfDirectory()
def showMovies():
    oGui = cGui()
    oParser = cParser()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sFiltre = oInputParameterHandler.getValue('sFiltre')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    sHtmlContent = oParser.abParse(sHtmlContent, sFiltre,
                                   '<!-- Type Chaîne -->')
    sPattern = 'location.href = \'\.(.+?)\'.+?src=\'(.+?)\'.+?<div align="center">(.+?)</div>'

    aResult = oParser.parse(sHtmlContent, sPattern)

    EPG = cePg().get_epg('', 'direct')

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            if "+18" not in str(aEntry[2]):
                sTitle = aEntry[2]

                if 'Canal + Série' in sTitle:
                    sTitle = 'Canal + Séries'

                sUrl2 = URL_MAIN + aEntry[0]
                sThumb = URL_MAIN + '/' + aEntry[1]

                sDesc = getEPG(EPG, sTitle)

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

                oGui.addMisc(SITE_IDENTIFIER, 'showHoster', sTitle, sThumb,
                             sThumb, sDesc, oOutputParameterHandler)

    oGui.setEndOfDirectory()
Example #6
0
    def soir_epg(self):
        oGuiElement = cGuiElement()
        oInputParameterHandler = cInputParameterHandler()

        sTitle = oInputParameterHandler.getValue('sMovieTitle')
        sCom = cePg().get_epg(sTitle, 'soir')
Example #7
0
def soir_epg():  # Code qui gerent l'epg
    # oGuiElement = cGuiElement()
    oInputParameterHandler = cInputParameterHandler()
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    cePg().view_epg(sTitle, 'soir')
Example #8
0
def direct_epg():  # Code qui gerent l'epg
    # oGuiElement = cGuiElement()
    oInputParameterHandler = cInputParameterHandler()
    # aParams = oInputParameterHandler.getAllParameter()
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    cePg().view_epg(sTitle, 'direct')
Example #9
0
def showHoster():
    oGui = cGui()
    oParser = cParser()

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

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

    try:
        info = cePg().getChannelEpg(sTitle)
        sDesc = info['plot']

        sMovieTitle = info['title']
        if not sMovieTitle:
            sMovieTitle = sTitle

        sMeta = 0
        sCat = info['media_type']
        if sCat:
            if 'Film' in sCat:
                sMeta = 1
            if 'Série' in sCat:
                sMeta = 2
        sYear = info['year']
        coverUrl = info['cover_url']
        if coverUrl:
            sThumb = coverUrl

    except:
        sMovieTitle = sTitle
        info = ""
        sYear = ""
        coverUrl = sThumb
        sDesc = ""
        sMeta = 0

    # Double Iframe a passer.
    sPattern = '<iframe.+?src="([^"]+)"'
    iframeURL = oParser.parse(sHtmlContent, sPattern)[1][0]

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

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

    if not aResult[1]:  # Pas de flux
        oGui.setEndOfDirectory()
        return

    iframeURL1 = aResult[1][0]
    sHosterUrl = iframeURL1

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
    oOutputParameterHandler.addParameter('sThumbnail', sThumb)
    oOutputParameterHandler.addParameter('sYear', sYear)
    oOutputParameterHandler.addParameter('sDesc', sDesc)

    oGuiElement = cGuiElement()
    oGuiElement.setTitle(sMovieTitle)
    oGuiElement.setDescription(sDesc)
    oGuiElement.setFileName(sMovieTitle)
    oGuiElement.setSiteName(resources.sites.freebox.SITE_IDENTIFIER)
    oGuiElement.setFunction('play__')
    oGuiElement.setIcon('tv.png')
    oGuiElement.setMeta(sMeta)
    oGuiElement.setThumbnail(sThumb)
    oGuiElement.setDirectTvFanart()
    oGuiElement.setCat(sMeta)

    # oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, resources.sites.freebox.SITE_IDENTIFIER, SITE_IDENTIFIER, 'direct_epg', 'Guide tv Direct')
    # oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, resources.sites.freebox.SITE_IDENTIFIER, SITE_IDENTIFIER, 'soir_epg', 'Guide tv Soir')
    if addon().getSetting('enregistrement_activer') == 'true':
        oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler,
                              resources.sites.freebox.SITE_IDENTIFIER,
                              SITE_IDENTIFIER, 'enregistrement',
                              'Enregistrement')

    # Menu pour les films
    if sMeta == 1:
        oGui.createContexMenuinfo(oGuiElement, oOutputParameterHandler)
        oGui.createContexMenuba(oGuiElement, oOutputParameterHandler)
        oGui.createContexMenuSimil(oGuiElement, oOutputParameterHandler)
        oGui.createContexMenuWatch(oGuiElement, oOutputParameterHandler)

    if 'dailymotion' in sHosterUrl:
        oOutputParameterHandler.addParameter('sHosterIdentifier',
                                             'dailymotion')
        oOutputParameterHandler.addParameter('sMediaUrl', sHosterUrl)
        oOutputParameterHandler.addParameter('siteUrl', sHosterUrl)
        oOutputParameterHandler.addParameter('sFileName', sMovieTitle)
        oGuiElement.setFunction('play')
        oGuiElement.setSiteName('cHosterGui')
        oGui.addHost(oGuiElement, oOutputParameterHandler)
        cGui.CONTENT = 'movies'
        oGui.setEndOfDirectory()
        return

    oRequestHandler = cRequestHandler(iframeURL1)
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    oRequestHandler.addHeaderEntry('Referer', iframeURL)
    sHtmlContent2 = oRequestHandler.request()

    sPattern2 = 'var\s+cid[^\'"]+[\'"]{1}([0-9]+)'
    aResult = re.findall(sPattern2, sHtmlContent2)

    if aResult:
        str2 = aResult[0]
        datetoken = int(getTimer()) * 1000

        jsonUrl = 'https://telerium.digital/streams/' + str2 + '/' + str(
            datetoken) + '.json'
        tokens = getRealTokenJson(jsonUrl, iframeURL1)
        m3url = tokens['url']
        nxturl = 'https://telerium.digital' + tokens['tokenurl']

        realtoken = getRealTokenJson(nxturl, iframeURL1)[10][::-1]

        try:
            m3url = m3url.decode("utf-8")
        except:
            pass

        sHosterUrl = 'https:' + m3url + realtoken + '|User-Agent=' + UA
        sHosterUrl += '&Referer=' + Quote(
            iframeURL1) + '&Sec-Fetch-Mode=cors&Origin=https://telerium.tv'

    oOutputParameterHandler.addParameter('siteUrl', sHosterUrl)
    oGui.addFolder(oGuiElement, oOutputParameterHandler)

    cGui.CONTENT = 'movies'
    oGui.setEndOfDirectory()
Example #10
0
    def soir_epg(self):
        oGuiElement = cGuiElement()
        oInputParameterHandler = cInputParameterHandler()

        sTitle = oInputParameterHandler.getValue('sMovieTitle')
        sCom = cePg().get_epg(sTitle,'soir')
Example #11
0
def soir_epg():#Code qui gerent l'epg
    oGuiElement = cGuiElement()
    oInputParameterHandler = cInputParameterHandler()

    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sCom = cePg().get_epg(sTitle, 'soir')
Example #12
0
def direct_epg():#Code qui gerent l'epg
    oGuiElement = cGuiElement()
    oInputParameterHandler = cInputParameterHandler()
    #aParams = oInputParameterHandler.getAllParameter()
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sCom = cePg().get_epg(sTitle, 'direct')