def parseNews():
  oGui = cGui()

  oInputParameterHandler = cInputParameterHandler()
  sSecurityValue = oInputParameterHandler.getValue('securityCockie')

  oInputParameterHandler = cInputParameterHandler()
  sNewsTitle = oInputParameterHandler.getValue('sNewsTitle')

  sPattern = "<div class=\"Opt leftOpt Headlne\"><h1>%s</h1></div>(.*?)\
<div class=\"ModuleFooter\">" % sNewsTitle

  aResult = __getHtmlContentAndParse(sPattern)

  if not aResult[0]:
    log("Can't get any news", LOGDEBUG)
    oGui.setEndOfDirectory()
    return

  log("First news parsing result: %s" % aResult[1])

  sPattern = "<td class=\"Icon\"><img src=\"/gr/sys/lng/(\d+).png\" alt=\"language\" width=\"16\" \
height=\"11\".*?<td class=\"Title\">.*?href=\"([^\"]+)\".*?class=\"OverlayLabel\">(.*?)</td>"

  aResult = __parse(aResult[1][0], sPattern)

  if not aResult[0]:
    log("Can't get any news", LOGDEBUG)
    oGui.setEndOfDirectory()
    return

  # Create an entry for every news line
  for aEntry in aResult[1]:
    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setFunction('parseMovieEntrySite')
    oGuiElement.setTitle(__createTitleWithLanguage(aEntry[0], aEntry[2]))

    oOutputParameterHandler = cOutputParameterHandler()

    sUrl = aEntry[1]

    # If there are several urls, just pick the first one
    aUrl = sUrl.split(",")
    if len(aUrl) > 0:
      sUrl = aUrl[0]

    oOutputParameterHandler.addParameter("movieUrl", URL_MAIN + sUrl)
    oOutputParameterHandler.addParameter("securityCockie", sSecurityValue)
    oGui.addFolder(oGuiElement, oOutputParameterHandler)

  oGui.setEndOfDirectory()
def mangasHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    sHtmlContent = sHtmlContent.replace('http://creative.rev2pub.com','')
               
    sPattern = '<a target="vk-filmz" href="(.+?)">(.+?)</a>'

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        for aEntry in aResult[1]:
            
            sHosterUrl = str(aEntry[0])
            
            oHoster = cHosterGui().checkHoster(sHosterUrl)
            if (oHoster != False):
                sTitle = sMovieTitle+' [COLOR azure]'+aEntry[1]+'[/COLOR]'
                oHoster.setDisplayName(sTitle)
                oHoster.setFileName(sTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumbnail) 
                
    oGui.setEndOfDirectory()
    
def seriesHosters():
    i=0
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

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

    oParser = cParser()
    sPattern = '<iframe.+?src="(.+?)"'

    aResult = oParser.parse(sHtmlContent, sPattern)

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

            i= i+1
            sHosterUrl = str(aEntry)
            oHoster = cHosterGui().checkHoster(sHosterUrl)
            if (oHoster != False):
                oHoster.setDisplayName(sMovieTitle + 'Episode' + str(i))
                oHoster.setFileName(sMovieTitle + 'Episode' + str(i))
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)

    oGui.setEndOfDirectory()
def showEpisode():
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

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

    sPattern = '<div class="media-object">.+?<a href="(http:\/\/www.youtitou.com\/videos.+?)">.+?<img src="([^"]+)" alt="(.+?)"'
    aResult = oParser.parse(sHtml, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            sUrl = aEntry[0]
            if sUrl.endswith('//'):
                sUrl = sUrl[:-1]

            sTitle = aEntry[2]
            sThumb = aEntry[1]

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, 'enfants.png', sThumb, '', oOutputParameterHandler)

    oGui.setEndOfDirectory()
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    sHtmlContent = sHtmlContent.replace('http://creative.rev2pub.com','')
               
        
    sPattern = '<iframe.+?src="(.+?)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            
            sHosterUrl = str(aEntry)
            oHoster = cHosterGui().checkHoster(sHosterUrl)
            if (oHoster != False):
                oHoster.setDisplayName(sMovieTitle)
                oHoster.setFileName(sMovieTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumbnail) 
                
    oGui.setEndOfDirectory()
def serieHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    sPattern = 'href="([^<]+)" target="_blank">.+?</a>'
    oParser = cParser()
    aResult = oParser.parse(sUrl, 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

            sHosterUrl = str(aEntry)
            #oHoster = __checkHoster(sHosterUrl)
            oHoster = cHosterGui().checkHoster(sHosterUrl)

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

        cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    # sHtmlContent = sHtmlContent.replace('<iframe src="//www.facebook.com/','').replace('<iframe src=\'http://creative.rev2pub.com','')

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

    if (aResult[0] == False):
        sPattern = 'data-video_id="(.+?)"'
        aResult = oParser.parse(sHtmlContent, sPattern)

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

            sHosterUrl = str(aEntry)
            if len(sHosterUrl) == 11:
                # URL youtube + id de la vidéo
                sHosterUrl = 'https://www.youtube.com/embed/' + sHosterUrl

            oHoster = cHosterGui().checkHoster(sHosterUrl)

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

    oGui.setEndOfDirectory()
def showGenreTV():
    oGui = cGui()

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

    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.addParameters('api_key', API_KEY)
    oRequestHandler.addParameters('language', 'fr')
    
    sHtmlContent = oRequestHandler.request(); 
    result = json.loads(sHtmlContent)       

    total = len(sHtmlContent)
    if (total > 0):
        for i in result['genres']:
            sId, sTitle = i['id'], i['name']

            sTitle = sTitle.encode("utf-8")
            #sUrl = API_URL+'/genre/'+str(sId)+'/tv'
            sUrl = API_URL+'/discover/tv?with_genres=' + str(sId)
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oGui.addDir(SITE_IDENTIFIER, 'showSeries', str(sTitle), 'genres.png', oOutputParameterHandler)
           
    oGui.setEndOfDirectory()
def showSeries():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    sUrl = sUrl+'100/'
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();

    sPattern = '<a href="([^<]+)"><span>(.+?)</span></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 = sMovieTitle+' - '+aEntry[1]
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', str(aEntry[0]))
            oOutputParameterHandler.addParameter('sMovieTitle', str(sTitle))
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
            oGui.addMisc(SITE_IDENTIFIER, 'showHosters', sTitle, '', sThumbnail, '', oOutputParameterHandler)

        cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()
def showXXX():
    oInputParameterHandler = cInputParameterHandler()
    sSecurityValue = oInputParameterHandler.getValue("securityCookie")
    oGui = cGui()
    __createMainMenuEntry(oGui, "Alle Pornos", 661, sSecurityValue)
    # __createMainMenuEntry(oGui, 'Clips', 669, sSecurityValue) #im Moment können keine Clips abgespielt werden da die Cliphoster nicht aufgelöst werden können

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setFunction("displaySearch")
    oGuiElement.setTitle("Suche XXX Streams")
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter("securityCookie", sSecurityValue)
    oOutputParameterHandler.addParameter("searchType", "530")
    oGui.addFolder(oGuiElement, oOutputParameterHandler)

    __createMainMenuEntry(oGui, "Amateure", "661&prefixid=Amateure1", sSecurityValue)
    __createMainMenuEntry(oGui, "Anal", "661&prefixid=Anal", sSecurityValue)
    __createMainMenuEntry(oGui, "Asia", "661&prefixid=Asia", sSecurityValue)
    __createMainMenuEntry(oGui, "Black", "661&prefixid=Ebony", sSecurityValue)
    __createMainMenuEntry(oGui, "B*****b", "661&prefixid=B*****b", sSecurityValue)
    __createMainMenuEntry(oGui, "Deutsch", "661&prefixid=Deutsch", sSecurityValue)
    __createMainMenuEntry(oGui, "Fetish", "661&prefixid=Fetish", sSecurityValue)
    __createMainMenuEntry(oGui, "Große Brüste", "661&prefixid=GrosseBrueste", sSecurityValue)
    __createMainMenuEntry(oGui, "Gruppensex", "661&prefixid=Gruppensex", sSecurityValue)
    __createMainMenuEntry(oGui, "Gay", "661&prefixid=Gay", sSecurityValue)
    __createMainMenuEntry(oGui, "Hardcore", "661&prefixid=Hardcore", sSecurityValue)
    __createMainMenuEntry(oGui, "International", "661&prefixid=International", sSecurityValue)
    __createMainMenuEntry(oGui, "Lesben", "661&prefixid=Lesben", sSecurityValue)
    __createMainMenuEntry(oGui, "Masturbation", "661&prefixid=Masturbation", sSecurityValue)
    __createMainMenuEntry(oGui, "Teens", "661&prefixid=Teens", sSecurityValue)
    oGui.setEndOfDirectory()
def parseMovieResultSite():
    oInputParameterHandler = cInputParameterHandler()
    if oInputParameterHandler.exist("siteUrl"):
        siteUrl = oInputParameterHandler.getValue("siteUrl")
        normalySiteUrl = oInputParameterHandler.getValue("normalySiteUrl")
        iPage = oInputParameterHandler.getValue("iPage")
        __parseMovieResultSite(siteUrl, normalySiteUrl, iPage)
def parseMovieResultSite():
    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('siteUrl')):
        siteUrl = oInputParameterHandler.getValue('siteUrl')
        normalySiteUrl = oInputParameterHandler.getValue('normalySiteUrl')
        iPage = oInputParameterHandler.getValue('iPage')
        __parseMovieResultSite(siteUrl, normalySiteUrl, iPage)
def __getHtmlContent(sUrl=None, sSecurityValue=None):
    oInputParameterHandler = cInputParameterHandler()

    # Test if a url is available and set it
    if sUrl is None and not oInputParameterHandler.exist("siteUrl"):
        logger.info("There is no url we can request.")
        return False
    else:
        if sUrl is None:
            sUrl = oInputParameterHandler.getValue("siteUrl")

    # Test if a security value is available
    if sSecurityValue is None:
        if oInputParameterHandler.exist("securityCookie"):
            sSecurityValue = oInputParameterHandler.getValue("securityCookie")
        else:
            sSecurityValue = ""

    # Make the request
    oRequest = cRequestHandler(sUrl)
    oRequest.addHeaderEntry("Cookie", sSecurityValue)
    oRequest.addHeaderEntry("Accept", "*/*")
    oRequest.addHeaderEntry("Host", "g-stream.in")

    return oRequest.request()
def AlphaDisplay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    
    print sUrl
    
    #recuperation de la page
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    oParser = cParser()
    sPattern = '<a href="(.+?)" class="list-name">&raquo;(.+?)<\/a>'
    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]:
            cConfig().updateDialog(dialog, total)
            if dialog.iscanceled():
                break
                
            sTitle = aEntry[1]
            sDisplayTitle = cUtil().DecoTitle(sTitle)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', aEntry[0])
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oGui.addTV(SITE_IDENTIFIER, 'serieHosters', sDisplayTitle, '', '','', oOutputParameterHandler)
        
        cConfig().finishDialog(dialog)
        
        oGui.setEndOfDirectory()
def epHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    sHtmlContent = sHtmlContent.replace('streaming','')

    sPattern = '<a href="([^<]+)" title="([^<]+)" class="tilink sinactive"><i class="fa fa-youtube-play"></i>.+?</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

            
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', str(URL_MAIN+aEntry[0]))
            
            oOutputParameterHandler.addParameter('sMovieTitle', str(aEntry[1]))
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
            oGui.addTV(SITE_IDENTIFIER, 'showHosters', aEntry[1], '', sThumbnail, '', oOutputParameterHandler) 

        cConfig().finishDialog(dialog)    

    oGui.setEndOfDirectory()
def listVideos():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('playlistId')):
        sPlaylistId = oInputParameterHandler.getValue('playlistId')

        sUrl = URL_PLAYLIST + str(sPlaylistId)
       
        sPattern = '<li><a href="#([^"]+)".*?><img src="([^"]+)".*?></div><div>([^"]+)</div></a></li>'

        # request
        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()
        sHtmlContent = sHtmlContent.replace('\/', '/')
        sHtmlContent = sHtmlContent.replace('\\"', '"')
       
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sTitle = cUtil().removeHtmlTags(aEntry[2], ' ')
                sVideoUrl = __createVideoUrl(aEntry[1], aEntry[0])
                __showHoster(oGui, sTitle, sVideoUrl)
    
    oGui.setEndOfDirectory()
def AlphaSearch():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    
    dialog = cConfig().createDialog(SITE_NAME)
    
    for i in range(0,36) :
        cConfig().updateDialog(dialog, 36)
        if dialog.iscanceled():
            break
        
        if (i < 10):
            sTitle = chr(48+i)
        else:
            sTitle = chr(65+i-10)
            
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', sUrl + sTitle.lower() + '.html' )
        oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
        oGui.addDir(SITE_IDENTIFIER, 'AlphaDisplay', '[COLOR teal] Lettre [COLOR red]'+ sTitle +'[/COLOR][/COLOR]', 'genres.png', oOutputParameterHandler)
        
    cConfig().finishDialog(dialog)
    
    oGui.setEndOfDirectory()
Exemple #18
0
    def download(self, siteResult = False):
        #oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        sFileName = oInputParameterHandler.getValue('sMovieTitle')
        if siteResult:
            sMediaUrl = siteResult['streamUrl']
            if siteResult['resolved']:
                sLink = sMediaUrl
            else:
                sLink = urlresolver.resolve(sMediaUrl)
        else:
            sLink = urlresolver.resolve(sMediaUrl)
        logger.info('call download: ' + sMediaUrl)
        logger.info('file link: ' + str(sLink))
        if self.dialog:
            self.dialog.close()
        if (sLink != False):
            oDownload = cDownload()
            oDownload.download(sLink, 'Stream')
        else:
            cGui().showError('Download', 'File deleted or Link could not be resolved', 5);
            return False
        return True
def listHighlights():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('urlPart')):
        sUrlPart = oInputParameterHandler.getValue('urlPart')

        sUrl = URL_HIGHLIGHTS + sUrlPart
        
        sPattern = '{"mediaType":1,.*?"dataUrl":"([^"]+)".*?"duration":([^,]+),.*?"name":"([^"]+)".*?"thumbnailUrl":"([^"]+)".*?'
        
        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()
        sHtmlContent = sHtmlContent.replace('\/', '/')
        sHtmlContent = sHtmlContent.replace('\\"', '"')
        
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sDurationFormatted = cUtil().formatTime(aEntry[1])
                sTitle = aEntry[2] + ' (' + sDurationFormatted + ')'
                __showHoster(oGui, sTitle, aEntry[0])
                
    oGui.setEndOfDirectory()
    def getFav(self):
        oGui = cGui()

        oInputParameterHandler = cInputParameterHandler()

        #aParams = oInputParameterHandler.getAllParameter()

        if (oInputParameterHandler.exist('sCat')):
            sCat = oInputParameterHandler.getValue('sCat')
        else:
            sCat = '5'
        
        try:
            row = cDb().get_favorite()

            for data in row:

                title = data[1]
                siteurl = urllib.unquote_plus(data[2])
                site = data[3]
                function = data[4]
                cat = data[5]
                thumbnail = data[6]
                fanart = data[7]

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', siteurl)
                oOutputParameterHandler.addParameter('sMovieTitle', title)
                oOutputParameterHandler.addParameter('sThumbnail', 'False')
                
                if (function == 'play'):
                    oHoster = cHosterGui().checkHoster(siteurl)
                    oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier())
                    oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName())
                    oOutputParameterHandler.addParameter('sMediaUrl', siteurl)

                if (cat == sCat):
                    oGuiElement = cGuiElement()
        
                    oGuiElement.setSiteName(site)
                    oGuiElement.setFunction(function)
                    oGuiElement.setTitle(title)
                    oGuiElement.setIcon("mark.png")
                    oGuiElement.setMeta(0)
                    oGuiElement.setThumbnail(thumbnail)
                    oGuiElement.setFanart(fanart)
                    
                    oGui.createContexMenuDelFav(oGuiElement, oOutputParameterHandler)
                    
                    if (function == 'play'):
                        oGui.addFolder(oGuiElement, oOutputParameterHandler, False)
                    else:
                        oGui.addFolder(oGuiElement, oOutputParameterHandler)
                        
                    #oGui.addFav(site, function, title, "mark.png", thumbnail, fanart, oOutputParameterHandler)
               
            
            oGui.setEndOfDirectory()
        except: pass
        return
def AlphaSearch():
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')

    if 'serie' in sUrl:
        type = 'tvshows'
    else:
        type = 'movies'

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

    nonce = get_nonce()
    if not nonce == False:
       sPattern = '<a class="lglossary" data-type=".+?" data-glossary="([^"]+)">([^<]+)<\/a>'
       aResult = oParser.parse(sHtmlContent, sPattern)
       if (aResult[0] == True):
            for aEntry in aResult[1]:
                sLetter = aEntry[1]
                sUrl = URL_MAIN + 'wp-json/dooplay/glossary/?term=' + aEntry[0].replace('#', '09') + '&nonce=' + nonce + '&type=' + type

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', sUrl)
                oGui.addDir(SITE_IDENTIFIER, 'AlphaDisplay', 'Lettre [COLOR coral]' + sLetter + '[/COLOR]', 'az.png', oOutputParameterHandler)


    oGui.setEndOfDirectory()
def showLang():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sType2 = oInputParameterHandler.getValue('type2')
    sTitle = oInputParameterHandler.getValue('title')
    
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
    oOutputParameterHandler.addParameter('version', 0)
    oOutputParameterHandler.addParameter('type2', sType2)
    oGui.addDir(SITE_IDENTIFIER, 'showAZ', sTitle+' A-Z', 'lang.png', oOutputParameterHandler)
    
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
    oOutputParameterHandler.addParameter('version', 1)
    oOutputParameterHandler.addParameter('type2', sType2)
    oGui.addDir(SITE_IDENTIFIER, 'showAZ', sTitle+' A-Z VF', 'lang.png', oOutputParameterHandler)
    
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
    oOutputParameterHandler.addParameter('version', 2)
    oOutputParameterHandler.addParameter('type2', sType2)
    oGui.addDir(SITE_IDENTIFIER, 'showAZ', sTitle+' A-Z VOSTFR', 'lang.png', oOutputParameterHandler)
       
    oGui.setEndOfDirectory() 
def showQlt():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
 
    liste = []
    #liste.append( ['1080p',URL_MAIN + 'qualites/1080p/'] )   
    #liste.append( ['720p',URL_MAIN + 'qualites/720p/'] )
    liste.append( ['BDRip',URL_MAIN + 'qualites/bdrip'] )
    #liste.append( ['BRRip',URL_MAIN + 'qualites/BRRip/'] )
    liste.append( ['CAMRip',URL_MAIN + 'qualites/camrip'] )
    liste.append( ['DVDRip',URL_MAIN + 'qualites/dvdrip'] )
    liste.append( ['DVDSCR',URL_MAIN + 'qualites/dvdscr'] )
    #liste.append( ['HDRip',URL_MAIN + 'qualites/HDRip/'] )
    #liste.append( ['HDTV',URL_MAIN + 'qualites/HDTV/'] )
    #liste.append( ['PDTV',URL_MAIN + 'qualites/PDTV/'] )
    liste.append( ['R6',URL_MAIN + 'qualites/r6'] )
    #liste.append( ['TS MD',URL_MAIN + 'qualites/ts-md/'] )
    #liste.append( ['TVRip',URL_MAIN + 'qualites/TVRip/'] )
    #liste.append( ['VHSRip',URL_MAIN + 'qualites/VHSRip/'] )
    #liste.append( ['VOBRIP',URL_MAIN + 'qualites/VOBRIP/'] )
    #liste.append( ['WEB-DL',URL_MAIN + 'qualites/web-dl/'] )
    #liste.append( ['WEBRIP',URL_MAIN + 'qualites/WEBRIP/'] )

    for sTitle,sUrl in liste:
        
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', sUrl)
        oGui.addDir(SITE_IDENTIFIER, 'showMovies', sTitle, 'genres.png', oOutputParameterHandler)
        
    oGui.setEndOfDirectory()
def resultSearch(sSearch = ''):
    oGui = cGui()  
    if sSearch:
      sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')
   
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    sPattern = '<td class="wrapper_pic_td"><img src="(.+?)" border="0" alt="(.+?)\sStreaming".+?></td>.+?<span class="std">(.+?)</span>'
    
    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

            sThumbnail = URL_MAIN+str(aEntry[0])
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', str(sUrl))
            oOutputParameterHandler.addParameter('sMovieTitle', str(aEntry[1]))
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
            oGui.addMovie(SITE_IDENTIFIER, 'showHosters', aEntry[1], 'films.png', sThumbnail, aEntry[2], oOutputParameterHandler)
        
        cConfig().finishDialog(dialog)
        
    if not sSearch:       
        oGui.setEndOfDirectory() 
def showGenre():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
 
    liste = []
    liste.append( ['Animation',URL_MAIN + 'genre.php?g=Animation'] )    
    liste.append( ['Action',URL_MAIN + 'genre.php?g=Action'] )
    liste.append( ['Arts Martiaux',URL_MAIN + 'genre.php?g=Arts%20Martiaux'] )
    liste.append( ['Aventure',URL_MAIN + 'genre.php?g=Aventure'] )
    liste.append( ['Biopic',URL_MAIN + 'genre.php?g=Biopic'] )
    liste.append( ['Comedie',URL_MAIN + 'genre.php?g=Com%C3%A9die'] )
    liste.append( ['Comedie Dramatique',URL_MAIN + 'genre.php?g=Com%C3%A9die%20dramatique'] )
    liste.append( ['Documentaire',URL_MAIN + 'genre.php?g=Documentaire'] )
    liste.append( ['Drame',URL_MAIN + 'genre.php?g=Drame'] )
    liste.append( ['Epouvante Horreur',URL_MAIN + 'genre.php?g=Epouvante-horreur'] )
    liste.append( ['Espionage',URL_MAIN + 'genre.php?g=Espionnage'] )  
    liste.append( ['Fantastique',URL_MAIN + 'genre.php?g=Fantastique'] )
    liste.append( ['Famille',URL_MAIN + 'genre.php?g=Famille'] )
    liste.append( ['Guerre',URL_MAIN + 'genre.php?g=Guerre'] )
    liste.append( ['Historique',URL_MAIN + 'genre.php?g=Historique'] )
    liste.append( ['Musical',URL_MAIN + 'genre.php?g=Musical'] )
    liste.append( ['Policier',URL_MAIN + 'genre.php?g=Policier'] )
    liste.append( ['Romance',URL_MAIN + 'genre.php?g=Romance'] )
    liste.append( ['Sciense Fiction',URL_MAIN + 'genre.php?g=Science%20fiction'] )
    liste.append( ['Thriller',URL_MAIN + 'genre.php?g=Thriller'] )
    liste.append( ['Western',URL_MAIN + 'genre.php?g=Western'] )
               
    for sTitle,sUrl in liste:
       
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', sUrl)
        oGui.addDir(SITE_IDENTIFIER, 'showMovies', sTitle, 'genres.png', oOutputParameterHandler)
       
    oGui.setEndOfDirectory()
def showEdu():
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')

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

    sPattern = '<h2 class="row-title">(.+?)<\/h2>.+?<iframe.+?src="([^"]+)".+?<\/iframe>'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if not(aResult[0] == True):
        sPattern = '<iframe title="([^"]+)".+?src="([^"]+)".+?<\/iframe>' #pas de titre 6_8
        aResult = oParser.parse(sHtmlContent, sPattern)

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

            sId = sHosterUrl.rsplit('/', 1)[1]
            sTitle = aEntry[0]
            sThumb = 'https://i.ytimg.com/vi/' + sId + '/mqdefault.jpg'

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

    oGui.setEndOfDirectory()
def play__():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    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()
def showMovies(sSearch = ''):
    oGui = cGui()
    if sSearch:
      sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')
   
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    sPattern = '<li><a href="([^<]+)">.+?<span class="bold">(.+?)</span></p>'
    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

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', str(aEntry[0]))
            oOutputParameterHandler.addParameter('sMovieTitle', str(aEntry[1]))
            if 'type2=1' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showEpisode', aEntry[1], 'series.png', '', '', oOutputParameterHandler)
            else:
                oGui.addTV(SITE_IDENTIFIER, 'showEpisode', aEntry[1], 'animes.png', '', '', oOutputParameterHandler)

        cConfig().finishDialog(dialog)   

    if not sSearch:
        oGui.setEndOfDirectory()
def showHosters():
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

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

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

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            sHosterUrl = 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()
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    sHtmlContent = sHtmlContent.replace('<iframe src="//www.facebook.com/','')


    sPattern = '<iframe.+?src=[\'|"](.+?)[\'|"]'
    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)

            sHosterUrl = str(aEntry)
            #oHoster = __checkHoster(sHosterUrl)
            oHoster = cHosterGui().checkHoster(sHosterUrl)

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

        cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()
Exemple #31
0
def showGenres():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    URL_MAIN = oInputParameterHandler.getValue('sMainUrl')

    liste = []
    liste.append([
        'A l\'affiche',
        URL_MAIN + 'index.php?option=com_content&view=category&id=29'
    ])
    liste.append([
        'Action', URL_MAIN + 'index.php?option=com_content&view=category&id=1'
    ])
    liste.append([
        'Animation',
        URL_MAIN + 'index.php?option=com_content&view=category&id=2'
    ])
    liste.append([
        'Aventure',
        URL_MAIN + 'index.php?option=com_content&view=category&id=4'
    ])
    liste.append([
        'Comédie', URL_MAIN + 'index.php?option=com_content&view=category&id=6'
    ])
    liste.append([
        'Documentaires',
        URL_MAIN + 'index.php?option=com_content&view=category&id=26'
    ])
    liste.append([
        'Drame', URL_MAIN + 'index.php?option=com_content&view=category&id=7'
    ])
    liste.append([
        'Epouvante Horreur',
        URL_MAIN + 'index.php?option=com_content&view=category&id=9'
    ])
    liste.append([
        'Fantastique',
        URL_MAIN + 'index.php?option=com_content&view=category&id=8'
    ])
    liste.append([
        'Policier',
        URL_MAIN + 'index.php?option=com_content&view=category&id=10'
    ])
    liste.append([
        'Science Fiction',
        URL_MAIN + 'index.php?option=com_content&view=category&id=11'
    ])
    liste.append([
        'Spectacle',
        URL_MAIN + 'index.php?option=com_content&view=category&id=3'
    ])
    liste.append([
        'Thriller',
        URL_MAIN + 'index.php?option=com_content&view=category&id=12'
    ])

    for sTitle, sUrl in liste:
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('sMainUrl', URL_MAIN)
        oOutputParameterHandler.addParameter('siteUrl', sUrl)
        oGui.addDir(SITE_IDENTIFIER, 'showMovies', sTitle, 'genres.png',
                    oOutputParameterHandler)

    oGui.setEndOfDirectory()
Exemple #32
0
def showMovies(sSearch=''):
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')

    if sSearch:

        oRequestHandler = cRequestHandler(URL_MAIN + 'recherche/')
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        oRequestHandler.addParameters('query', sSearch)
        oRequestHandler.addParameters('submit=Valider', 'Valider')
        sHtmlContent = oRequestHandler.request()

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

    oParser = cParser()
    sPattern = '<div class="film-k.+?<a href="([^<"]+)".+?<div class="kalite">([^<"]+).+?<img src="([^<"]+).+?<div class="baslik">([^<"]+).+?<div class="aciklama">([^<"]+)'
    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

            sTitle = aEntry[3]
            if aEntry[1]:
                sTitle = sTitle + ' [' + aEntry[1] + '] '

            sCom = aEntry[4].decode("utf-8")
            sCom = cUtil().unescape(sCom).encode("utf-8")
            sCom = cUtil().removeHtmlTags(sCom)
            sUrl2 = URL_MAIN + aEntry[0]
            sThumb = URL_MAIN + aEntry[2]

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

            sDisplayTitle = cUtil().DecoTitle(sTitle)

            if '/series-tv/' in sUrl or 'saison' in sUrl2:
                oGui.addTV(SITE_IDENTIFIER, 'showSeries', sDisplayTitle,
                           'series.png', sThumb, sCom, oOutputParameterHandler)
            elif '/animes/' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showSeries', sDisplayTitle,
                           'animes.png', sThumb, sCom, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showLinks', sDisplayTitle,
                              'films.png', sThumb, sCom,
                              oOutputParameterHandler)

        cConfig().finishDialog(dialog)

        sNextPage = __checkForNextPage(sHtmlContent)
        if (sNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            sUrl = re.sub('\/page-[0-9]', '', sUrl)
            oOutputParameterHandler.addParameter('siteUrl',
                                                 sUrl + '/' + sNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies',
                         '[COLOR teal]Next >>>[/COLOR]',
                         oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
Exemple #33
0
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] == True):
        total = len(aResult[1])
        dialog = cConfig().createDialog(SITE_NAME)
        for aEntry in aResult[1]:
            cConfig().updateDialog(dialog, total)
            if dialog.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', '')
            sTitle = re.sub(
                '(?:,)* (?:Replay |Video )*du ([0-9]+ [a-zA-z]+ [0-9]+)',
                ' (\\1)', str(sTitle))
            sTitle = re.sub(', (?:Replay|Video)$', '', str(sTitle))

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', str(aEntry[2]))
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumbnail', str(aEntry[3]))

            sDisplayTitle = cUtil().DecoTitle(sTitle)
            if "/series-tv/" in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showHosters', sDisplayTitle,
                           'series.png', aEntry[3], '',
                           oOutputParameterHandler)
            else:
                oGui.addMisc(SITE_IDENTIFIER, 'showHosters', sDisplayTitle,
                             'doc.png', aEntry[3], '', 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)

    if not sSearch:
        oGui.setEndOfDirectory()
Exemple #34
0
def showMovies(sSearch=''):
    oGui = cGui()
    if sSearch:
        sUrl = sSearch

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

    #print sUrl

    sHtmlContent = ''

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

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

    sPattern = '<div.*?class="moviefilm"> *<a.*?href="([^<]+)">.*?<img.*?src="([^<]+)" alt="(.+?)".+?>'

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

    if (aResult[0] == False):
        oGui.addNone(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[0], ''),
                                          aEntry[2]) == 0:
                    continue

            #sTitle = aEntry[2]+' - [COLOR azure]'+aEntry[3]+'[/COLOR]'
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', str(aEntry[0]))
            oOutputParameterHandler.addParameter('sMovieTitle', str(aEntry[2]))
            oOutputParameterHandler.addParameter('sThumbnail', str(aEntry[1]))
            if '/films/' in aEntry[0]:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', aEntry[2], '',
                              aEntry[1], '', oOutputParameterHandler)
            else:
                oGui.addTV(SITE_IDENTIFIER, 'showSeries',
                           cUtil().DecoTitle(aEntry[2]), '', aEntry[1], '',
                           oOutputParameterHandler)

        cConfig().finishDialog(dialog)

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

    if not sSearch:
        oGui.setEndOfDirectory()
Exemple #35
0
def showHostersLink3():
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sLink = oInputParameterHandler.getValue('sLink')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')

    UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'
    headers = {
        'User-Agent': UA,
        #'Host': 'grudal.com',
        'Referer': sLink,
        'Accept':
        'video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5',
        'Accept-Language': 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3',
        'Range': 'bytes=0-'
        #'Accept-Encoding': 'gzip, deflate',
        #'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
    }

    #VSlog(sLink)

    req = urllib2.Request(sLink)
    response = urllib2.urlopen(req)
    data = response.read()
    response.close()

    # Recherche du premier lien
    sPattern = 'href=["\'](http[^"\']+)["\']'
    aResult = oParser.parse(data, sPattern)

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

    # Si il existe, suivi du lien
    if (aResult[0] == True):
        # VSlog(aResult[1][0])
        # sLink = sLink.rsplit('/', 1)[0] # supprime la dernière partie de l'url de l'iframe
        # VSlog(sLink)
        # href = sLink + '/' + aResult[1][0] # concaténation du résultat avec le href trouvé via regex
        # VSlog(href)

        #VSlog(aResult[1][0])
        req = urllib2.Request(aResult[1][0], None, headers)
        response = urllib2.urlopen(req)
        data = response.read()
        response.close()

    #VSlog(data)

    sPattern = 'file:"(.+?)".+?label:"(.+?)"'
    aResult = oParser.parse(data, sPattern)

    if (aResult[0] == True):

        for aEntry in aResult[1]:

            sLink2 = aEntry[0].replace('\/', '/')
            sQual = aEntry[1]
            sTitle = sMovieTitle.replace(' [HD]', '')
            sTitle = sTitle + '[' + sQual + '] '

            if (False):
                #decodage des liens
                req = urllib2.Request(sLink2, None, headers)

                try:
                    response = urllib2.urlopen(req)
                    sLink2 = response.geturl()
                    response.close()

                    sHosterUrl = str(sLink2)
                    oHoster = cHosterGui().getHoster('lien_direct')
                    #data = response.read()

                except urllib2.URLError, e:
                    sLink2 = e.geturl()
                    sHosterUrl = str(sLink2)
                    oHoster = cHosterGui().checkHoster(sHosterUrl)
            elif "amazonaws.com" in sLink2:
                sHosterUrl = str(sLink2)
                oHoster = cHosterGui().getHoster('lien_direct')
            else:
                sHosterUrl = str(sLink2)
                oHoster = cHosterGui().checkHoster(sHosterUrl)

            #VSlog(sHosterUrl)

            if (oHoster != False):
                oHoster.setDisplayName(sTitle)
                oHoster.setFileName(sTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, '')
Exemple #36
0
def showHosters():
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMainUrl = oInputParameterHandler.getValue('sMainUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')

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

    #Recuperation info film, com et image
    sThumb = ''
    sDesc = ''
    sPattern = '<div class="article-content"><p style="text-align: center;"><img src="([^"]+)" border.+?<p style="text-align: left;">([^<>]+?)<\/p>'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        sThumb = aResult[1][0][0]
        sDesc = cUtil().unescape(aResult[1][0][1])

    #Recuperation info lien du stream.
    sLink = None
    sPostUrl = None
    sHtmlContent = sHtmlContent.replace('\r', '')

    #Format classique
    sPattern = 'GRUDALpluginsphp\("player1",{link:"([^"]+)"}\);'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0]):
        sLink = aResult[1][0]
        sPattern = '\/plugins\/([0-9a-zA-Z]+)\/plugins\/GRUDALpluginsphp.js"><\/script>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0]):
            sPostUrl = sMainUrl + 'plugins/' + aResult[1][
                0] + '/plugins/GRUDALpluginsphp.php'

        if ((sLink) and (sPostUrl)):

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sLink', sLink)
            oOutputParameterHandler.addParameter('sPostUrl', sPostUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)

            oGui.addMovie(SITE_IDENTIFIER, 'showHostersLink', sMovieTitle, '',
                          sThumb, sDesc, oOutputParameterHandler)

    #Format rare
    if not sLink:

        sPattern = '<iframe src= *(?:"|)([^<>"]+\/player\.php\?id=.+?)"'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0]):

            sMovieTitle = sMovieTitle.replace(' [HD]', '')
            sLink = aResult[1][0]
            if sLink.startswith('/'):
                sLink = URL_HOST[:-1] + sLink

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

            oGui.addMovie(SITE_IDENTIFIER, 'showHostersLink2', sMovieTitle, '',
                          sThumb, sDesc, oOutputParameterHandler)

    #news Format
    if not sLink:

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

            sMovieTitle = sMovieTitle.replace(' [HD]', '')
            sLink = aResult[1][0]
            if sLink.startswith('/'):
                sLink = URL_HOST[:-1] + sLink

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

            oGui.addMovie(SITE_IDENTIFIER, 'showHostersLink3', sMovieTitle, '',
                          sThumb, sDesc, oOutputParameterHandler)

    oGui.setEndOfDirectory()
Exemple #37
0
def showMovies(sSearch=''):
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sMainUrl = oInputParameterHandler.getValue('sMainUrl')

    # L'URL_MAIN est passé en paramètre, sinon il faut la retrouver
    if not sMainUrl:
        sMainUrl = sLinkdyn()

    if sSearch:
        #limite de caractere sinon bug de la recherche
        sSearch = sSearch[:20]
        sUrl = sMainUrl + 'index.php?ordering=&searchphrase=all&option=com_search&searchword=' + sSearch.replace(
            ' ', '+')
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    # En cas de recherche direct OU lors de la navigation dans les differentes pages de résultats d'une recherche
    if ('searchword=' in sUrl):
        sPattern = '<h4><a href="\/[0-9a-zA-Z]+\/(.+?)"  >(.+?)<'
    else:
        sPattern = '<span style="list-style-type:none;" >.+? href="\/[0-9a-zA-Z]+\/(.+?)">(.+?)<\/a>'

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

    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

            sUrl2 = aEntry[0]
            sTitle = aEntry[1]
            sTitle = re.sub('<font color="#[0-9a-f]{6}" *><i>HD<\/i><\/font>',
                            '[HD]', sTitle)

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

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

            oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, 'films.png',
                          '', '', oOutputParameterHandler)

        progress_.VSclose(progress_)

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

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

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    #Vslog(sHtmlContent)
    #supprime la pub dans les émissions tv
    sHtmlContent = sHtmlContent.replace(' alt="ABONNEMENT IPTV"', '')
    #la fonction replace est pratique pour supprimer un code du resultat

    sPattern = '<a class="short-poster.+?" href="([^"]+)"><img itemprop="image" src="([^"]+)" alt="([^"]+)"\/>'

    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 = aEntry[2]
            sUrl2 = aEntry[0]
            sThumb = aEntry[1]
            sDesc = ''

            sTitle = sTitle.replace('FRENCH', '')
            sTitle = sTitle.replace('BDRIP', '')
            sTitle = sTitle.replace('WEBRIP', '')
            sTitle = sTitle.replace('HDRIP', '')
            sTitle = sTitle.replace('DVDRIP', '')
            sTitle = sTitle.replace('HDTV', '')
            sTitle = sTitle.replace('720p', '')
            sTitle = sTitle.replace('1080p', '')

            #tris search
            if sSearch and total > 3:
                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)

            if '/series' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showLinks', sTitle, '', sThumb,
                           sDesc, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showLinks', sTitle, '', 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()
def showMovies(sSearch=''):
    oGui = cGui()
    if sSearch:
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

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

    sPattern = 'ml-item">.+?href="([^"]+).+?(?:|quality">([^<]*).+?)-src="([^"]+).+?alt="([^"]+).+?(?:|tag">([^<]*).+?)desc">(.*?)</'
    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)

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

            sUrl2 = aEntry[0]
            sQual = aEntry[1]
            sThumb = re.sub('/w\d+/', '/w342/', aEntry[2])
            sTitle = aEntry[3].replace(' en streaming', '').replace(' en Streaming', '').replace(' Streaming', '')\
                              .replace(' streaming', '').replace(' Straming', '').replace('Version Francais', 'VF')
            if '/series' in sUrl2:
                sTitle = re.sub('Episode \d+', '', sTitle)
            sYear = aEntry[4]
            sDesc = aEntry[5].replace('<p>',
                                      '').replace('&#8220;',
                                                  '"').replace('&#8221;', '"')

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

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

            if '/series' in sUrl2:
                oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sTitle, '', sThumb,
                           sDesc, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sDisplayTitle,
                              '', 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, 'showMovies', 'Page ' + sPaging,
                         oOutputParameterHandler)

        oGui.setEndOfDirectory()
Exemple #40
0
    def showHoster(self,
                   oGui,
                   oHoster,
                   sMediaUrl,
                   sThumbnail,
                   bGetRedirectUrl=False):

        oInputParameterHandler = cInputParameterHandler()
        sMovieTitle = oInputParameterHandler.getValue('title')

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(self.SITE_NAME)
        #oGuiElement.setFunction('showHosterMenu')
        oGuiElement.setFunction('play')
        oGuiElement.setTitle(oHoster.getDisplayName())
        #oGuiElement.setThumbnail(sThumbnail)
        # if (oInputParameterHandler.exist('sMeta')):
        # sMeta = oInputParameterHandler.getValue('sMeta')
        # oGuiElement.setMeta(int(sMeta))

        oGuiElement.setFileName(oHoster.getFileName())
        oGuiElement.getInfoLabel()
        if sThumbnail:
            oGuiElement.setThumbnail(sThumbnail)

        #oGuiElement.setMeta(1)
        oGuiElement.setIcon('host.png')

        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl)
        #oOutputParameterHandler.addParameter('sThumbnail', oGuiElement.getThumbnail())

        oOutputParameterHandler.addParameter('sHosterIdentifier',
                                             oHoster.getPluginIdentifier())
        oOutputParameterHandler.addParameter('bGetRedirectUrl',
                                             bGetRedirectUrl)
        oOutputParameterHandler.addParameter('sFileName',
                                             oHoster.getFileName())

        oOutputParameterHandler.addParameter('sTitle',
                                             oHoster.getDisplayName())
        oOutputParameterHandler.addParameter('sId', 'cHosterGui')
        oOutputParameterHandler.addParameter('siteUrl', sMediaUrl)
        #oOutputParameterHandler.addParameter('sFav', 'play')
        #oOutputParameterHandler.addParameter('sCat', '4')

        #nouveaux pour la lecture.
        if (oInputParameterHandler.exist('sCat')):
            sCat = oInputParameterHandler.getValue('sCat')
            oGuiElement.setCat(sCat)
            oOutputParameterHandler.addParameter('sCat', sCat)
        else:
            oGuiElement.setCat('4')

        #existe dans le menu krypton 17
        if not isKrypton():
            oGui.createContexMenuWatch(oGuiElement, oOutputParameterHandler)

        #context playlit menu
        oContext = cContextElement()
        oContext.setFile('cHosterGui')
        oContext.setSiteName(self.SITE_NAME)
        oContext.setFunction('addToPlaylist')
        oContext.setTitle(self.ADDON.VSlang(30201))
        oContext.setOutputParameterHandler(oOutputParameterHandler)
        oGuiElement.addContextItem(oContext)

        #Download menu
        if (oHoster.isDownloadable() == True):
            oContext = cContextElement()
            oContext.setFile('cDownload')
            oContext.setSiteName('cDownload')
            oContext.setFunction('AddtoDownloadList')
            oContext.setTitle(self.ADDON.VSlang(30202))
            oContext.setOutputParameterHandler(oOutputParameterHandler)
            oGuiElement.addContextItem(oContext)

        if (oHoster.isDownloadable() == True):
            #Beta context download and view menu
            oContext = cContextElement()
            oContext.setFile('cDownload')
            oContext.setSiteName('cDownload')
            oContext.setFunction('AddtoDownloadListandview')
            oContext.setTitle(self.ADDON.VSlang(30326))
            oContext.setOutputParameterHandler(oOutputParameterHandler)
            oGuiElement.addContextItem(oContext)

        #Upload menu uptobox
        if cInputParameterHandler().getValue(
                'site') != 'siteuptobox' and self.ADDON.getSetting(
                    'hoster_uptobox_premium') == 'true':
            host = oHoster.getPluginIdentifier()
            accept = [
                'uptobox', 'uptostream', 'onefichier', 'uploaded', 'uplea'
            ]
            for i in accept:
                if host == i:
                    oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler,
                                          'siteuptobox', 'siteuptobox',
                                          'UptomyAccount',
                                          self.ADDON.VSlang(30325))

        #onefichier
        if cInputParameterHandler().getValue(
                'site') != 'siteonefichier' and self.ADDON.getSetting(
                    'hoster_onefichier_premium') == 'true':
            host = oHoster.getPluginIdentifier()
            accept = 'onefichier'  #les autres ne fonctionnent pas
            if host == accept:
                oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler,
                                      'siteonefichier', 'siteonefichier',
                                      'UptomyAccount', '1fichier')

        #context FAV menu
        oGui.createContexMenuFav(oGuiElement, oOutputParameterHandler)

        #context Library menu
        oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler,
                              'cLibrary', 'cLibrary', 'setLibrary',
                              self.ADDON.VSlang(30324))

        #bug
        oGui.addHost(oGuiElement, oOutputParameterHandler)
def showEpisodes():
    oGui = cGui()
    oParser = cParser()

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

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

    #recuperation du synopsis
    sDesc = ''
    try:
        sPattern = 'Synopsis</span>:([^<]+)<'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if aResult[0]:
            sDesc = aResult[1][0]
            #sDesc = sDesc.replace('<br />', '').replace('&#8230;', '...').replace('&#8217;', '\'')
    except:
        pass

    #recuperation du hoster de base
    ListeUrl = []
    sPattern = '<div class="keremiya_part">.+?<span>([^<]+)<\/span>'
    aResult = oParser.parse(sHtmlContent, sPattern)

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

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

    #recuperation des suivants
    sPattern = '<a href="([^"]+)" class=.+?<span>(.+?)<\/span>'
    aResult = oParser.parse(sHtmlContent, sPattern)
    ListeUrl = ListeUrl + aResult[1]

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

        for aEntry in ListeUrl:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sTitle = sMovieTitle + aEntry[1]
            sUrl2 = aEntry[0]
            if sUrl2.startswith('/'):
                sUrl2 = 'https:' + sUrl2

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

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

        progress_.VSclose(progress_)

    #si un seul episode
    else:
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', sUrl)
        oOutputParameterHandler.addParameter('sMovieTitle',
                                             sMovieTitle + 'episode 1')
        oOutputParameterHandler.addParameter('sThumb', sThumb)
        oGui.addTV(SITE_IDENTIFIER, 'showHosters', sMovieTitle + 'episode 1',
                   '', sThumb, sDesc, oOutputParameterHandler)

    oGui.setEndOfDirectory()
def showMovies(sSearch=''):
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')

    if sSearch:
        sUrl = sSearch
        sPattern = 'class="image">.*?<a href="([^"]+)">\s*<img src="([^"]+)" alt="([^"]+)".+?<p>([^<]*)'
    elif 'episodes' in sUrl:
        sPattern = 'class="poster">.*?<img src="([^"]+)" alt="([^"]+)".+?<a href="([^"]+)'
    else:
        sPattern = 'class="poster"> *<img src="([^"]+)".+?<a href="([^"]+)" *title="([^"]+)".+?class="texto">([^<]*)'

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    
    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 filtre
            if sSearch and total > 5:
                if cUtil().CheckOccurence(sSearch.replace(URL_SEARCH[0], ''), aEntry[2]) == 0:
                    continue

            if sSearch:
                sUrl = aEntry[0]
                sThumb = aEntry[1]
                sTitle = aEntry[2]
                sDesc = aEntry[3]
            elif 'episodes' in sUrl:
                sThumb = aEntry[0]
                sTitle = aEntry[1]
                sUrl = aEntry[2]
                sDesc = ''
            else:
                sThumb = aEntry[0]
                sUrl = aEntry[1]
                sTitle = aEntry[2].replace('streaming', ' ')
                sDesc = aEntry[3]

            # si utile il faut retirer oOutputParameterHandler.addParameter(sDesc)
            # if sDesc:  # désactivé le 17/06/2020, 
                # try:
                    # sDesc = cUtil().unescape(sDesc.decode('utf8'))
                # except AttributeError:
                    # sDesc = cUtil().unescape(sDesc)

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

            if 'series' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showSxE', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
            elif 'episodes' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showLinks', sTitle, '', sThumb, sDesc, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showLinks', 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 ' + number + ' >>>[/COLOR]', oOutputParameterHandler)

    if not sSearch:
        oGui.setEndOfDirectory()
Exemple #43
0
def showEpisodes():
    oGui = cGui()

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

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

    oParser = cParser()

    #Recuperation infos
    sNote = ''

    sPattern = '<b>قصة الأنيمي : </b>.+?<p>([^<]+)</p>'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0]):
        sNote = aResult[1][0]
    # (.+?) ([^<]+) .+?
    sPattern = '<div class="one-poster seasonsEx col-sm-2">.+?<div class="wrap-poster clearfix">.+?<a href="([^<]+)"><img width=".+?" height=".+?" src="([^<]+)" class.+?<h2>([^<]+)</h2>'

    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]
            siteUrl = str(aEntry[0])
            sThumb = aEntry[1]
            sDesc = sNote

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', siteUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oGui.addTV(SITE_IDENTIFIER, 'showEpisodes', sTitle, '', sThumb,
                       sDesc, oOutputParameterHandler)

        progress_.VSclose(progress_)
    # (.+?) ([^<]+) .+?
    sPattern = ' <div class="one-poster col-sm-2">.+?<div class="wrap-poster clearfix">.+?<a href="([^<]+)"><img width=".+?" height=".+?" src="([^<]+)".+?<h2>([^<]+)</h2>'

    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]
            siteUrl = str(aEntry[0])
            sThumb = aEntry[1]
            sDesc = sNote

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', siteUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oGui.addTV(SITE_IDENTIFIER, 'showServers', sTitle, '', sThumb,
                       sDesc, 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()
def showMovies(sSearch=''):
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')

    if sSearch:
        sUrl = sSearch.replace(' ', '+').replace('%20 ', '+')
        sPattern = 'class="result-item".+?href="([^"]+).+?src="([^"]+).+?alt="([^"]+).+?class="year">([^<]*).+?contenido"><p>([^<]*)'
    else:
        sPattern = 'class="item.(?:movies|tvshows).+?src="([^"]+).+?alt="([^"]+).+?ref="([^"]+).+?<span>(\d{4}).+?class="texto">([^<]*)'
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    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

            if sSearch:
                sUrl2 = aEntry[0]
                sThumb = aEntry[1]
                sTitle = aEntry[2]
                sYear = aEntry[3]
                sDesc = aEntry[4]

            else:
                sThumb = aEntry[0]
                sTitle = aEntry[1]
                sUrl2 = aEntry[2]
                sYear = aEntry[3]
                sDesc = aEntry[4]

            if key_serie in sUrl:
                if '/series' not in sUrl2:
                    continue
            if key_film in sUrl:
                if '/series' in sUrl2:
                    continue

            sDisplayTitle = sTitle
            # Quel intérêt ??
            # if '/series' in sUrl2:
                # sDisplayTitle = sDisplayTitle + ' [Série]'
            # else:
                # sDisplayTitle = sDisplayTitle + ' [Film]'

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

            if '/series' in sUrl2:
                oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sDisplayTitle, '', sThumb, sDesc, oOutputParameterHandler)
            else:
                sDisplayTitle = ('%s (%s)') % (sDisplayTitle, sYear)
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sDisplayTitle, '', 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, 'showMovies', 'Page ' + sPaging, oOutputParameterHandler)

        oGui.setEndOfDirectory()
Exemple #45
0
def showHosters(sLoop=False):
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    sHtmlContent = sHtmlContent.replace('<iframe src="//www.facebook.com/', '')
    sHtmlContent = sHtmlContent.replace("src='https://ad.a-ads.com", '')

    oParser = cParser()

    sPattern = '<a class="large button.+?" href="([^<>"]+?)" target="(?:_blank|vid)"'
    aResult = oParser.parse(sHtmlContent, sPattern)

    #Si il y a rien a afficher c'est peut etre une serie
    if (len(aResult) == 0) and (sLoop == False):
        #oGui.setEndOfDirectory()
        showSeries(True)
        return

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

            sHosterUrl = aEntry
            #pour récuperer tous les liens
            if '&url=' in sHosterUrl:
                sHosterUrl = sHosterUrl.split('&url=')[1]

            if 'filmhdstream' in sHosterUrl:

                sTitle = sMovieTitle + ' [COLOR coral]GoogleDrive[/COLOR]'

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', sHosterUrl)
                oOutputParameterHandler.addParameter('sMovieTitle',
                                                     sMovieTitle)
                oOutputParameterHandler.addParameter('sThumb', sThumb)
                oGui.addLink(SITE_IDENTIFIER, 'showHostersFhds', sTitle,
                             sThumb, '', oOutputParameterHandler)

            #pour récuperer les liens jheberg
            elif 'jheberg' in sHosterUrl:
                aResult = cJheberg().GetUrls(sHosterUrl)
                if aResult:
                    for aEntry in aResult:
                        sHosterUrl = aEntry

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

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

    oGui.setEndOfDirectory()
Exemple #46
0
def showServers():
    oGui = cGui()

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

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

    oParser = cParser()
    #Affichage du menu
    oGui.addText(SITE_IDENTIFIER,
                 '[COLOR olive]-------سيرفرات المشاهدة--------[/COLOR]')

    #Recuperation infos
    sId = ''
    serv = ''
    sUrl2 = ''

    sPattern = '<a class="buttosn"  data-serv="(.+?)" data-post="(.+?)"><i'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0]):
        for aEntry in aResult[1]:
            total = len(aResult[1])
            progress_ = progress().VScreate(SITE_NAME)
            serv = aEntry[0]
            sId = aEntry[1]
            sUrl2 = 'https://www.zimabdko.com/wp-admin/admin-ajax.php?action=codecanal_ajax_request&post=' + sId + '&serv=' + serv

            oRequestHandler = cRequestHandler(sUrl2)
            sHtmlContent2 = oRequestHandler.request()

            # (.+?) .+? ([^<]+)
            sPattern = 'src="([^<]+)" allowfullscreen>'
            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 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,
                                                sThumb)

                progress_.VSclose(progress_)

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

    # (.+?) .+? ([^<]+)

    sPattern = '<a href="([^<]+)"><i'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    #print aResult

    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 = aEntry
            sTitle = ""

            if 'thevideo.me' in url:
                sTitle = " (thevideo.me)"
            if 'flashx' in url:
                sTitle = " (flashx)"
            if 'streamcherry' in url:
                sTitle = " (streamcherry)"
            if url.startswith('//'):
                url = 'https:' + url

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

        progress_.VSclose(progress_)

    oGui.setEndOfDirectory()
Exemple #47
0
def showMovies(sSearch=''):
    oGui = cGui()
    if sSearch:
        sUrl = sSearch
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    #Meilleure resolution sThumb
    sHtmlContent = sHtmlContent.replace('119x125', '125x160')

    #Magouille pour virer les 3 ligne en trop en cas de recherche
    if sSearch:
        sHtmlContent = sHtmlContent.replace('quelle-est-votre-serie-preferee',
                                            '<>')
        sHtmlContent = sHtmlContent.replace('top-series-du-moment', '<>')
        sHtmlContent = sHtmlContent.replace(
            'listes-des-series-annulees-et-renouvelees', '<>')

    oParser = cParser()
    sPattern = '<div class="moviefilm"> *<a href=".+?"> *<img src="([^<>"]+)".+?\/> *<\/a> *<div class="movief"><a href="([^<]+)">([^<]+)<\/a>.+?<p>(.+?)<\/p>'
    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(sSearch.replace(URL_SEARCH[0], ''),
                                          aEntry[2]) == 0:
                    continue

            sThumb = aEntry[0]
            sUrl = aEntry[1]
            sTitle = aEntry[2].replace(' - Saison', ' Saison')
            sTitle = sTitle.replace(' [Streaming]', '')
            sTitle = sTitle.replace(' [Telecharger]',
                                    '').replace(' [Telechargement]', '')
            #sDisplayTitle = sTitle.replace(' [Complète]', '').replace(' [Complete]', '')
            sDisplayTitle = sTitle
            #on retire la qualité
            sTitle = re.sub('\[\w+]', '', sTitle)
            sTitle = re.sub('\[\w+ \w+]', '', sTitle)
            sDesc = aEntry[3].replace('[&hellip;]', '').replace(
                '&rsquo;', '\'').replace('&#8230;',
                                         '...').replace('&#8217;', '\'')

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

            if '-filmographie-streaming' in aEntry[1]:
                pass
            elif 'quelle-est-votre-serie-preferee' in aEntry[1]:
                pass
            elif 'series' in sUrl or re.match('.+?saison [0-9]+', sTitle,
                                              re.IGNORECASE):
                oGui.addTV(SITE_IDENTIFIER, 'showSeries', sDisplayTitle, '',
                           sThumb, sDesc, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sDisplayTitle,
                              '', 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()
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    oParser = cParser()

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

    sPattern = '<b><a href=".+?redirect\/\?url\=(.+?)\&id.+?">'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sUrl = cUtil().urlDecode(aResult[1][0])

        if 'gounlimited' in sUrl:
            oRequestHandler = cRequestHandler(sUrl)
            sHtmlContent = oRequestHandler.request()

            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:"([^"]+)"\,label:"([^"]+)"}'
                aResult = oParser.parse(sHtmlContent, sPattern)
                for aEntry in aResult[1]:
                    sHosterUrl = str(aEntry[0])
                    sDisplayTitle = ('[%s] %s') % (aEntry[1] + 'p',
                                                   sMovieTitle)
                    oHoster = cHosterGui().checkHoster(sHosterUrl)
                    if (oHoster != False):
                        oHoster.setDisplayName(sDisplayTitle)
                        oHoster.setFileName(sDisplayTitle)
                        cHosterGui().showHoster(oGui, oHoster, sHosterUrl,
                                                sThumbnail)

        elif 'jheberg' in sUrl:

            sUrl = sUrl.replace('captcha', 'mirrors')
            if not 'www.jheberg' in sUrl:
                sUrl = sUrl.replace('jheberg', 'www.jheberg')

            aResult = cJheberg().GetUrls(sUrl)
            for aEntry in aResult:
                sHosterUrl = aEntry

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

        elif 'multiup' in sUrl:

            aResult = cMultiup().GetUrls(sUrl)
            if (aResult):
                for aEntry in aResult:
                    sHosterUrl = aEntry

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

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

    oGui.setEndOfDirectory()
def showMovies(sSearch=''):
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    if sSearch:
        sUrl = sSearch.replace(' ', '-').replace('%20', '-') + '.html'
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    if 'list-films.html' in sUrl or '/films/page' in sUrl:
        sPattern = '<a class="movie_single.+?href="([^"]+).+?img src="([^"]+).+?class="nop">([^<]+).+?class="qualitos">([^<]+).+?class="synopsis nop">([^<]+)'
    else:
        sPattern = '<a class="movie_single.+?href="([^"]+).+?img src="([^"]+).+?class="nop">([^<]+)'

    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

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

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

            sTitle = aEntry[2].strip()
            sQual = ''
            sDesc = ''
            if 'list-films.html' in sUrl or '/films/page' in sUrl:
                sQual = aEntry[3]
                sDesc = aEntry[4]

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

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

            if '/series' not in sUrl2:
                oGui.addMovie(SITE_IDENTIFIER, 'showLinks', sDisplayTitle, '',
                              sThumb, sDesc, oOutputParameterHandler)
            else:
                oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sDisplayTitle, '',
                           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, 'showMovies', 'Page ' + sPaging,
                         oOutputParameterHandler)

        oGui.setEndOfDirectory()
Exemple #50
0
def showSeries(sLoop=False):
    oGui = cGui()
    oParser = cParser()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

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

    sHtmlContent = sHtmlContent.decode('utf-8', "replace")
    sHtmlContent = unicodedata.normalize('NFD', sHtmlContent).encode(
        'ascii', 'ignore').decode("unicode_escape")  #vire accent et '\'
    sHtmlContent = sHtmlContent.encode('utf-8')  #On remet en utf-8

    #récupération du Synopsis
    sDesc = ''
    try:
        sPattern = '</p><p style="text-align: center;">([^<]+)<\/p><p style="text-align: center;">'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if aResult[0]:
            sDesc = aResult[1][0]
            sDesc = sDesc.replace('&#8217;', '\'').replace('&#8230;', '...')
    except:
        pass

    sPattern = '<span style="color: #33cccc;[^<>"]*">(?:<(?:strong|b)>)*((?:Stream|Telec)[^<>]+)|>(Episode[^<]{2,12})<(?!\/a>)(.+?a href="http.+?)(?:<.p|<br|<.div)'
    aResult = oParser.parse(sHtmlContent, sPattern)

    #astuce en cas d'episode unique
    if (aResult[0] == False) and (sLoop == False):
        #oGui.setEndOfDirectory()
        serieHosters(True)
        return

    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

            #langue
            if aEntry[0]:
                oGui.addText(SITE_IDENTIFIER,
                             '[COLOR red]' + aEntry[0] + '[/COLOR]')
            #episode
            else:
                sUrl = aEntry[2]
                sTitle = sMovieTitle + ' ' + aEntry[1].replace(' New', '')

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

        progress_.VSclose(progress_)

    oGui.setEndOfDirectory()
Exemple #51
0
def showHosters():  # recherche et affiche les hotes
    #print "ZT:showHosters"

    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler(
    )  #apelle l'entree de paramettre
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    xbmc.log(sUrl)

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

    #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:
        sHtmlContent = CutNonPremiumlinks(sHtmlContent)

    oParser = cParser()

    sPattern = '<span style="color:#.{6}">([^>]+?)<\/span>(?:.(?!color))+?<a href="([^<>"]+?)" target="_blank">Télécharger<\/a>|>\[(Liens Premium) \]<|<span style="color:#FF0000">([^<]+)<'
    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]:
            cConfig().updateDialog(dialog, total)
            if dialog.iscanceled():
                break

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

            elif aEntry[3]:
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', str(sUrl))
                oOutputParameterHandler.addParameter('sMovieTitle',
                                                     str(sMovieTitle))
                oOutputParameterHandler.addParameter('sThumbnail',
                                                     str(sThumbnail))
                oGui.addText(SITE_IDENTIFIER,
                             '[COLOR olive]' + str(aEntry[3]) + '[/COLOR]')

            else:
                sTitle = '[COLOR skyblue]' + aEntry[
                    0] + '[/COLOR] ' + sMovieTitle
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', aEntry[1])
                oOutputParameterHandler.addParameter('sMovieTitle',
                                                     str(sMovieTitle))
                oOutputParameterHandler.addParameter('sThumbnail',
                                                     str(sThumbnail))
                oGui.addMovie(SITE_IDENTIFIER, 'Display_protected_link',
                              sTitle, '', sThumbnail, '',
                              oOutputParameterHandler)

            cConfig().finishDialog(dialog)

        oGui.setEndOfDirectory()
def showLinks():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')
    sDesc = oInputParameterHandler.getValue('sDesc')

    oParser = cParser()
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    sPattern = 'itemprop="description">([^<]+)'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sDesc = ('[I][COLOR grey]%s[/COLOR][/I] %s') % ('Synopsis :',
                                                        aResult[1][0])

    sPattern = '<img src=".(vf|vostfr).png|data-url="([^"]+).+?data-code="([^"]+).+?<span>([^<]+)'
    aResult = oParser.parse(sHtmlContent, sPattern)
    sLang = ''

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

            if aEntry[0]:
                sLang = aEntry[0].upper()

            if aEntry[1]:
                dataUrl = aEntry[1]
                dataCode = aEntry[2]
                sHost = aEntry[3].capitalize()
                if isBlackHost(sHost):
                    continue

                sUrl2 = URL_MAIN + 'Players.php?PPl=' + dataUrl + '&CData=' + dataCode
                sDisplayTitle = ('%s (%s) [COLOR coral]%s[/COLOR]') % (
                    sTitle, sLang, sHost)
                oOutputParameterHandler.addParameter('siteUrl', sUrl2)
                oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
                oOutputParameterHandler.addParameter('sDesc', sDesc)
                oOutputParameterHandler.addParameter('sThumb', sThumb)
                oOutputParameterHandler.addParameter('sHost', sHost)
                oOutputParameterHandler.addParameter('sLang', sLang)
                oOutputParameterHandler.addParameter('referer', sUrl)
                oGui.addLink(SITE_IDENTIFIER, 'showHosters', sDisplayTitle,
                             sThumb, sDesc, oOutputParameterHandler)

    sPattern = "<img src=\".(vf|vostfr).png|class=.Playersbelba.+?PPl=(.+?)CData=([^']+).+?<.span>.+?<span>([^<]+)"
    aResult = oParser.parse(sHtmlContent, sPattern)

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

            if aEntry[0]:
                sLang = aEntry[0].upper()

            if aEntry[1]:
                dataUrl = aEntry[1]
                dataCode = aEntry[2]
                sHost = aEntry[3].capitalize()

                sUrl2 = URL_MAIN + 'Players.php?PPl=' + dataUrl + 'CData=' + dataCode

                sDisplayTitle = ('%s (%s) [COLOR coral]%s[/COLOR]') % (
                    sTitle, sLang, sHost)

                oOutputParameterHandler.addParameter('siteUrl', sUrl2)
                oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
                oOutputParameterHandler.addParameter('sDesc', sDesc)
                oOutputParameterHandler.addParameter('sThumb', sThumb)
                oOutputParameterHandler.addParameter('sHost', sHost)
                oOutputParameterHandler.addParameter('sLang', sLang)
                oOutputParameterHandler.addParameter('referer', sUrl)
                oGui.addLink(SITE_IDENTIFIER, 'showHosters', sDisplayTitle,
                             sThumb, sDesc, oOutputParameterHandler)
    oGui.setEndOfDirectory()
Exemple #53
0
def showMoviesLinks(sHtmlContent):
    xbmc.log('mode film')

    oGui = cGui()

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

    #print sUrl

    oParser = cParser()

    #Recuperation infos
    sNote = ''
    sCom = ''
    sBA = ''

    sPattern = 'itemprop="ratingValue">([0-9,]+)<\/span>.+?synopsis\.png" *\/*></div><br /><div align="center">(.+?)<'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0]):
        sNote = aResult[1][0][0]
        sCom = aResult[1][0][1]
        sCom = cUtil().removeHtmlTags(sCom)
    if (sNote):
        oGui.addText(SITE_IDENTIFIER, 'Note : ' + str(sNote))

    sPattern = '(http:\/\/www\.exdown\.net\/engine\/ba\.php\?id=[0-9]+)'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0]):
        sBA = aResult[1][0]
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('sUrl', sBA)
        oOutputParameterHandler.addParameter('sMovieTitle', 'Bande annonce')
        oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
        oGui.addMovie(SITE_IDENTIFIER, 'ShowBA', 'Bande annonce', '',
                      sThumbnail, '', oOutputParameterHandler)

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

    #on recherche d'abord la qualité courante
    sPattern = '<b>(?:<strong>)*Qualité (.+?)<'
    aResult = oParser.parse(sHtmlContent, sPattern)
    #print aResult

    sQual = ''
    if (aResult[0]):
        sQual = aResult[1][0]

    sTitle = sMovieTitle + ' - [COLOR skyblue]' + sQual + '[/COLOR]'

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', sUrl)
    oOutputParameterHandler.addParameter('sMovieTitle', str(sMovieTitle))
    oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
    oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, '', sThumbnail, sCom,
                  oOutputParameterHandler)

    #on regarde si dispo dans d'autres qualités
    sPattern = '<a title="Téléchargez.+?en (.+?)" href="(.+?)"><button class="button_subcat"'
    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 = sMovieTitle + ' - [COLOR skyblue]' + aEntry[0] + '[/COLOR]'
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', aEntry[1])
            oOutputParameterHandler.addParameter('sMovieTitle',
                                                 str(sMovieTitle))
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
            oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, '',
                          sThumbnail, sCom, oOutputParameterHandler)

        cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()
Exemple #54
0
def showSeriesHosters():  # recherche et affiche les hotes
    #print "ZT:showSeriesHosters"
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler(
    )  #apelle l'entree de paramettre
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

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

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

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

    oParser = cParser()

    sPattern = '<a href="([^"]+?)" target="_blank">([^<]+)<\/a>|<span style="color:#.{6}">([^<]+)<\/span>'
    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)
            #print aEntry
            if dialog.iscanceled():
                break

            if aEntry[2]:
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', str(sUrl))
                oOutputParameterHandler.addParameter('sMovieTitle',
                                                     str(sMovieTitle))
                oOutputParameterHandler.addParameter('sThumbnail',
                                                     str(sThumbnail))
                if 'Télécharger' in aEntry[2]:
                    oGui.addText(SITE_IDENTIFIER,
                                 '[COLOR olive]' + str(aEntry[2]) + '[/COLOR]')
                else:
                    oGui.addText(SITE_IDENTIFIER,
                                 '[COLOR red]' + str(aEntry[2]) + '[/COLOR]')
            else:
                sName = aEntry[1]
                sName = sName.replace('Télécharger', '')
                sName = sName.replace('pisodes', 'pisode')

                sTitle = sMovieTitle + ' ' + sName
                sDisplayTitle = cUtil().DecoTitle(sTitle)

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', aEntry[0])
                oOutputParameterHandler.addParameter('sMovieTitle',
                                                     str(sMovieTitle))
                oOutputParameterHandler.addParameter('sThumbnail',
                                                     str(sThumbnail))
                oGui.addMovie(SITE_IDENTIFIER, 'Display_protected_link',
                              sDisplayTitle, '', sThumbnail, '',
                              oOutputParameterHandler)

            cConfig().finishDialog(dialog)

        oGui.setEndOfDirectory()
Exemple #55
0
    def parseUrl(self):

        #xbmc.log(str(sys.argv), xbmc.LOGNOTICE)

        oInputParameterHandler = cInputParameterHandler()
        if (oInputParameterHandler.exist('function')):
            sFunction = oInputParameterHandler.getValue('function')
        else:
            cConfig().log('call load methode')
            sFunction = "load"

        if (sFunction=='DoNothing'):
            return

        if (not oInputParameterHandler.exist('site')):  

            #mise a jour
            try:
                from resources.lib.about import cAbout
                cAbout().getUpdate()
                #exec "from resources.lib.about import cAbout as plugin"
                #exec "plugin.getUpdate()"
            except:
                pass
              
            #charge home
            plugins = __import__('resources.lib.home', fromlist=['home']).cHome()
            function = getattr(plugins, 'load')
            function()
            return
        
            
        if (oInputParameterHandler.exist('site')):
            sSiteName = oInputParameterHandler.getValue('site')
            cConfig().log('load site ' + sSiteName + ' and call function ' + sFunction)
            cStatistic().callStartPlugin(sSiteName)

            if (isHosterGui(sSiteName, sFunction) == True):
                return

            if (isGui(sSiteName, sFunction) == True):
                return

            if (isFav(sSiteName, sFunction) == True):
                return

            if (isLibrary(sSiteName, sFunction) == True):
                return

            if (isDl(sSiteName, sFunction) == True):
                return

            if (isHome(sSiteName, sFunction) == True):
                return

            if (isTrakt(sSiteName, sFunction) == True):
                return
                
            if sSiteName == 'globalSearch':
                searchGlobal()
                return
                
            if sSiteName == 'globalSources':
            
                oGui = cGui()
                oPluginHandler = cPluginHandler()
                aPlugins = oPluginHandler.getAvailablePlugins()
                if (len(aPlugins) == 0):
                    oGui.openSettings()
                    oGui.updateDirectory()
                else:
                    for aPlugin in aPlugins:
                    
                        oOutputParameterHandler = cOutputParameterHandler()
                        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
                        icon = 'sites/%s.png' % (aPlugin[1])
                        oGui.addDir(aPlugin[1], 'load', aPlugin[0], icon, oOutputParameterHandler)

                oGui.setEndOfDirectory()
                return

            if sSiteName == 'globalParametre':
                cConfig().showSettingsWindow()
                return
            #if (isAboutGui(sSiteName, sFunction) == True):
                #return

            #charge sites
            try:
            #exec "from resources.sites import " + sSiteName + " as plugin"
            #exec "plugin."+ sFunction +"()"
                plugins = __import__('resources.sites.%s' % sSiteName, fromlist=[sSiteName])
                function = getattr(plugins, sFunction)
                function()
            except Exception as e:
                cConfig().log('could not load site: ' + sSiteName + ' error: ' + str(e))
                import traceback
                traceback.print_exc()
                return
Exemple #56
0
def showSeriesLinks(sHtmlContent):
    xbmc.log('mode serie')

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

    #print sUrl

    oParser = cParser()

    #Mise à jour du titre
    sPattern = '<h1 style="font-family:\'Ubuntu Condensed\',\'Segoe UI\',Verdana,Helvetica,sans-serif;">(?:<span itemprop="name">)*([^<]+?)<'
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0]):
        sMovieTitle = aResult[1][0]

    #Utile ou pas ?
    sMovieTitle = sMovieTitle.replace('[Complete]',
                                      '').replace('[Complète]', '')

    oGui.addText(
        SITE_IDENTIFIER,
        '[COLOR olive]Qualités disponibles pour cette saison :[/COLOR]')

    #on recherche d'abord la qualité courante
    sPattern = '<span style="color:#[0-9a-z]{6}"><b>(?:<strong>)* *\[[^\]]+?\] ([^<]+?)<'
    aResult = oParser.parse(sHtmlContent, sPattern)
    #print aResult

    sQual = ''
    if (aResult[1]):
        sQual = aResult[1][0]

    sDisplayTitle = cUtil().DecoTitle(
        sMovieTitle) + ' - [COLOR skyblue]' + sQual + '[/COLOR]'

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', sUrl)
    oOutputParameterHandler.addParameter('sMovieTitle', str(sMovieTitle))
    oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
    oGui.addMovie(SITE_IDENTIFIER, 'showSeriesHosters', sDisplayTitle, '',
                  sThumbnail, '', oOutputParameterHandler)

    #on regarde si dispo dans d'autres qualités
    sPattern1 = '<a title="Téléchargez.+?en ([^"]+?)" href="([^"]+?)"><button class="button_subcat"'
    aResult1 = oParser.parse(sHtmlContent, sPattern1)
    #print aResult1

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

            sDisplayTitle = cUtil().DecoTitle(
                sMovieTitle) + ' - [COLOR skyblue]' + aEntry[0] + '[/COLOR]'
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', aEntry[1])
            oOutputParameterHandler.addParameter('sMovieTitle',
                                                 str(sMovieTitle))
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
            oGui.addMovie(SITE_IDENTIFIER, 'showSeriesHosters', sDisplayTitle,
                          '', sThumbnail, '', oOutputParameterHandler)

        cConfig().finishDialog(dialog)

    #on regarde si dispo d'autres saisons

    sPattern2 = '<a title="Téléchargez[^"]+?" href="([^"]+?)"><button class="button_subcat" style="font-size: 12px;height: 26px;width:190px;color:666666;letter-spacing:0.05em">([^<]+?)</button>'
    aResult2 = oParser.parse(sHtmlContent, sPattern2)
    #print aResult2

    if (aResult2[0] == True):
        oGui.addText(
            SITE_IDENTIFIER,
            '[COLOR olive]Saisons aussi disponibles pour cette série :[/COLOR]'
        )

        for aEntry in aResult2[1]:

            sTitle = '[COLOR skyblue]' + aEntry[1] + '[/COLOR]'
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', aEntry[0])
            oOutputParameterHandler.addParameter('sMovieTitle',
                                                 str(sMovieTitle))
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
            oGui.addTV(SITE_IDENTIFIER, 'showLinks', sTitle, 'series.png',
                       sThumbnail, '', oOutputParameterHandler)

    oGui.setEndOfDirectory()
Exemple #57
0
def showSeriesHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')
    sDesc = oInputParameterHandler.getValue('sDesc')
    sRel_Episode = oInputParameterHandler.getValue('sRel_Episode')
    sFirst_Url = oInputParameterHandler.getValue('sFirst_Url')

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

    sPattern = '<div id="' + sRel_Episode + '" class="fullsfeature".*?<a (id="singh.*?<div style="height)'
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        # cas ou il n'y a qu'un seul lien  pas de référence  dans <div id="episodexx" class="fullsfeature">
        # le pattern est normalement hs
        if sFirst_Url:
            sUrl2 = sFirst_Url
            sHost = '[COLOR coral]' + getHostName(sUrl2) + '[/COLOR]'

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

    if (aResult[0] == True):
        html = aResult[1][0]
        sPattern = 'href="([^"]+).*?aria-hidden'
        aResulturl = oParser.parse(html, sPattern)
        if (aResulturl[0] == True):
            for aEntry in aResulturl[1]:
                sUrl2 = aEntry
                sHost = getHostName(sUrl2)
                if len(aResult[1]) == 1 and 'openload' in sUrl2:
                    oGui.addText(SITE_IDENTIFIER, '[COLOR skyblue] openload : site non sécurisé [/COLOR]')
                    continue

                if isblackhost(sUrl2):
                    continue

                if 'hqq.tv' in sUrl2:
                    continue

                if 'www' in sHost.lower():
                    sHost = getHostName(sUrl2)

                sHost = '[COLOR coral]' + sHost + '[/COLOR]'
                sDisplayTitle = sMovieTitle + ' ' + sHost

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

    oGui.setEndOfDirectory()
Exemple #58
0
    def showSearch(self, searchtext = cInputParameterHandler().getValue('searchtext')):

        if not searchtext:
            return self.showSearchText()

        #n'existe plus mais pas sure.
        #xbmcgui.Window(10101).clearProperty('search_text')
        window(10101).clearProperty('search_text')

        oGui = cGui()

        #print xbmc.getInfoLabel('ListItem.Property(Category)')

        oGui.addText('globalSearch', addons.VSlang(30077) % (searchtext), 'none.png')

        #utilisation de guielement pour ajouter la bonne catégorie

        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        oOutputParameterHandler.addParameter('searchtext', searchtext)

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName('globalSearch')
        oGuiElement.setFunction('showSearch')
        oGuiElement.setTitle(addons.VSlang(30078))
        oGuiElement.setFileName(addons.VSlang(30078))
        oGuiElement.setIcon('search.png')
        oGuiElement.setMeta(0)
        #oGuiElement.setThumbnail(sThumbnail)
        #oGuiElement.setFanart(sFanart)
        oGuiElement.setCat(1)

        oGui.addFolder(oGuiElement, oOutputParameterHandler)

        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        oOutputParameterHandler.addParameter('searchtext', searchtext)

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName('globalSearch')
        oGuiElement.setFunction('showSearch')
        oGuiElement.setTitle(addons.VSlang(30079))
        oGuiElement.setFileName(addons.VSlang(30079))
        oGuiElement.setIcon('search.png')
        oGuiElement.setMeta(0)
        #oGuiElement.setThumbnail(sThumbnail)
        #oGuiElement.setFanart(sFanart)
        oGuiElement.setCat(2)

        oGui.addFolder(oGuiElement, oOutputParameterHandler)

        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        oOutputParameterHandler.addParameter('searchtext', searchtext)

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName('globalSearch')
        oGuiElement.setFunction('showSearch')
        oGuiElement.setTitle(addons.VSlang(30080))
        oGuiElement.setFileName(addons.VSlang(30080))
        oGuiElement.setIcon('search.png')
        oGuiElement.setMeta(0)
        #oGuiElement.setThumbnail(sThumbnail)
        #oGuiElement.setFanart(sFanart)
        oGuiElement.setCat(3)

        oGui.addFolder(oGuiElement, oOutputParameterHandler)

        # oOutputParameterHandler = cOutputParameterHandler()
        # oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        # oOutputParameterHandler.addParameter('searchtext', searchtext)
        # oOutputParameterHandler.addParameter('disp', 'search10')
        # oOutputParameterHandler.addParameter('readdb', 'True')
        # oGui.addDir('globalSearch', 'showSearchText', 'addons.VSlang(30417), 'search.png', oOutputParameterHandler)

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

    bSearchMovie = False
    bSearchSerie = False
    if sSearch:

        sSearch = sSearch.replace('%20', ' ')

        if key_search_movies in sSearch:
            sSearch = sSearch.replace(key_search_movies, '')
            bSearchMovie = True
        if key_search_series in sSearch:
            sSearch = sSearch.replace(key_search_series, '')
            bSearchSerie = True
        sSearch2 = sSearch.replace('-', '').strip().lower()
        sUrl = URL_SEARCH[0] + sSearch2
        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

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

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

    sSearch2 = sSearch.replace('-', '').strip().lower()
    # ref thumb title
    sPattern = 'class="TPostMv">.+?href="([^"]*).+?src="([^"]*).+?center">([^<]*)'
    aResult = oParser.parse(sHtmlContent, sPattern)

    itemss = 0

    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

            itemss += 1

            sUrl2 = aEntry[0]
            sThumb = aEntry[1]
            sTitle = aEntry[2]

            if bSearchMovie:
                if ' saison ' in sTitle.lower():
                    continue
            if bSearchSerie:
                if ' saison ' not in sTitle.lower():
                    continue

            if sSearch and itemss > 4:  # 5 premiers résultats non filtrés en cas d'erreur du filtre
                s1 = sTitle.lower()
                if '-' in s1:
                    s1 = s1.split('-')[0]
                if '(' in s1:
                    s1 = s1.split('(')[0]
                s1 = s1.strip()
                if sSearch2 not in s1:
                    continue

            sDisplayTitle = sTitle.replace('- Saison', ' Saison')
            if sSearch and not bSearchMovie and not bSearchSerie:
                if '/serie' in sUrl or '- saison ' in sTitle.lower():
                    sDisplayTitle = sDisplayTitle + ' [Série]'
                else:
                    sDisplayTitle = sDisplayTitle + ' [Film]'

            if 'http' not in sUrl2:
                sUrl2 = URL_MAIN[:-1] + sUrl2

            if 'http' not in sThumb:
                sThumb = URL_MAIN[:-1] + sThumb

            # pour le debugage source avec bcpdechance d'etre hs
            # films didfficile a obtenir apres id= 18729
            # if not ('/serie' in sUrl or ' saison ' in sTitle.lower()):
                # idmovie = get_id_int_Movie(sUrl2)
                # if idmovie  <= 18729:
                    # sDisplayTitle = sDisplayTitle + ' *'

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

            if '/serie' in sUrl or '- saison ' in sTitle.lower():

                oGui.addTV(SITE_IDENTIFIER, 'ShowEpisodes', sDisplayTitle, '', sThumb, '', oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sDisplayTitle, '', sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

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

        oGui.setEndOfDirectory()
Exemple #60
0
def searchGlobal():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sSearchText = oInputParameterHandler.getValue('searchtext')
    sReadDB = oInputParameterHandler.getValue('readdb')
    sDisp = oInputParameterHandler.getValue('disp')

    oHandler = cRechercheHandler()
    sSearchText = oHandler.setText(sSearchText)
    oHandler.setDisp(sDisp)
    oHandler.setRead(sReadDB)
    aPlugins = oHandler.getAvailablePlugins()
    if not aPlugins: return True
    total = len(aPlugins)
    
    #xbmc.log(str(aPlugins), xbmc.LOGNOTICE)
    
    dialog = cConfig().createDialog("vStream")
    xbmcgui.Window(10101).setProperty('search', 'true')
    
    oGui.addText('globalSearch', '[COLOR khaki]%s: %s[/COLOR]' % (cConfig().getlanguage(30076), sSearchText), 'none.png')
    
    for count, plugin in enumerate(aPlugins):
    
        text = '%s/%s - %s' % ((count+1), total, plugin['name'])
        cConfig().updateDialogSearch(dialog, total, text)
        if dialog.iscanceled():
            break
        
        #nom du site
        oGui.addText(plugin['identifier'], '%s. [COLOR olive]%s[/COLOR]' % ((count+1), plugin['name']), 'sites/%s.png' % (plugin['identifier']))
        #recherche import
        _pluginSearch(plugin, sSearchText)
      
    xbmcgui.Window(10101).setProperty('search', 'false')
    
    #affichage
    total=len(oGui.searchResults)
    #filtre
    int_1 = cUtil().CheckOrd(sSearchText)
    
    for count,result in enumerate(oGui.searchResults):
        text = '%s/%s - %s' % ((count+1/total), total, result['guiElement'].getTitle())
        cConfig().updateDialogSearch(dialog, total, text)
        
        #filtre
        if cConfig().getSetting('search_filter') == 'true' and result['guiElement'].getFunction() != 'DoNothing':
            int_2 = cUtil().CheckOrd(result['guiElement'].getFileName())
            middle = int(abs(int_1-int_2))
            #xbmc.log('%s (%s) - %s (%s)' % (middle, result['guiElement'].getFileName(), cConfig().getSetting('search_ord'), sSearchText),  xbmc.LOGNOTICE)
            if middle > int(cConfig().getSetting('search_ord')):
                continue
            
            
        oGui.addFolder(result['guiElement'],result['params'])
        #xbmc.log('%s - %s' % (middle,old_label),  xbmc.LOGNOTICE)
        
    cConfig().finishDialog(dialog)
    

    oGui.setEndOfDirectory()

    return True