Esempio n. 1
0
    def __getMediaLinkForGuest(self): 
                    
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()
        
        oParser = cParser()
              
        #Dean Edwards Packer
        sPattern = "(\s*eval\s*\(\s*function(?:.|\s)+?)<\/script>"
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sUnpacked = cPacker().unpack(aResult[1][0])
        
        #fh = open('c:\\test.txt', "w")
        #fh.write(sUnpacked)
        #fh.close()
        
        if (sUnpacked):

            sPattern ='var vurl2 *= *"([^"]+?)";'
            aResult = oParser.parse(sUnpacked, sPattern)
            
            #print aResult
            
            if (aResult[0] == True):
                return True , aResult[1][0]
        
        cGui().showInfo(self.__sDisplayName, 'Fichier introuvable' , 5)
        
        return False, False
Esempio n. 2
0
 def __getMediaLinkForGuest(self):
     url=[]
     qua=[]
     
     oRequest = cRequestHandler(self.__sUrl)
     sHtmlContent = oRequest.request()
     
     sPattern =  '"url.+?":"(.+?)\.(\d+).mp4'
           
     oParser = cParser()
     aResult = oParser.parse(sHtmlContent, sPattern)
     if (aResult[0] == True):
         cGui().showInfo(self.__sDisplayName, 'Streaming', 5)
         for aEntry in aResult[1]:
              url.append(aEntry[0])
              qua.append(str(aEntry[1]))
          
         dialog2 = xbmcgui.Dialog()
         ret = dialog2.select('Select Quality',qua)
         #sUrl = url[ret]+'.'+qua[ret]+'.mp4'
         api_call = ('%s.%s.mp4') % (url[ret], qua[ret])
         return True, api_call
     else:
         cGui().showInfo(self.__sDisplayName, 'Fichier introuvable' , 5)
         return False, False
     
     return False, False
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    
    oConfig = cConfig()
    oGui = cGui()

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setFunction('displaySeasions')
    oGuiElement.setTitle(oConfig.getLocalizedString(30302))
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('language', '')
    oGui.addFolder(oGuiElement, oOutputParameterHandler)

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setFunction('displaySeasions')
    oGuiElement.setTitle(oConfig.getLocalizedString(30303))
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('language', 'en')
    oGui.addFolder(oGuiElement, oOutputParameterHandler)

    oGui.setEndOfDirectory()
Esempio n. 4
0
 def streamAuto(self, playMode, siteName, function):
     self.dialog = xbmcgui.DialogProgress()
     self.dialog.create("xStream", "get stream/hoster")
     # load site as plugin and run the function
     self.dialog.update(5, "import plugin...")
     plugin = __import__(siteName, globals(), locals())
     function = getattr(plugin, function)
     self.dialog.update(10, "catch links...")
     siteResult = function()
     if not siteResult:
         self.dialog.close()
         cGui().showInfo("xStream", "stream/hoster not available")
         return False
     # if result is not a list, make in one
     if not type(siteResult) is list:
         temp = []
         temp.append(siteResult)
         siteResult = temp
     # field "name" marks hosters
     if "name" in siteResult[0]:
         self.dialog.update(90, "prepare hosterlist..")
         functionName = siteResult[-1]
         del siteResult[-1]
         hosters = self.__getPriorities(siteResult)
         if not hosters:
             self.dialog.close()
             cGui().showInfo("xStream", "no supported hoster available")
             return False
         if len(siteResult) > self.maxHoster:
             siteResult = siteResult[: self.maxHoster - 1]
         check = False
         self.dialog.create("xStream", "try hosters...")
         total = len(hosters)
         count = 0
         for hoster in hosters:
             if self.dialog.iscanceled() or xbmc.abortRequested or check:
                 return
             count = count + 1
             percent = count * 100 / total
             try:
                 logger.info("try hoster %s" % hoster["name"])
                 self.dialog.update(percent, "try hoster %s" % hoster["name"])
                 # get stream links
                 function = getattr(plugin, functionName)
                 siteResult = function(hoster["link"])
                 check = self.__autoEnqueue(siteResult, playMode)
                 if check:
                     return True
             except:
                 self.dialog.update(percent, "hoster %s failed" % hoster["name"])
                 logger.info("playback with hoster %s failed" % hoster["name"])
     # field "resolved" marks streamlinks
     elif "resolved" in siteResult[0]:
         for stream in siteResult:
             try:
                 if self.__autoEnqueue(siteResult, playMode):
                     self.dialog.close()
                     return True
             except:
                 pass
 def __getMediaLinkForPluging(self):
     
     if xbmcaddon.Addon('plugin.video.youtube'):
         return True, self.__sUrl
     else:
         cGui().showInfo(self.__sDisplayName, 'Vous devez installer l\'addon video youtube' , 5)
         return False, False
 def GetMedialinkStreaming(self,sHtmlContent):
     
     oParser = cParser()
     sPattern =  "<source src='([^<>']+?\/0)' type='[^'><]+?' data-res='([0-9]+p)'"
     aResult = oParser.parse(sHtmlContent, sPattern)
     
     if (aResult[0] == True):
         url=[]
         qua=[]
         
         for aEntry in aResult[1]:
             url.append(aEntry[0])
             qua.append(aEntry[1])
          
         dialog2 = xbmcgui.Dialog()
         ret = dialog2.select('Select Quality',qua)
         if (ret > -1):
             stream_url = url[ret]
         else:
             return False
         
         stream_url = urllib.unquote(stream_url)
         if not stream_url.startswith('http'):
             stream_url = 'http:' + stream_url
         return stream_url
     else:
         cGui().showInfo(self.__sDisplayName, 'Fichier introuvable' , 5)
         return False
     
     return False
    def GetMedialinkDL(self,sHtmlContent):
        
        #fh = open('c:\\upto.txt', "w")
        #fh.write(sHtmlContent)
        #fh.close()
        
        if 'You have to wait' in sHtmlContent:
            cGui().showInfo(self.__sDisplayName, 'Limitation active' , 10)
            return False

        oParser = cParser()
        sPattern =  '<form\sname\s*=[\'"]F1[\'"].+?>(.+?)<br\s*\/*>'
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0]):
            sForm = aResult[1][0]

            data = {}
            for match in re.finditer(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', sForm):
                key, value = match.groups()
                data[key] = value
                
            postdata = urllib.urlencode( data )
            headers['Referer'] = self.__sUrl
           
            sHtmlContent = self.oPremiumHandler.GetHtml(self.__sUrl,postdata) 
            
            sPattern =  '<a href *=[\'"](?!http:\/\/uptostream.+)([^<>]+?)[\'"]\s*>\s*<span class\s*=\s*[\'"]button_upload green[\'"]\s*>'
            aResult = oParser.parse(sHtmlContent, sPattern)
            
            if (aResult[0]):
                return aResult[1][0]
        
        return False
Esempio n. 8
0
    def sendToPyLoad(self, siteResult = False):
        from resources.lib.handler.pyLoadHandler import cPyLoadHandler
        import urlresolver
        params = ParameterHandler()

        sMediaUrl = params.getValue('sMediaUrl')
        sFileName = params.getValue('MovieTitle')
        if not sFileName:
            sFileName = params.getValue('Title')
        if not sFileName: #nur vorrübergehend
            sFileName = params.getValue('sMovieTitle')
        if not sFileName:
            sFileName = params.getValue('title')

        if siteResult:
            sMediaUrl = siteResult['streamUrl']
            if siteResult['resolved']:
                sLink = sMediaUrl
            else:
                sLink = urlresolver.resolve(sMediaUrl)
        else:
            sLink = urlresolver.resolve(sMediaUrl)   
        try:
            msg = sLink.msg
        except:
            msg = False
        if sLink != False and not msg:
            logger.info('download with pyLoad: ' + sMediaUrl)
            cPyLoadHandler().sendToPyLoad(sFileName,sLink)
            return True
        else:
            cGui().showError('xStream', str(msg), 5)
            return False
Esempio n. 9
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 __getMediaLinkForGuest(self):
     cGui().showInfo('Resolve', self.__sDisplayName, 5)
     
     oRequest = cRequestHandler(self.__sUrl)
     sHtmlContent = oRequest.request()
     
     #sPattern =  "<source src='(.+?)'"
     sPattern =  "<source src='([^<>']+?\/0)' type='[^'><]+?' data-res='([0-9]+p)'"
     oParser = cParser()
     aResult = oParser.parse(sHtmlContent, sPattern)
     
     if (aResult[0] == True):
         url=[]
         qua=[]
         
         for aEntry in aResult[1]:
             url.append(aEntry[0])
             qua.append(aEntry[1])
          
         dialog2 = xbmcgui.Dialog()
         ret = dialog2.select('Select Quality',qua)
         if (ret > -1):
             stream_url = url[ret]
         else:
             return False, False
         
         stream_url = urllib.unquote(stream_url)
         if not stream_url.startswith('http'):
             stream_url = 'http:' + stream_url
         return True, stream_url
     else:
         cGui().showInfo(self.__sDisplayName, 'Fichier introuvable' , 5)
         return False, False
     
     return False, False
Esempio n. 11
0
    def __getMediaLinkForGuest(self):
    
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()
        
        #Dexieme test Dean Edwards Packer
        oParser = cParser()
        sPattern = "(\s*eval\s*\(\s*function(?:.|\s)+?)<\/script>"
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0] == True):
                sUnpacked = cPacker().unpack(aResult[1][0])
                
                sPattern =  'file:"([^"]+\.mp4)'
                aResult = oParser.parse(sUnpacked, sPattern)

                if (aResult[0] == True):
                    api_call = aResult[1][0]
              
                return True, api_call
        else:
            cGui().showInfo(self.__sDisplayName, 'Fichier introuvable' , 5)
            return False, False
        
        return False, False
Esempio n. 12
0
 def __getMediaLinkForGuest(self):
     
     oRequest = cRequestHandler(self.__sUrl)
     sHtmlContent = oRequest.request()
     
     #fh = open('c:\\test.txt', "w")
     #fh.write(sHtmlContent)
     #fh.close()
     
     url = ''
     url2 = re.findall('var\stracker\s*=\s*[\'|\"](.+?)[\'|\"]',sHtmlContent)
     if (url2):
         url = url + url2[0]
     url2 = re.findall("tracker *: *[\'|\"](.+?)[\'|\"]",sHtmlContent)
     if (url2):
         url = url + url2[0]
     
     url3 = base64.b64decode(url)
     
     if (url3):
         #UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0'
         #url3 = url3 + '|User-Agent=' + UA + '&Referer=' + self.__sUrl
         return True , url3
     
     cGui().showInfo(self.__sDisplayName, 'Fichier introuvable' , 5)
     
     return False, False
Esempio n. 13
0
    def play(self):
        oInputParameterHandler = cInputParameterHandler()

        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        noResolve = oInputParameterHandler.getValue('noResolve')
        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call play: ' + sMediaUrl)

        if noResolve == 'True':
            sLink = sMediaUrl
        else:
            try:
                sLink = urlresolver.resolve(sMediaUrl)
                if sLink is False:
                    cGui().showInfo('Info', 'Dead link')
                    return
            except:
                cGui().showError('Error', 'Cannot resolve URL')
                return

        if sLink is not False:
            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(self.SITE_NAME)
            oGuiElement.setMediaUrl(sLink)
            oGuiElement.setTitle(sFileName)

            oPlayer = cPlayer()
            oPlayer.clearPlayList()
            oPlayer.addItemToPlaylist(oGuiElement)
            oPlayer.startPlayer()
        return
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    oGui = cGui()

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', URL_ANIME_LIST)
    oOutputParameterHandler.addParameter('nextFunction', 'showSeries')
    __createMenuEntry(oGui, 'showCharacters', 'Animes von A - Z', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', URL_MOVIES)
    oOutputParameterHandler.addParameter('nextFunction', 'showMovies')
    __createMenuEntry(oGui, 'showCharacters', 'Movies', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', URL_OVA)
    oOutputParameterHandler.addParameter('nextFunction', 'showOvas')
    __createMenuEntry(oGui, 'showCharacters', 'Ovas', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', URL_SEARCH)    
    __createMenuEntry(oGui, 'showSearch', 'Suche', oOutputParameterHandler)

    oGui.setEndOfDirectory()
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    oGui = cGui()
    __createMenuEntry(oGui, 'showAllSeries', 'Serien', URL_SERIES)   
    oGui.setEndOfDirectory()
def load():
    addons = addon()

    if (addons.getSetting('hoster_onefichier_username') == '') and (addons.getSetting('hoster_onefichier_password') == ''):
        oGui = cGui()
        oGui.addText(SITE_IDENTIFIER, "[COLOR %s]%s[/COLOR]" % ("red", "Nécessite Un Compte 1Fichier Premium ou Gratuit"))
        
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom/')
        oGui.addDir(SITE_IDENTIFIER,'opensetting', addons.VSlang(30023), 'none.png', oOutputParameterHandler)
        oGui.setEndOfDirectory()
    else:
        if (GestionCookie().Readcookie('onefichier') != ''):
            showFile(URL_FILE)

        else:
            oPremiumHandler = cPremiumHandler('onefichier')
            Connection = oPremiumHandler.Authentificate()
            if (Connection == False):
                oGui = cGui()
                oGui.addText(SITE_IDENTIFIER, "[COLOR %s]%s[/COLOR]" % ("red", "Connexion refusée"))
                oGui.setEndOfDirectory()

            else:
                showFile(URL_FILE)
Esempio n. 17
0
 def streamAuto(self, playMode, siteName, function):
     logger.info('auto stream initiated')
     self.dialog = xbmcgui.DialogProgress()
     self.dialog.create('xStream',"get stream/hoster")
     #load site as plugin and run the function
     self.dialog.update(5,'import plugin...')
     plugin = __import__(siteName, globals(), locals())
     function = getattr(plugin, function)
     self.dialog.update(10,'catch links...')
     siteResult = function()
     if not siteResult:
         self.dialog.close()
         cGui().showInfo('xStream','stream/hoster not available')
         return False
     # if result is not a list, make in one
     if not type(siteResult) is list:
         temp = []
         temp.append(siteResult)
         siteResult = temp
     # field "name" marks hosters
     if 'name' in siteResult[0]:
         self.dialog.update(90,'prepare hosterlist..')
         functionName = siteResult[-1]
         del siteResult[-1]
         hosters = self.__getPriorities(siteResult)
         if not hosters:
             self.dialog.close()
             cGui().showInfo('xStream','no supported hoster available')
             return False
         if len(siteResult) > self.maxHoster:
             siteResult = siteResult[:self.maxHoster-1]
         check = False
         self.dialog.create('xStream','try hosters...')
         total = len(hosters)
         for count, hoster in enumerate(hosters):
             if self.dialog.iscanceled() or xbmc.abortRequested or check: return
             percent = (count+1)*100/total
             try:
                 logger.info('try hoster %s' % hoster['name'])
                 self.dialog.create('xStream','try hosters...')
                 self.dialog.update(percent,'try hoster %s' % hoster['name'])
                 # get stream links
                 function = getattr(plugin, functionName)
                 siteResult = function(hoster['link'])
                 check = self.__autoEnqueue(siteResult, playMode)
                 if check:
                     return True
             except:
                 self.dialog.update(percent,'hoster %s failed' % hoster['name'])
                 logger.info('playback with hoster %s failed' % hoster['name'])
     # field "resolved" marks streamlinks
     elif 'resolved' in siteResult[0]:
         for stream in siteResult:
             try:
                 if self.__autoEnqueue(siteResult, playMode):
                     self.dialog.close()
                     return True
             except:
                 pass
 def __getMediaLinkForGuest(self):
     
     if xbmcaddon.Addon('plugin.video.youtube'):
         videoID = self.__sUrl
         api_call = 'plugin://plugin.video.youtube/?action=play_video&videoid='+videoID
         return True, api_call
     else:
         cGui().showInfo(self.__sDisplayName, 'Vous devez installer l\'addon video youtube' , 5)
         return False, False
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    
    oGui = cGui()
    __createMainMenuItem(oGui, 'Filme', '', 'showMovieMenu')
    __createMainMenuItem(oGui, 'Serien', '', 'showSeriesMenu')
    __createMainMenuItem(oGui, 'Suche', '', 'showSearch')
    oGui.setEndOfDirectory()
def ProtectstreamBypass(url):
    
    #lien commencant par VID_
    Codedurl = url
    oRequestHandler = cRequestHandler(Codedurl)
    sHtmlContent = oRequestHandler.request()
    
    oParser = cParser()
    sPattern = 'var k=\"([^<>\"]*?)\";'
    aResult = oParser.parse(sHtmlContent, sPattern)
    
    if (aResult[0] == True):
        
        cGui().showInfo("Patientez", 'Decodage en cours' , 5)
        xbmc.sleep(5000)
        
        UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0'
        headers = {'User-Agent': UA ,
                   'Host' : 'www.protect-stream.com',
                   'Referer': Codedurl ,
                   'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
                   #'Accept-Encoding' : 'gzip, deflate',
                   #'Accept-Language' : 'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3',
                   'Content-Type': 'application/x-www-form-urlencoded'}
                   
        postdata = urllib.urlencode( { 'k': aResult[1][0] } )
        
        req = urllib2.Request('http://www.protect-stream.com/secur2.php',postdata,headers)
        try:
            response = urllib2.urlopen(req)
        except urllib2.URLError, e:
            print e.read()
            print e.reason
            
        data = response.read()
        response.close()
        
        #Test de fonctionnement
        aResult = oParser.parse(data, sPattern)
        if aResult[0]:
            cGui().showInfo("Erreur", 'Lien encore protege' , 5) 
            return ''
        
        #recherche du lien embed
        sPattern = '<iframe src=["\']([^<>"\']+?)["\']'
        aResult = oParser.parse(data, sPattern)
        if (aResult[0] == True):
            return aResult[1][0]
            
        #recherche d'un lien redirigee
        sPattern = '<a class=.button. href=["\']([^<>"\']+?)["\'] target=._blank.>'
        aResult = oParser.parse(data, sPattern)
        if (aResult[0] == True):
            return aResult[1][0]        
Esempio n. 21
0
    def getMediaLink(self):

        self.oPremiumHandler = cPremiumHandler(self.getPluginIdentifier())
        print self.oPremiumHandler.isPremiumModeAvailable()

        if (not self.oPremiumHandler.isPremiumModeAvailable()):
            oDialog = cConfig().createDialogOK('ATTENTION, Pas de streaming sans premium.')
            return False,False

        cGui().showInfo('Resolve', self.__sDisplayName, 5)

        return self.__getMediaLinkByPremiumUser()
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    
    oGui = cGui()
    __createMenuEntry(oGui, 'showMovieEntries', 'Aktuelle Kinofilme', URL_CINEMA, 1)
    __createMenuEntry(oGui, 'showMovieEntries', 'Neue Filme', URL_NEW, 1)
    __createMenuEntry(oGui, 'showMovieEntries', 'Blockbuster', URL_BLOCKBUSTER, 1)
    __createMenuEntry(oGui, 'showAllMovies', 'Filme A-Z', URL_ALL)
    __createMenuEntry(oGui, 'showGenre', 'Genre', URL_MAIN)
    __createMenuEntry(oGui, 'showSearch', 'Suche', URL_MAIN)
    oGui.setEndOfDirectory()
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    
    oGui = cGui()
    __createMainMenuItem(oGui, 'Aktuell', 'aktuell')    
    __createMainMenuItem(oGui, 'Spieltag', 'spieltag')
    __createMainMenuItem(oGui, 'Stars', 'stars')
    __createMainMenuItem(oGui, 'Insider', 'insider')
    __createMainMenuItem(oGui, 'Historie', 'historie')
    __createMainMenuItem(oGui, 'Vereine', 'vereine')
    oGui.setEndOfDirectory()
def load():    
        
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    
    oGui = cGui()
    __createMainMenuItem(oGui, 'Neuste Videos', 'listVideos', 'playlistId', '0_65ltkg6t')
    __createMainMenuItem(oGui, 'Meist gesehende', 'listVideos', 'playlistId', '0_mmdxlq9n')
    __createMainMenuItem(oGui, 'Highlights - alle', 'listHighlights', 'urlPart', '1_Highlights>Alle')
    __createMainMenuItem(oGui, 'Highlights - Daily Zap', 'listHighlights', 'urlPart', '1_Highlights>Daily Zap')
    __createMainMenuItem(oGui, 'Highlights - Mavericks', 'listHighlights', 'urlPart', '1_Highlights>Mavericks')

    oGui.setEndOfDirectory()
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    
    oGui = cGui()
    __createMainMenuItem(oGui, 'Letzte Updates (Alle)', URL_UPDATES_ALL, 'listVideos', 'Letzte Updates')
    __createMainMenuItem(oGui, 'Letzte Updates (HD)', URL_UPDATES_HD, 'listVideos', 'Letzte Updates')
    __createMainMenuItem(oGui, 'User Top 10', URL_UPDATES_ALL, 'listVideos', 'User Top 10')
    __createMainMenuItem(oGui, 'Archive', URL_ARCHIV, 'showCharacters')
    __createMainMenuItem(oGui, 'Suche', URL_SEARCH, 'showSearch')

    oGui.setEndOfDirectory()
Esempio n. 26
0
def get_response(img,cookie):    
    
    #on telecharge l'image
    filename  = os.path.join(PathCache,'Captcha.png')

    headers2 = {
        'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0',
        #'Referer' : url ,
        'Host' : 'www.dl-protect.com',
        'Accept' : 'image/png,image/*;q=0.8,*/*;q=0.5',
        'Accept-Language': 'en-gb, en;q=0.9',
        'Accept-Encoding' : 'gzip, deflate',
        'Content-Type' : 'application/x-www-form-urlencoded',
        'Cookie' : cookie
        }
        
    try:
        req = urllib2.Request(img,None,headers2)
        image_on_web = urllib2.urlopen(req)
        if image_on_web.headers.maintype == 'image':
            buf = image_on_web.read()
            downloaded_image = file(filename, "wb")
            downloaded_image.write(buf)
            downloaded_image.close()
            image_on_web.close()
        else:
            return ''
    except:
        return ''

    #on affiche le dialogue
    solution = ''
    try:
        img = xbmcgui.ControlImage(450, 0, 400, 130, filename)
        wdlg = xbmcgui.WindowDialog()
        wdlg.addControl(img)
        wdlg.show()
        #xbmc.sleep(3000)
        kb = xbmc.Keyboard('', 'Tapez les Lettres/chiffres de l\'image', False)
        kb.doModal()
        if (kb.isConfirmed()):
            solution = kb.getText()
            if solution == '':
                cGui().showInfo("Erreur", 'Vous devez taper le captcha' , 4)
        else:
            cGui().showInfo("Erreur", 'Vous devez taper le captcha' , 4)
    finally:
        wdlg.removeControl(img)
        wdlg.close()
        
    return solution
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    
    oGui = cGui()
    __createMainMenuItem(oGui, 'Neuste Videos', 'listVideos', 'latest')
    __createMainMenuItem(oGui, 'Meist gesehende Videos', 'listVideos', 'views')
    __createMainMenuItem(oGui, 'Beste Bewertungs Videos', 'listVideos', 'rating')
    __createMainMenuItem(oGui, 'Shows', 'showShows')
    __createMainMenuItem(oGui, 'Charts', 'showCharts')
    __createMainMenuItem(oGui, 'VideoCharts', 'showVideoCharts')
    __createMainMenuItem(oGui, 'Suche', 'showSearch')
    oGui.setEndOfDirectory()
Esempio n. 28
0
    def __getMediaLinkForGuest(self):
        cGui().showInfo('Resolve', self.__sDisplayName, 5)
        
        oRequest = cRequestHandler(self.__sUrl)
        sHtmlContent = oRequest.request()
        
        sPattern =  "file': '(.+?)',"
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0] == True):
            return True, aResult[1][0]
        
        return False, False
def load():
    
    cGui().showInfo('HS', SITE_NAME, 5)
    return False
    oGui = cGui()

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', URL_MAIN)
    __createMenuEntry(oGui, 'showAnimesAlphabetic', 'Animes von A - Z', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', URL_MAIN)
    __createMenuEntry(oGui, 'showCurrentMovies', 'Aktuelle Anime Folgen', oOutputParameterHandler)

    oGui.setEndOfDirectory()
Esempio n. 30
0
 def __getMediaLinkForGuest(self):
     
     oRequest = cRequestHandler(self.__sUrl)
     sHtmlContent = oRequest.request()
     
     if (self.stream):
         api_call = self.GetMedialinkStreaming(sHtmlContent)
     else:
         api_call = self.GetMedialinkDL(sHtmlContent)
         
     if api_call:
         return True, api_call
         
     cGui().showInfo(self.__sDisplayName, 'Fichier introuvable' , 5)
     return False, False
def showMovies(sSearch=''):
    oGui = cGui()

    ifVSlog('Filmstoon:#')
    ifVSlog('Filmstoon:showMovies')

    if sSearch:
        #'?s='
        pdata = 'do=search&subaction=search&story=' + sSearch
        sUrl = URL_MAIN + '?s=' + sSearch
        oRequest = cRequestHandler(sUrl)
        oRequest.setRequestType(1)
        oRequest.addHeaderEntry(
            'User-Agent',
            'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:70.0) Gecko/20100101 Firefox/70.0'
        )
        oRequest.addHeaderEntry('Referer', sUrl)
        oRequest.addParametersLine(pdata)
        sHtmlContent = oRequest.request()
        #url thumb tile desc
        sPattern = '<a class="sres-wrap.+?ref="([^"]*).+?data-src="([^"]*).+?alt="([^"]*).+?desc">([^<]*)'
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')
        oRequestHandler = cRequestHandler(sUrl)

        timestart = int(time.time())
        sHtmlContent = oRequestHandler.request()
        timestop = int(time.time())
        timespan = timestop - timestart
        ifVSlog('Filmstoon:time request-response : ' + str(timespan))

        ##url  title thumb desc
        sPattern = '<h2> <span>Film Streaming.+?href="(.+?)">(.+?)<.+?data-src="(.+?)".+?st-desc">(.+?)<.div'

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

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)
        ifVSlog(sHtmlContent)
        ifVSlog('')
        ifVSlog('Filmstoon:Failed Pattern with url = ' + sUrl)
        ifVSlog('Filmstoon:Selected Pattern = ' + sPattern)

    if (aResult[0] == True):
        total = len(aResult[1])

        for aEntry in aResult[1]:
            sUrl = aEntry[0]
            sDesc = aEntry[3]
            if sSearch:
                sTitle = aEntry[2]
                sThumb = aEntry[1]
            else:
                sTitle = aEntry[1]
                sThumb = aEntry[2]
            ifVSlog('Filmstoon:sUrl2 =' + sUrl)
            #ifVSlog('sThumb =' +sThumb)
            ifVSlog('Filmstoon:sTitle =' + sTitle)
            #ifVSlog('sDesc =' + sDesc )
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sDesc', sDesc)
            oGui.addMovie(SITE_IDENTIFIER, 'showHosters', sTitle, '', sThumb,
                          sDesc, oOutputParameterHandler)

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

        oGui.setEndOfDirectory()
Esempio n. 32
0
def isGui(sSiteName, sFunction):
    if (sSiteName == 'cGui'):
        oGui = cGui()
        exec "oGui." + sFunction + "()"
        return True
    return False
Esempio n. 33
0
def showMovies(sSearch=''):

    oGui = cGui()
    oParser = cParser()

    bSearchMovie = False
    bSearchSerie = False

    if sSearch:
        sUrl = URL_SEARCH[0]  # sert a rien
        sSearch = sSearch.replace(' ', '+').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

        pdata = 'do=search&subaction=search&search_start=0&full_search=0&result_from=1&story=' + sSearch
        oRequest = cRequestHandler(URL_SEARCH[0])
        oRequest.setRequestType(1)
        oRequest.addHeaderEntry('Referer', URL_MAIN)
        oRequest.addHeaderEntry(
            'Accept',
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
        oRequest.addHeaderEntry('Accept-Language',
                                'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
        oRequest.addHeaderEntry('Content-Type',
                                'application/x-www-form-urlencoded')
        oRequest.addParametersLine(pdata)
        sHtmlContent = oRequest.request()

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

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

    # ref thum title yeras
    sPattern = 'class="th-item".+?.+?ref="([^"]*).+?src="([^"]*).+?alt="([^"]*).+?Date.+?<.span>([^<]+)'

    aResult = oParser.parse(sHtmlContent, sPattern)

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

    if (aResult[0] == True):

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

            sUrl2 = aEntry[0]
            sThumb = aEntry[1]
            sTitle = aEntry[2]
            sYear = aEntry[3].strip()

            if bSearchMovie:
                if '/serie' in sUrl2:
                    continue
            if bSearchSerie:
                if not '/serie' in sUrl2:
                    continue

            sDisplayTitle = sTitle
            if sSearch and not bSearchMovie and not bSearchSerie:
                if '/serie' in sUrl2:
                    sDisplayTitle = sDisplayTitle + ' [serie]'
                else:
                    sDisplayTitle = sDisplayTitle + ' [film]'

            #VSlog(sUrl2 );VSlog(sTitle);VSlog(sThumb );VSlog(sYear  )

            sDisplayTitle = sDisplayTitle + ' (' + sYear + ')'
            if 'http' not in sThumb:
                sThumb = URL_MAIN[:-1] + sThumb

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

            if '/series' not in sUrl2:
                oGui.addMovie(SITE_IDENTIFIER, 'showMovieLinks', sDisplayTitle,
                              '', sThumb, '', oOutputParameterHandler)
            else:
                oGui.addTV(SITE_IDENTIFIER, 'showSaisons', sDisplayTitle, '',
                           sThumb, '', oOutputParameterHandler)

        progress_.VSclose(progress_)

    if not sSearch:
        bNextPage, urlNextpage, pagination = __checkForNextPage(sHtmlContent)
        if (bNextPage != False):
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', urlNextpage)
            oGui.addNext(SITE_IDENTIFIER, 'showMovies',
                         '[COLOR teal] ' + pagination + ' >>>[/COLOR]',
                         oOutputParameterHandler)

        oGui.setEndOfDirectory()
Esempio n. 34
0
def load():
    oGui = cGui()

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', API_URL + '/movie/popular')
    oGui.addDir(SITE_IDENTIFIER, 'showMovies', 'Films Populaires',
                'comments.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl',
                                         API_URL + '/movie/now_playing')
    oGui.addDir(SITE_IDENTIFIER, 'showMovies', 'Films en salle', 'films.png',
                oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl',
                                         API_URL + '/movie/top_rated')
    oGui.addDir(SITE_IDENTIFIER, 'showMovies', 'Films les mieux notés',
                'notes.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl',
                                         API_URL + '/genre/movie/list')
    oGui.addDir(SITE_IDENTIFIER, 'showGenreMovie', 'Films Genres',
                'genres.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', API_URL + '/tv/popular')
    oGui.addDir(SITE_IDENTIFIER, 'showSeries', 'Séries Populaires',
                'series.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', API_URL + '/tv/on_the_air')
    oGui.addDir(SITE_IDENTIFIER, 'showSeries', 'Séries a la tv', 'series.png',
                oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', API_URL + '/tv/top_rated')
    oGui.addDir(SITE_IDENTIFIER, 'showSeries', 'Séries les mieux notés',
                'series.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', API_URL + '/genre/tv/list')
    oGui.addDir(SITE_IDENTIFIER, 'showGenreTV', 'Séries Genres', 'genres.png',
                oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl',
                                         API_URL + '/person/popular')
    oGui.addDir(SITE_IDENTIFIER, 'showActors', 'Acteurs Populaires',
                'films.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', API_URL + '/search/movie')
    oGui.addDir(SITE_IDENTIFIER, 'showSearchMovie', 'Recherche de film',
                'films.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', API_URL + '/search/tv')
    oGui.addDir(SITE_IDENTIFIER, 'showSearchSerie', 'Recherche de serie',
                'series.png', oOutputParameterHandler)

    oGui.setEndOfDirectory()
Esempio n. 35
0
def showSeriesEpisode():

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

    sSeason = oInputParameterHandler.getValue('sSeason')
    #sId = oInputParameterHandler.getValue('sId')
    if sSeason == False:
        sSeason = sUrl.split('/')[-1]

    if sFanart == False:
        sFanart = ''

    oGui = cGui()

    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.addParameters('api_key', API_KEY)
    oRequestHandler.addParameters('language', 'fr')

    sHtmlContent = oRequestHandler.request()
    result = json.loads(sHtmlContent)

    total = len(sHtmlContent)
    #print result['results']
    if (total > 0):
        for i in result['episodes']:

            #sId, sTitle, sOtitle, sThumbnail, sFanart = i['id'], i['name'], i['original_name'], i['poster_path'], i['backdrop_path']
            sdate, sIdEp, sEpNumber, sName, sThumbnail, SResume = i[
                'air_date'], i['id'], i['episode_number'], i['name'], i[
                    'still_path'], i['overview']

            sName = sName.encode("utf-8")
            if sName == '':
                sName = sMovieTitle

            if sThumbnail:
                sThumbnail = POSTER_URL + sThumbnail
            else:
                sThumbnail = ''

            sTitle = '[COLOR coral]S' + sSeason + 'E' + str(
                sEpNumber) + '[/COLOR] - ' + sName

            sExtraTitle = ' S' + "%02d" % int(sSeason) + 'E' + "%02d" % int(
                sEpNumber)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter(
                'siteUrl',
                sMovieTitle + '|' + sExtraTitle)  #Pour compatibilite Favoris
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
            #oOutputParameterHandler.addParameter('sSeason', sSeason)
            #oOutputParameterHandler.addParameter('sEpisode', str(sEpNumber))

            oGui.addTVDB(SITE_IDENTIFIER, 'showHosters', sTitle, 'series.png',
                         sThumbnail, sFanart, oOutputParameterHandler)

    #test pr chnagement mode
    xbmc.executebuiltin('Container.SetViewMode(50)')

    oGui.setEndOfDirectory()
Esempio n. 36
0
def showSeriesEpisode():
    grab = cTMDb()
    addons = addon()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sFanart = oInputParameterHandler.getValue('sFanart')
    sTmdbId = oInputParameterHandler.getValue('sTmdbId')

    sSeason = oInputParameterHandler.getValue('sSeason')
    # sId = oInputParameterHandler.getValue('sId')
    if sSeason == False:
        sSeason = sUrl.split('/')[-1]

    if sFanart == False:
        sFanart = ''

    oGui = cGui()

    # recherche saison complete
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', sMovieTitle)
    # oOutputParameterHandler.addParameter('type', 'serie')
    search = '%s S%02d' % (sMovieTitle, int(sSeason))
    # oOutputParameterHandler.addParameter('searchtext', search)

    if not isMatrix():
        oOutputParameterHandler.addParameter('searchtext',
                                             cUtil().CleanName(search))
    else:
        oOutputParameterHandler.addParameter('searchtext', search)

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName('globalSearch')
    oGuiElement.setFunction('searchMovie')
    oGuiElement.setTitle(addons.VSlang(30415))
    oGuiElement.setCat(2)
    oGuiElement.setIcon("searchtmdb.png")
    oGui.addFolder(oGuiElement, oOutputParameterHandler)

    result = grab.getUrl(sUrl)

    total = len(result)
    if (total > 0 and 'episodes' in result):
        total = len(result['episodes'])
        progress_ = progress().VScreate(SITE_NAME)

        for i in result['episodes']:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            # sId, sTitle, sOtitle, sThumb, sFanart = i['id'], i['name'], i['original_name'], i['poster_path'], i['backdrop_path']
            sEpNumber = i['episode_number']

            # Mise en forme des infos (au format meta imdb)
            i = grab._format(i, '')
            sTitle, sGenre, sThumb, sFanart, sDesc, sYear = i['title'], i[
                'genre'], i['cover_url'], i['backdrop_url'], i['plot'], i[
                    'year']

            if not isMatrix():
                sTitle = sTitle.encode("utf-8")

            sTitle = 'S%s E%s %s' % (sSeason, str(sEpNumber), sTitle)

            sExtraTitle = ' S' + "%02d" % int(sSeason) + 'E' + "%02d" % int(
                sEpNumber)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter(
                'siteUrl',
                sMovieTitle + '|' + sExtraTitle)  #Pour compatibilite Favoris
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sTmdbId', sTmdbId)
            oOutputParameterHandler.addParameter('sSeason', sSeason)
            oOutputParameterHandler.addParameter('sEpisode', sEpNumber)
            oOutputParameterHandler.addParameter('type', 'serie')

            if not isMatrix():
                oOutputParameterHandler.addParameter(
                    'searchtext',
                    cUtil().CleanName(sMovieTitle))
            else:
                oOutputParameterHandler.addParameter('searchtext', sMovieTitle)

            cGui.CONTENT = "tvshows"
            oGuiElement = cGuiElement()
            oGuiElement.setTmdbId(sTmdbId)
            oGuiElement.setSiteName('globalSearch')
            oGuiElement.setFunction('showSearch')
            oGuiElement.setTitle(sTitle)
            oGuiElement.setFileName(sMovieTitle)
            oGuiElement.setIcon('series.png')
            oGuiElement.setMeta(2)
            oGuiElement.setThumbnail(sThumb)
            oGuiElement.setFanart(sFanart)
            oGuiElement.setCat(2)
            oGuiElement.setDescription(sDesc)
            oGuiElement.setYear(sYear)
            oGuiElement.setGenre(sGenre)

            oGui.addFolder(oGuiElement, oOutputParameterHandler)

        progress_.VSclose(progress_)

    # tchnagement mode
    view = addons.getSetting('visuel-view')
    oGui.setEndOfDirectory(view)
Esempio n. 37
0
def showActors(sSearch=''):
    oGui = cGui()
    grab = cTMDb()
    addons = addon()

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

    iPage = 1
    if (oInputParameterHandler.exist('page')):
        iPage = oInputParameterHandler.getValue('page')

    if (oInputParameterHandler.exist('sSearch')):
        sSearch = oInputParameterHandler.getValue('sSearch')

    if sSearch:
        #format obligatoire evite de modif le format de l'url dans la lib >> _call
        #a cause d'un ? pas ou il faut pour ça >> invalid api key
        result = grab.getUrl(sUrl, iPage, 'query=' + sSearch)

    else:
        result = grab.getUrl(sUrl, iPage)

    total = len(result)

    if (total > 0):
        total = len(result['results'])
        progress_ = progress().VScreate(SITE_NAME)

        # récup le nombre de page pour NextPage
        nbrpage = result['total_pages']

        for i in result['results']:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sName, sThumb = i['name'], i['profile_path']

            if sThumb:
                POSTER_URL = grab.poster
                sThumb = POSTER_URL + sThumb
            else:
                sThumb = ''

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

            if not isMatrix():
                sName = sName.encode('utf-8')

            oOutputParameterHandler.addParameter(
                'siteUrl', 'person/' + str(i['id']) + '/movie_credits')
            sTitle = str(sName)

            oGuiElement = cGuiElement()
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setFunction('showFilmActor')
            oGuiElement.setTitle(sTitle)
            oGuiElement.setFileName(sName)
            oGuiElement.setIcon('actors.png')
            oGuiElement.setMeta(0)
            oGuiElement.setThumbnail(sThumb)
            oGuiElement.setPoster(sThumb)
            oGuiElement.setCat(7)

            oGui.addFolder(oGuiElement, oOutputParameterHandler)

        progress_.VSclose(progress_)

        if (int(iPage) < int(nbrpage)):
            iNextPage = int(iPage) + 1
            oOutputParameterHandler = cOutputParameterHandler()

            # ajoute param sSearch pour garder le bon format d'url avec grab url
            if sSearch:
                oOutputParameterHandler.addParameter('sSearch', sSearch)

            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('page', iNextPage)
            oGui.addNext(SITE_IDENTIFIER, 'showActors',
                         '[COLOR teal]Page ' + str(iNextPage) + ' >>>[/COLOR]',
                         oOutputParameterHandler)

    view = addons.getSetting('visuel-view')

    oGui.setEndOfDirectory(view)
Esempio n. 38
0
def showSeries(sSearch=''):
    grab = cTMDb()
    addons = addon()

    oInputParameterHandler = cInputParameterHandler()

    iPage = 1
    term = ''
    if (oInputParameterHandler.exist('page')):
        iPage = oInputParameterHandler.getValue('page')

    if (oInputParameterHandler.exist('sSearch')):
        sSearch = oInputParameterHandler.getValue('sSearch')

    if sSearch:
        result = grab.getUrl('search/tv', iPage, 'query=' + sSearch)
        sUrl = ''

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

        if (oInputParameterHandler.exist('genre')):
            term = 'with_genres=' + oInputParameterHandler.getValue('genre')

        if (oInputParameterHandler.exist('session_id')):
            term += 'session_id=' + oInputParameterHandler.getValue(
                'session_id')

        result = grab.getUrl(sUrl, iPage, term)

    oGui = cGui()

    try:
        total = len(result)

        if (total > 0):
            total = len(result['results'])
            progress_ = progress().VScreate(SITE_NAME)

            for i in result['results']:
                progress_.VSupdate(progress_, total)
                if progress_.iscanceled():
                    break

                # Mise en forme des infos (au format meta imdb)
                i = grab._format(i, '')
                sId, sTitle, sGenre, sThumb, sFanart, sDesc, sYear = i[
                    'tmdb_id'], i['title'], i['genre'], i['cover_url'], i[
                        'backdrop_url'], i['plot'], i['year']

                if not isMatrix():
                    sTitle = sTitle.encode("utf-8")

                sSiteUrl = 'tv/' + str(sId)

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', sSiteUrl)
                oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
                oOutputParameterHandler.addParameter('sThumb', sThumb)
                oOutputParameterHandler.addParameter('sId', sId)
                oOutputParameterHandler.addParameter('sFanart', sFanart)
                oOutputParameterHandler.addParameter('sTmdbId', sId)

                if isMatrix():
                    oOutputParameterHandler.addParameter('searchtext', sTitle)
                else:
                    oOutputParameterHandler.addParameter(
                        'searchtext',
                        cUtil().CleanName(sTitle))

                cGui.CONTENT = "tvshows"
                oGuiElement = cGuiElement()
                oGuiElement.setTmdbId(sId)
                oGuiElement.setSiteName(
                    SITE_IDENTIFIER)  # a activer pour  saisons
                oGuiElement.setFunction('showSeriesSaison')
                oGuiElement.setTitle(sTitle)
                oGuiElement.setFileName(sTitle)
                oGuiElement.setIcon('series.png')
                oGuiElement.setMeta(2)
                oGuiElement.setThumbnail(sThumb)
                oGuiElement.setPoster(sThumb)
                oGuiElement.setFanart(sFanart)
                oGuiElement.setCat(2)
                oGuiElement.setDescription(sDesc)
                oGuiElement.setYear(sYear)
                oGuiElement.setGenre(sGenre)

                oGui.addFolder(oGuiElement, oOutputParameterHandler)

            progress_.VSclose(progress_)

            if (iPage > 0):
                iNextPage = int(iPage) + 1
                oOutputParameterHandler = cOutputParameterHandler()
                if sSearch:
                    oOutputParameterHandler.addParameter('sSearch', sSearch)
                oOutputParameterHandler.addParameter('siteUrl', sUrl)
                oOutputParameterHandler.addParameter('page', iNextPage)
                if (oInputParameterHandler.exist('genre')):
                    oOutputParameterHandler.addParameter(
                        'genre', oInputParameterHandler.getValue('genre'))
                oGui.addNext(
                    SITE_IDENTIFIER, 'showSeries',
                    '[COLOR teal]Page ' + str(iNextPage) + ' >>>[/COLOR]',
                    oOutputParameterHandler)

    except TypeError:
        oGui.addText(SITE_IDENTIFIER,
                     '[COLOR red]Aucun résultat n\'a été trouvé.[/COLOR]')

    # changement mode
    view = addons.getSetting('visuel-view')

    oGui.setEndOfDirectory(view)
Esempio n. 39
0
def showSeriesSaison():
    oGui = cGui()
    grab = cTMDb()
    addons = addon()

    oInputParameterHandler = cInputParameterHandler()

    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sFanart = oInputParameterHandler.getValue('sFanart')
    sTmdbId = oInputParameterHandler.getValue('sTmdbId')
    sId = oInputParameterHandler.getValue('sId')

    if sId == False:
        sId = sUrl.split('/')[-1]

    if sFanart == False:
        sFanart = ''

    # recherche la serie complete
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', sMovieTitle)
    # oOutputParameterHandler.addParameter('type', 'serie')
    # oOutputParameterHandler.addParameter('searchtext', sMovieTitle)
    if not isMatrix():
        oOutputParameterHandler.addParameter('searchtext',
                                             cUtil().CleanName(sMovieTitle))
    else:
        oOutputParameterHandler.addParameter('searchtext', sMovieTitle)

    oGuiElement = cGuiElement()
    oGuiElement.setSiteName('globalSearch')
    oGuiElement.setFunction('searchMovie')
    oGuiElement.setTitle(addons.VSlang(30414))
    oGuiElement.setCat(2)
    oGuiElement.setIcon("searchtmdb.png")
    oGui.addFolder(oGuiElement, oOutputParameterHandler)

    result = grab.getUrl(sUrl)
    total = len(result)
    if (total > 0):
        total = len(result['seasons'])
        progress_ = progress().VScreate(SITE_NAME)

        for i in result['seasons']:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            sNbreEp, SSeasonNum = i['episode_count'], i['season_number']

            # Mise en forme des infos (au format meta imdb)
            i = grab._format(i, '')
            sTitle, sGenre, sThumb, sFanart, sDesc, sYear = i['title'], i[
                'genre'], i['cover_url'], i['backdrop_url'], i['plot'], i[
                    'year']

            sTitle = 'Saison ' + str(SSeasonNum) + ' (' + str(sNbreEp) + ')'

            sUrl = 'tv/' + str(sId) + '/season/' + str(SSeasonNum)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sId', sId)
            oOutputParameterHandler.addParameter('sSeason', SSeasonNum)
            oOutputParameterHandler.addParameter('sFanart', sFanart)
            oOutputParameterHandler.addParameter('sTmdbId', sTmdbId)

            cGui.CONTENT = "tvshows"
            oGuiElement = cGuiElement()
            oGuiElement.setTmdbId(sTmdbId)
            oGuiElement.setSiteName(SITE_IDENTIFIER)
            oGuiElement.setFunction('showSeriesEpisode')
            oGuiElement.setTitle(sTitle)
            oGuiElement.setFileName(sMovieTitle)
            oGuiElement.setIcon('series.png')
            oGuiElement.setMeta(2)
            oGuiElement.setThumbnail(sThumb)
            oGuiElement.setPoster(sThumb)
            oGuiElement.setFanart(sFanart)
            oGuiElement.setCat(7)
            oGuiElement.setDescription(sDesc)
            oGuiElement.setYear(sYear)
            oGuiElement.setGenre(sGenre)

            oGui.addFolder(oGuiElement, oOutputParameterHandler)

        progress_.VSclose(progress_)

    # changement mode
    view = addons.getSetting('visuel-view')

    oGui.setEndOfDirectory(view)
Esempio n. 40
0
def load():
    oGui = cGui()
    addons = addon()

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'http://')
    oGui.addDir(SITE_IDENTIFIER, 'showSearch',
                '%s (TMDB)' % addons.VSlang(30330), 'search.png',
                oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'movie/popular')
    oGui.addDir(SITE_IDENTIFIER, 'showMovies', addons.VSlang(30425),
                'comments.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'movie/now_playing')
    oGui.addDir(SITE_IDENTIFIER, 'showMovies', addons.VSlang(30426),
                'films.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'movie/top_rated')
    oGui.addDir(SITE_IDENTIFIER, 'showMovies', addons.VSlang(30427),
                'notes.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'genre/movie/list')
    oGui.addDir(SITE_IDENTIFIER, 'showGenreMovie', addons.VSlang(30428),
                'genres.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'tv/popular')
    oGui.addDir(SITE_IDENTIFIER, 'showSeries', addons.VSlang(30429),
                'comments.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'tv/on_the_air')
    oGui.addDir(SITE_IDENTIFIER, 'showSeries', addons.VSlang(30430),
                'series.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'tv/top_rated')
    oGui.addDir(SITE_IDENTIFIER, 'showSeries', addons.VSlang(30431),
                'notes.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'genre/tv/list')
    oGui.addDir(SITE_IDENTIFIER, 'showGenreTV', addons.VSlang(30432),
                'genres.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'person/popular')
    oGui.addDir(SITE_IDENTIFIER, 'showActors', addons.VSlang(30433),
                'actor.png', oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'http://')
    oGui.addDir('topimdb', 'load', 'Top Imdb', 'star.png',
                oOutputParameterHandler)

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', 'http://')
    oGui.addDir(SITE_IDENTIFIER, 'showFolderList', 'Listes TMDB', 'listes.png',
                oOutputParameterHandler)

    oGui.setEndOfDirectory()
Esempio n. 41
0
def showMyTmdb():
    oGui = cGui()
    grab = cTMDb()
    addons = addon()

    tmdb_session = addons.getSetting('tmdb_session')
    if tmdb_session == '':
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', 'https://')
        oGui.addDir(SITE_IDENTIFIER, 'getToken', addons.VSlang(30305),
                    'trakt.png', oOutputParameterHandler)
    else:
        # pas de deco possible avec l'api donc on test l'username sinon ont supprime tous
        result = grab.getUrl('account', '1', 'session_id=' + tmdb_session)

        if 'username' in result and result['username']:

            # pas de menu sans ID user c'est con
            addons.setSetting('tmdb_account', str(result['id']))

            sUsername = result['username']
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', 'https://')
            oGui.addText(SITE_IDENTIFIER, (addons.VSlang(30306)) % (sUsername))

            oOutputParameterHandler = cOutputParameterHandler()
            # /account/{account_id}/favorite/movies
            oOutputParameterHandler.addParameter('session_id', tmdb_session)
            oOutputParameterHandler.addParameter(
                'siteUrl', 'account/%s/favorite/movies' % int(result['id']))
            oGui.addDir(SITE_IDENTIFIER, 'showMovies', addons.VSlang(30434),
                        'films.png', oOutputParameterHandler)

            oOutputParameterHandler = cOutputParameterHandler()
            # /account/{account_id}/rated/movies
            oOutputParameterHandler.addParameter('session_id', tmdb_session)
            oOutputParameterHandler.addParameter(
                'siteUrl', 'account/%s/rated/movies' % int(result['id']))
            oGui.addDir(SITE_IDENTIFIER, 'showMovies', addons.VSlang(30435),
                        'notes.png', oOutputParameterHandler)

            oOutputParameterHandler = cOutputParameterHandler()
            # /account/{account_id}/watchlist/movies
            oOutputParameterHandler.addParameter('session_id', tmdb_session)
            oOutputParameterHandler.addParameter(
                'siteUrl', 'account/%s/watchlist/movies' % int(result['id']))
            oGui.addDir(SITE_IDENTIFIER, 'showMovies', addons.VSlang(30436),
                        'views.png', oOutputParameterHandler)

            oOutputParameterHandler = cOutputParameterHandler()
            # /account/{account_id}/favorite/tv
            oOutputParameterHandler.addParameter('session_id', tmdb_session)
            oOutputParameterHandler.addParameter(
                'siteUrl', 'account/%s/favorite/tv' % int(result['id']))
            oGui.addDir(SITE_IDENTIFIER, 'showSeries', addons.VSlang(30437),
                        'series.png', oOutputParameterHandler)

            oOutputParameterHandler = cOutputParameterHandler()
            # /account/{account_id}/rated/tv
            oOutputParameterHandler.addParameter('session_id', tmdb_session)
            oOutputParameterHandler.addParameter(
                'siteUrl', 'account/%s/rated/tv' % int(result['id']))
            oGui.addDir(SITE_IDENTIFIER, 'showSeries', addons.VSlang(30438),
                        'notes.png', oOutputParameterHandler)

            oOutputParameterHandler = cOutputParameterHandler()
            # /account/{account_id}/watchlist/tv
            oOutputParameterHandler.addParameter('session_id', tmdb_session)
            oOutputParameterHandler.addParameter(
                'siteUrl', 'account/%s/watchlist/tv' % int(result['id']))
            oGui.addDir(SITE_IDENTIFIER, 'showSeries', addons.VSlang(30440),
                        'views.png', oOutputParameterHandler)

            oOutputParameterHandler = cOutputParameterHandler()
            # /account/{account_id}/rated/tv/episodes
            oOutputParameterHandler.addParameter('session_id', tmdb_session)
            oOutputParameterHandler.addParameter(
                'siteUrl', 'account/%s/rated/tv/episodes' % int(result['id']))
            oGui.addDir(SITE_IDENTIFIER, 'showSeries', addons.VSlang(30439),
                        'notes.png', oOutputParameterHandler)

            oOutputParameterHandler = cOutputParameterHandler()
            # /account/{account_id}/lists
            oOutputParameterHandler.addParameter('session_id', tmdb_session)
            oOutputParameterHandler.addParameter(
                'siteUrl', 'account/%s/lists' % int(result['id']))
            oGui.addDir(SITE_IDENTIFIER, 'showUserLists', addons.VSlang(30441),
                        'listes.png', oOutputParameterHandler)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', 'http://')
            oGui.addDir(SITE_IDENTIFIER, 'ouTMyTmdb', addons.VSlang(30309),
                        'listes.png', oOutputParameterHandler)

        else:
            ouTMyTmdb()

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

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

    if "onaregarde" in sUrl:
        oParser = cParser()
        sPattern = '<a type="submit".+?href="([^"]+)"'
        sUrl = oParser.parse(sHtmlContent, sPattern)[1][0]

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

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

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

    # on recherche d'abord la qualité courante
    sPattern = 'smallsep.+?Qualité([^<]+)<.+?img src="([^"]+)".+?alt=.+?- Saison ([0-9]+)'
    aResult = oParser.parse(sHtmlContent, sPattern)

    sQual = ''
    sLang = ''
    if (aResult[1]):
        aEntry = aResult[1][0]
        sQual = aEntry[0].split('|')[0]
        sLang = aEntry[0].split('|')[1]
        sThumb = aEntry[
            1]  # change pour chaque saison, il faut la rechercher si on navigue entre saisons
        sTitle = sMovieTitle + ' S' + aEntry[2]

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

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

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

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

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

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

    # Affichage du texte
    if (aResult2[0] == True):
        oGui.addText(SITE_IDENTIFIER,
                     '[COLOR olive]Autres saisons disponibles :[/COLOR]')
        oOutputParameterHandler = cOutputParameterHandler()
        for aEntry in aResult2[1]:
            sSaison = aEntry[2].strip()
            if sSaison in saisons:
                continue
            saisons.append(sSaison)

            if 'animes' in sUrl:
                sUrl = URL_MAIN + 'animes' + aEntry[0]
            else:
                sUrl = URL_MAIN + 'telecharger-serie' + aEntry[0]

            sTitle = sMovieTitle + ' ' + aEntry[1] + aEntry[2]

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

    oGui.setEndOfDirectory()
Esempio n. 43
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')
    referer = oInputParameterHandler.getValue('referer')
    pdata = oInputParameterHandler.getValue('pdata')

    oRequest = cRequestHandler(sUrl)
    oRequest.setRequestType(1)
    oRequest.addHeaderEntry('User-Agent', UA)
    oRequest.addHeaderEntry('Referer', referer)
    oRequest.addHeaderEntry('Accept', '*/*')
    oRequest.addHeaderEntry('Accept-Language',
                            'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3')
    oRequest.addHeaderEntry('Content-Type',
                            'application/x-www-form-urlencoded')
    oRequest.addParametersLine(pdata)

    sHtmlContent = oRequest.request()
    # oParser = cParser()

    # 1
    sPattern = '(?:<iframe|<IFRAME).+?(?:src|SRC)=[\'|"]([^\'"|]+)'
    aResult1 = re.findall(sPattern, sHtmlContent)

    # 2
    sPattern = '<a href="([^"]+)">'
    aResult2 = re.findall(sPattern, sHtmlContent)

    # fusion
    aResult = aResult1 + aResult2

    if aResult:
        for aEntry in aResult:

            sHosterUrl = aEntry
            if 'zustreamv2/viplayer' in sHosterUrl:
                return

            if 're.zu-lien.com' in sHosterUrl:
                oRequestHandler = cRequestHandler(sHosterUrl)
                oRequestHandler.addHeaderEntry('User-Agent', UA)
                oRequestHandler.addHeaderEntry('Referer',
                                               'https://re.zu-lien.com')
                oRequestHandler.request()
                sUrl1 = oRequestHandler.getRealUrl()
                if not sUrl1 or sUrl1 == sHosterUrl:
                    opener = Noredirection()
                    opener.addheaders = [('User-Agent', UA)]
                    opener.addheaders = [('Referer', 'https://re.zu-lien.com')]
                    response = opener.open(sHosterUrl)
                    response.read()
                    getreal = sHosterUrl
                    if response.code == 302:
                        getreal = response.headers['Location']
                    response.close()
                    sHosterUrl = getreal
                else:
                    sHosterUrl = sUrl1

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

    oGui.setEndOfDirectory()
Esempio n. 44
0
def dummyFolder():
    oGui = cGui()
    oGui.setEndOfDirectory()
Esempio n. 45
0
def showMenuFilms():
    oGui = cGui()

    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', MOVIE_NEWS[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_NEWS[1], 'Films (Derniers ajouts)',
                'news.png', oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_EXCLUS[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_EXCLUS[1], 'Exclus (Films populaires)',
                'news.png', oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_HD[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_HD[1], 'Blu-rays (720p & 1080p)',
                'hd.png', oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_3D[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_3D[1], 'Films (3D)', 'news.png',
                oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_HDLIGHT[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_HDLIGHT[1], 'Films (x265 & x264)',
                'hd.png', oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_4K[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_4K[1], 'Films (4k)', 'hd.png',
                oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_GENRES[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_GENRES[1], 'Films (Genres)',
                'genres.png', oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_ANIME[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_ANIME[1],
                'Dessins Animés (Derniers ajouts)', 'animes.png',
                oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_BDRIP[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_BDRIP[1], 'Films (BDRIP)', 'news.png',
                oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_TS_CAM[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_TS_CAM[1],
                'Films (TS, CAM, R5, DVDSCR)', 'news.png',
                oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_VFSTFR[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_VFSTFR[1],
                'Films en francais sous titre francais (Derniers ajouts)',
                'news.png', oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_MKV[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_MKV[1], 'Films (dvdrip mkv)',
                'news.png', oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_VO[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_VO[1],
                'Films en Version original (Derniers ajouts)', 'news.png',
                oOutputParameterHandler)

    oOutputParameterHandler.addParameter('siteUrl', MOVIE_INTEGRAL[0])
    oGui.addDir(SITE_IDENTIFIER, MOVIE_INTEGRAL[1],
                'Intégral de films (Derniers ajouts)', 'news.png',
                oOutputParameterHandler)

    oGui.setEndOfDirectory()
Esempio n. 46
0
def showSearch():
    oGui = cGui()
    sSearchText = oGui.showKeyBoard()
    if not sSearchText: return
    _search(False, sSearchText)
    oGui.setEndOfDirectory()
Esempio n. 47
0
def showActors():
    oGui = cGui()

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

    iPage = 1
    if (oInputParameterHandler.exist('page')):
        iPage = oInputParameterHandler.getValue('page')

    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.addParameters('api_key', API_KEY)
    oRequestHandler.addParameters('language', 'fr')
    oRequestHandler.addParameters('page', iPage)

    sHtmlContent = oRequestHandler.request()
    result = json.loads(sHtmlContent)

    total = len(sHtmlContent)

    if (total > 0):
        for i in result['results']:
            #print i['name']
            sName, sThumbnail = i['name'], i['profile_path']

            if sThumbnail:
                sThumbnail = POSTER_URL + sThumbnail
            else:
                sThumbnail = ''

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', str(sUrl))
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))

            sName = sName.encode('utf-8')

            oOutputParameterHandler.addParameter(
                'siteUrl',
                API_URL + '/person/' + str(i['id']) + '/movie_credits')
            oGui.addMovieDB(SITE_IDENTIFIER, 'showFilmActor',
                            '[COLOR red]' + str(sName) + '[/COLOR]', '',
                            sThumbnail, '', oOutputParameterHandler)

            for e in i['known_for']:
                try:
                    sTitle = unicodedata.normalize('NFKD', e['title']).encode(
                        'ascii', 'ignore')

                except:
                    sTitle = "Aucune information"
                sId = e['id']
                try:
                    sFanart = FANART_URL + e['backdrop_path']
                except:
                    sFanart = ''

                try:
                    sThumbnail = POSTER_URL + e['poster_path']
                except:
                    sThumbnail = ''

                #sTitle = sTitle.encode("utf-8")

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', 'none')
                oOutputParameterHandler.addParameter('sMovieTitle',
                                                     str(sTitle))
                oOutputParameterHandler.addParameter('sTmdbId', i['id'])
                oOutputParameterHandler.addParameter('sThumbnail',
                                                     str(sThumbnail))

                oGui.addMovieDB(SITE_IDENTIFIER, 'showHosters', sTitle, '',
                                sThumbnail, sFanart, oOutputParameterHandler)

        if (iPage > 0):
            iNextPage = int(iPage) + 1
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('page', iNextPage)
            oGui.addDir(SITE_IDENTIFIER, 'showActors',
                        '[COLOR teal]Page ' + str(iNextPage) + ' >>>[/COLOR]',
                        'next.png', oOutputParameterHandler)

    oGui.setEndOfDirectory()
Esempio n. 48
0
def showGenres():
    oGui = cGui()
    liste = []
    liste.append(['Atlanta (Hawks)', URL_MAIN + 'category/nba/atlanta-hawks/'])
    liste.append(
        ['Boston (Celtics)', URL_MAIN + 'category/nba/boston-celtics/'])
    liste.append(['Brooklyn (Nets)', URL_MAIN + 'category/nba/brooklyn-nets/'])
    liste.append(
        ['Charlotte (Hornets)', URL_MAIN + 'category/nba/charlotte-hornets/'])
    liste.append(['Chicago (Bulls)', URL_MAIN + 'category/nba/chicago-bulls/'])
    liste.append([
        'Cleveland (Cavaliers)', URL_MAIN + 'category/nba/cleveland-cavaliers/'
    ])
    liste.append(
        ['Dallas (Mavericks)', URL_MAIN + 'category/nba/dallas-mavericks/'])
    liste.append(
        ['Denver (Nuggets)', URL_MAIN + 'category/nba/denver-nuggets/'])
    liste.append(
        ['Détroit (Pistons)', URL_MAIN + 'category/nba/detroit-pistons/'])
    liste.append([
        'Golden-state (Warriors)',
        URL_MAIN + 'category/nba/golden-state-warriors/'
    ])
    liste.append(
        ['Houston (Rockets)', URL_MAIN + 'category/nba/houston-rockets/'])
    liste.append(
        ['Indiana (Pacers)', URL_MAIN + 'category/nba/indiana-pacers/'])
    liste.append([
        'Los Angeles (Clippers)',
        URL_MAIN + 'category/nba/los-angeles-clippers/'
    ])
    liste.append([
        'Los Angeles (Lakers)', URL_MAIN + 'category/nba/los-angeles-lakers/'
    ])
    liste.append(
        ['Memphis (Grizzlies)', URL_MAIN + 'category/nba/memphis-grizzlies/'])
    liste.append(['Miami (Heat)', URL_MAIN + 'category/nba/miami-heat/'])
    liste.append(
        ['Milwaukee (Bucks)', URL_MAIN + 'category/nba/milwaukee-bucks/'])
    liste.append([
        'Minnesota (Timberwolves)',
        URL_MAIN + 'category/nba/minnesota-timberwolves/'
    ])
    liste.append([
        'New-Orléans (Pelicans)',
        URL_MAIN + 'category/nba/new-orleans-pelicans/'
    ])
    liste.append(
        ['New-York (Knicks)', URL_MAIN + 'category/nba/new-york-knicks/'])
    liste.append([
        'Oklahoma City (Thunder)',
        URL_MAIN + 'category/nba/oklahoma-city-thunder/'
    ])
    liste.append(['Orlando (Magic)', URL_MAIN + 'category/nba/orlando-magic/'])
    liste.append([
        'Philadelphia (79ers)', URL_MAIN + 'category/nba/philadelphia-76ers/'
    ])
    liste.append(['Phoenix (Suns)', URL_MAIN + 'category/nba/phoenix-suns/'])
    liste.append([
        'Portland (Blazers)', URL_MAIN + 'category/nba/portland-trail-blazers/'
    ])
    liste.append(
        ['Sacramento (Kings)', URL_MAIN + 'category/nba/sacramento-kings/'])
    liste.append(
        ['San Antonio (Spurs)', URL_MAIN + 'category/nba/san-antonio-spurs/'])
    liste.append(
        ['Toronto (Raptors)', URL_MAIN + 'category/nba/toronto-raptors/'])
    liste.append(['Utah (Jazz)', URL_MAIN + 'category/nba/utah-jazz/'])
    liste.append([
        'Washington (Wizards)', URL_MAIN + 'category/nba/washington-wizards/'
    ])

    for sTitle, sUrl in liste:

        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', sUrl)
        oGui.addDir(SITE_IDENTIFIER, 'showMovies', sTitle, 'genres.png',
                    oOutputParameterHandler)

    oGui.setEndOfDirectory()
Esempio n. 49
0
def showSeries(sSearch=''):
    oInputParameterHandler = cInputParameterHandler()

    if sSearch:
        sUrl = sSearch

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

    oGui = cGui()

    iPage = 1
    if (oInputParameterHandler.exist('page')):
        iPage = oInputParameterHandler.getValue('page')

    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.addParameters('api_key', API_KEY)
    oRequestHandler.addParameters('language', 'fr')
    oRequestHandler.addParameters('page', iPage)

    sHtmlContent = oRequestHandler.request()
    result = json.loads(sHtmlContent)

    total = len(sHtmlContent)
    #print result['results']
    if (total > 0):
        for i in result['results']:
            sId, sTitle, sOtitle, sThumbnail, sFanart = i['id'], i['name'], i[
                'original_name'], i['poster_path'], i['backdrop_path']
            if sThumbnail:
                sThumbnail = POSTER_URL + sThumbnail
            else:
                sThumbnail = ''

            if sFanart:
                sFanart = FANART_URL + sFanart
            else:
                sFanart = ''

            sTitle = sTitle.encode("utf-8")

            sSiteUrl = API_URL + '/tv/' + str(sId)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sSiteUrl)
            oOutputParameterHandler.addParameter('sMovieTitle', str(sTitle))
            oOutputParameterHandler.addParameter('sThumbnail', str(sThumbnail))
            oOutputParameterHandler.addParameter('sId', str(sId))
            oOutputParameterHandler.addParameter('sFanart', str(sFanart))

            oGui.addTVDB(SITE_IDENTIFIER, 'showSeriesSaison', sTitle,
                         'series.png', sThumbnail, sFanart,
                         oOutputParameterHandler)

        if (iPage > 0):
            iNextPage = int(iPage) + 1
            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl', sUrl)
            oOutputParameterHandler.addParameter('page', iNextPage)
            oGui.addDir(SITE_IDENTIFIER, 'showSeries',
                        '[COLOR teal]Page ' + str(iNextPage) + ' >>>[/COLOR]',
                        'next.png', oOutputParameterHandler)

    #test pr chnagement mode
    xbmc.executebuiltin('Container.SetViewMode(500)')

    oGui.setEndOfDirectory()
Esempio n. 50
0
def showMovies(sSearch=''):

    oGui = cGui()

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

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

    if 'reddit' in sUrl:
        TimeUTC = TimeET()
        sPattern = 'utm_name=nbastreams".+?>Game Thread:(.+?)</a>.+?<ul class=".+?"><li class=".+?"><a href="(.+?)"'
        oGui.addText(
            SITE_IDENTIFIER, '[COLOR olive]Live NBA Game (@Reddit)[/COLOR]' +
            '[COLOR gray]' + '  [ Heure Locale ET : ' + '[/COLOR]' + TimeUTC +
            '[COLOR gray]' + ' ]' + '[/COLOR]')

    elif 'category/20' in sUrl:
        sPattern = '<a href="([^"]+)">([^<]+)</a></h2>'

    else:
        sPattern = '<div class="post-img".+?a href="([^"]+)".+?img src=".+?" data-hidpi="(.+?)" alt="([^"]+)"(?:width=".+?"|)'

    sDateReplay = ''
    sDate = ''

    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

            #listage game thread via reddit
            if 'reddit' in sUrl:
                try:
                    sUrl2 = str(aEntry[1])
                    sTitle = str(aEntry[0])
                    sThumb = base64.b64decode(Logo_Reddit)
                    sTitle2 = sTitle.split("(")
                    sTitle = sTitle2[0]
                    sTimeLive = sTitle2[1]
                    sTimeLive = sTimeLive.replace(')', '')
                    sTitle = '[COLOR teal]' + sTimeLive + '[/COLOR]' + sTitle

                except:
                    #erreur parse
                    sThumb = ' '
                    sTitle = 'Erreur parse'
                    sUrl2 = ''

            #listage replay&search
            else:

                if ('category/20' in sUrl):

                    sTitle = str(aEntry[1])
                    sUrl2 = str(aEntry[0])
                    sThumb = ' '

                else:
                    sTitle = str(aEntry[2])
                    sUrl2 = str(aEntry[0])
                    sThumb = str(aEntry[1])

            try:
                if 'category/nba' in sUrl:

                    sTitle2 = sTitle.split(" – ")
                    sTitle = sTitle2[0]
                    sDateReplay = sTitle2[1]

                    if (sDate != sDateReplay):
                        oGui.addText(
                            SITE_IDENTIFIER, '[COLOR olive]Replay[/COLOR]' +
                            '[COLOR teal]' + ' / ' + sDateReplay + '[/COLOR]')
                        sDate = sDateReplay

            except:
                pass

            try:
                if ('category/20' in sUrl) or ('?s=' in sUrl) or ('search/'
                                                                  in sUrl):

                    if 'Game' in sTitle:
                        sTitle2 = sTitle.split(":")
                        sGame = sTitle2[0] + ':'
                        sTitle3 = sTitle2[1]
                    else:
                        sGame = 'Game: '
                        sTitle3 = sTitle

                    sTitle3 = sTitle3.replace('\xe2\x80\x93', '-')
                    sTitle = sTitle3.split("-")
                    sTeam = sTitle[0]
                    if sTitle[1]:
                        sDatePlayoff = sTitle[1]
                    else:
                        sDatePlayoff = ''

                    sTitle = '[COLOR olive]' + sGame + '[/COLOR]' + sTeam + '[COLOR teal]' + '/' + sDatePlayoff + '[/COLOR]'

            except:
                pass

            sTitle = sTitle.replace(' vs ',
                                    '[COLOR gray] vs [/COLOR]').replace(
                                        '@', '[COLOR gray] vs [/COLOR]')

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

            oGui.addMovie(SITE_IDENTIFIER, 'showHosters4', sTitle, '', sThumb,
                          sUrl2, 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)

    else:
        if 'reddit' in sUrl:
            oGui.addText(SITE_IDENTIFIER,
                         '(Aucun Match disponible via Reddit pour le moment)')
        else:
            oGui.addText(SITE_IDENTIFIER, '(Erreur -Replay non disponible)')

    if not sSearch:
        oGui.setEndOfDirectory()
Esempio n. 51
0
    def parseUrl(self):

        #import sys
        #xbmc.log('arg :' + str(sys.argv), xbmc.LOGNOTICE)
        #xbmc.log('Debug 1 >>' + str(xbmc.getInfoLabel('Container().CurrentPage')) , xbmc.LOGNOTICE)
        #xbmc.log('Debug 2 >>' + str(xbmc.getInfoLabel('Container.FolderPath')) , xbmc.LOGNOTICE)

        oInputParameterHandler = cInputParameterHandler()
        oInputParameterHandler.getAllParameter()

        if (oInputParameterHandler.exist('function')):
            sFunction = oInputParameterHandler.getValue('function')
        else:
            VSlog('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()
                plugins = __import__('resources.lib.about',
                                     fromlist=['about']).cAbout()
                function = getattr(plugins, 'getUpdate')
                function()
            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')
            if (oInputParameterHandler.exist('title')):
                sTitle = oInputParameterHandler.getValue('title')
            else:
                sTitle = "none"

            VSlog('load site ' + sSiteName + ' and call function ' + sFunction)
            cStatistic().callStartPlugin(sSiteName, sTitle)

            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 == 'globalRun':
                __import__('resources.lib.runscript', fromlist=['runscript'])
                #function = getattr(plugins, sFunction)
                #function()
                return

            if sSiteName == 'globalSources':

                oGui = cGui()
                oPluginHandler = cPluginHandler()
                aPlugins = oPluginHandler.getAvailablePlugins()
                if (len(aPlugins) == 0):
                    addons = addon()
                    addons.openSettings()
                    xbmc.executebuiltin("Container.Refresh")
                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':
                addons = addon()
                addons.openSettings()
                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:
                VSlog('could not load site: ' + sSiteName + ' error: ' +
                      str(e))
                import traceback
                traceback.print_exc()
                return
Esempio n. 52
0
def showHosters():

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

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    sHtmlContent = sHtmlContent.replace(' rel="nofollow"', '')

    if sDateReplay:
        sMovieTitle = sMovieTitle + '[COLOR teal]' + ' / ' + sDateReplay + '[/COLOR]'

    sLink = []

    if 'reddit' in sUrl:  #Live

        sPattern = '(?:<td>|)<a href="(http.+?(?:nbastreams|eplstream|yoursportsinhd|247hd).+?)">(?:<strong>.+?</strong>|)([^<]+)</a>(?:.+?Chrome.+?|)</td>'

        sLink = re.findall(sPattern, sHtmlContent)

        sDisplay = '[COLOR olive]Streaming disponibles:[/COLOR]'

    else:  #Replay

        sPattern = '<a href="(https?://(?:wstream|youwa|openlo)[^"]+)" target="_blank">(?:([^<]+)</a>|)'
        sPattern2 = '(?:data\-lazy\-src|src)="(http.+?(?:openload|raptu)\.co[^"]+)"'

        aResult1 = re.findall(sPattern, sHtmlContent)
        aResult2 = re.findall(sPattern2, sHtmlContent)
        sLink = aResult1 + aResult2

        #Test si lien video non embed (raptu/openload)
        sPattern3 = 'document.getElementById\(\'frame\'\).src=\'([^"]+)\'">(.+?)<span'
        aResult3 = re.findall(sPattern3, sHtmlContent)

        #recup lien video non embed
        if (aResult3):

            for aEntry in aResult3:

                sUrl = str(aEntry)

                oRequestHandler = cRequestHandler(sUrl)
                sHtmlContent = oRequestHandler.request()
                sHtmlContent = sHtmlContent.replace(' rel="nofollow"', '')

                aResult4 = re.findall(sPattern2, sHtmlContent)
                sLink = sLink + aResult4

        sDisplay = '[COLOR olive]Qualités disponibles:[/COLOR]'

    oGui.addText(SITE_IDENTIFIER, sMovieTitle)
    oGui.addText(SITE_IDENTIFIER, sDisplay)

    #affichage final des liens
    if (sLink):

        for aEntry in sLink:

            if 'reddit' in sUrl:  #Live

                sThumb = base64.b64decode(Logo_Nba)
                sHosterUrl = str(aEntry[0]).replace('&amp;', '&')

                if ('yoursport' in aEntry[0]):
                    sTitle = ('[%s] %s') % ('YourSportsinHD', str(aEntry[1]))
                elif ('nbastream' in aEntry[0]):
                    sTitle = ('[%s] %s') % ('NBAstreamspw', str(aEntry[1]))
                elif ('eplstream' in aEntry[0]):
                    sTitle = ('[%s] %s') % ('EPLstreams', str(aEntry[1]))
                elif ('247hd' in aEntry[0]):
                    sTitle = ('[%s] %s') % ('247HD', str(aEntry[1]))

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

                oGui.addMovie(SITE_IDENTIFIER, 'showLiveHosters', sTitle, '',
                              sThumb, sHosterUrl, oOutputParameterHandler)

            else:  #Replay

                if (aEntry[0]):
                    sHosterUrl = str(aEntry[0])

                if ('openload' in aEntry):
                    sTitle = ('[%s]') % ('720p')
                    sHosterUrl = str(aEntry)

                elif ('raptu' in aEntry):
                    sTitle = ('[%s]') % ('720p')
                    sHosterUrl = str(aEntry)

                elif ('youwatch' in aEntry[0]):
                    sTitle = ('[%s]') % ('540p')

                elif ('wstream' in aEntry[0]):
                    sTitle = ('[%s]') % ('720p')

                else:
                    sTitle = ('[%s]') % (str(aEntry[1]))

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

    else:
        oGui.addText(SITE_IDENTIFIER, '(Live/Replay non disponible)')

    oGui.setEndOfDirectory()
Esempio n. 53
0
def searchGlobal():
    cancel = False
    oGui = cGui()
    addons = addon()

    oInputParameterHandler = cInputParameterHandler()

    sSearchText = oInputParameterHandler.getValue('searchtext')
    sCat = oInputParameterHandler.getValue('sCat')

    oHandler = cRechercheHandler()
    oHandler.setText(sSearchText)
    oHandler.setCat(sCat)
    aPlugins = oHandler.getAvailablePlugins()
    if not aPlugins: return True
    total = len(aPlugins)

    #VSlog(str(aPlugins), xbmc.LOGNOTICE)

    progress_ = progress().VScreate()

    #kodi 17 vire la fenetre busy qui ce pose au dessus de la barre de Progress
    try:
        xbmc.executebuiltin("Dialog.Close(busydialog)")
    except:
        pass

    window(10101).setProperty('search', 'true')

    oGui.addText('globalSearch',
                 addons.VSlang(30081) % (sSearchText), 'none.png')

    for count, plugin in enumerate(aPlugins):

        #text = '%s/%s - %s' % ((count+1), total, plugin['name'])
        progress_.VSupdatesearch(progress_, total, plugin['name'])
        if progress_.iscanceled():
            cancel = True
            progress_.close()
            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)

    window(10101).setProperty('search', 'false')
    progress_.VSclose(progress_)

    #affichage
    total = len(oGui.searchResults)

    for count, result in enumerate(oGui.searchResults):
        text = '%s/%s - %s' % (
            (count + 1 / total), total, result['guiElement'].getTitle())

        #if(count == 0):
        #    cConfig().updateDialogSearch(dialog, total, text,True)
        #else:
        #    cConfig().updateDialogSearch(dialog, total, text)
        #progress_.VSupdatesearch(progress_, total, result['guiElement'].getTitle())

        #result['params'].addParameter('VSTRMSEARCH','True')

        oGui.addFolder(result['guiElement'], result['params'])
        #VSlog('%s - %s' % (middle,old_label),  xbmc.LOGNOTICE)

        # if progress_.iscanceled():
        #     if cancel == True:
        #         continue
        #     else:
        #         break

    #progress_.VSclose(progress_)

    oGui.setEndOfDirectory()

    return True
Esempio n. 54
0
def showGenres(basePath):
    oGui = cGui()

    liste = []
    liste.append(['Action', URL_MAIN + 'telechargement+5/' + basePath])
    liste.append(['Animation', URL_MAIN + 'telechargement+4/' + basePath])
    liste.append(['Arts Martiaux', URL_MAIN + 'telechargement+64/' + basePath])
    liste.append(['Aventure', URL_MAIN + 'telechargement+20/' + basePath])
    liste.append(['Biographie', URL_MAIN + 'telechargement+38/' + basePath])
    liste.append(['Biopic', URL_MAIN + 'telechargement+28/' + basePath])
    liste.append(['Combat', URL_MAIN + 'telechargement+35/' + basePath])
    liste.append(['Comédie', URL_MAIN + 'telechargement+1/' + basePath])
    liste.append(
        ['Comédie dramatique', URL_MAIN + 'telechargement+12/' + basePath])
    liste.append(
        ['Comédie musicale', URL_MAIN + 'telechargement+33/' + basePath])
    liste.append(
        ['Comédie romantique', URL_MAIN + 'telechargement+53/' + basePath])
    liste.append(['Comique', URL_MAIN + 'telechargement+51/' + basePath])
    liste.append(['Court métrage', URL_MAIN + 'telechargement+45/' + basePath])
    liste.append(['Criminalité', URL_MAIN + 'telechargement+40/' + basePath])
    liste.append(['Dessin animé', URL_MAIN + 'telechargement+27/' + basePath])
    liste.append(['Divers', URL_MAIN + 'telechargement+34/' + basePath])
    liste.append(
        ['Divertissement', URL_MAIN + 'telechargement+66/' + basePath])
    liste.append(['Documentaire', URL_MAIN + 'telechargement+9/' + basePath])
    liste.append(['Drame', URL_MAIN + 'telechargement+3/' + basePath])
    liste.append(['Epouvante', URL_MAIN + 'telechargement+41/' + basePath])
    liste.append(
        ['Epouvante-horreur', URL_MAIN + 'telechargement+17/' + basePath])
    liste.append(['Erotique', URL_MAIN + 'telechargement+24/' + basePath])
    liste.append(['Espionnage', URL_MAIN + 'telechargement+13/' + basePath])
    liste.append(['Famille', URL_MAIN + 'telechargement+31/' + basePath])
    liste.append(['Fantastique', URL_MAIN + 'telechargement+16/' + basePath])
    liste.append(['Football', URL_MAIN + 'telechargement+32/' + basePath])
    liste.append(['Guerre', URL_MAIN + 'telechargement+22/' + basePath])
    liste.append(['Historique', URL_MAIN + 'telechargement+21/' + basePath])
    liste.append(['Horreur', URL_MAIN + 'telechargement+15/' + basePath])
    liste.append(['Humour', URL_MAIN + 'telechargement+44/' + basePath])
    liste.append(['Jeunesse', URL_MAIN + 'telechargement+19/' + basePath])
    liste.append(['Judiciaire', URL_MAIN + 'telechargement+67/' + basePath])
    liste.append(['Karaté', URL_MAIN + 'telechargement+23/' + basePath])
    liste.append(['Manga', URL_MAIN + 'telechargement+58/' + basePath])
    liste.append(['Médical', URL_MAIN + 'telechargement+47/' + basePath])
    liste.append(['Musical', URL_MAIN + 'telechargement+10/' + basePath])
    liste.append(['Mystère', URL_MAIN + 'telechargement+26/' + basePath])
    liste.append(['Péplum', URL_MAIN + 'telechargement+54/' + basePath])
    liste.append(['Policier', URL_MAIN + 'telechargement+2/' + basePath])
    liste.append(['Reportage', URL_MAIN + 'telechargement+57/' + basePath])
    liste.append(['Romance', URL_MAIN + 'telechargement+6/' + basePath])
    liste.append(
        ['Science fiction', URL_MAIN + 'telechargement+7/' + basePath])
    liste.append(['Sketches', URL_MAIN + 'telechargement+14/' + basePath])
    liste.append(['Spectacle', URL_MAIN + 'telechargement+39/' + basePath])
    liste.append(['Sport', URL_MAIN + 'telechargement+68/' + basePath])
    liste.append(['Suspense', URL_MAIN + 'telechargement+42/' + basePath])
    liste.append(['Téléréalité', URL_MAIN + 'telechargement+18/' + basePath])
    liste.append(['Thriller', URL_MAIN + 'telechargement+8/' + basePath])
    liste.append(['Western', URL_MAIN + 'telechargement+11/' + basePath])

    for sTitle, sUrl in liste:

        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', sUrl)
        oGui.addDir(SITE_IDENTIFIER, 'showMovies', sTitle, 'genres.png',
                    oOutputParameterHandler)

    oGui.setEndOfDirectory()
def showHosters():
    oGui = cGui()
    ifVSlog('Filmstoon:#')
    ifVSlog('Filmstoon:showHosters')

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')
    sDesc = oInputParameterHandler.getValue(
        'sDesc')  # faire un addlink  juste pour desc ?

    ifVSlog('Filmstoon:#')
    ifVSlog('Filmstoon:showHosters')
    ifVSlog('Filmstoon:surl = ' + sUrl)
    oRequestHandler = cRequestHandler(sUrl)

    timestart = int(time.time())
    sHtmlContent = oRequestHandler.request()
    timestop = int(time.time())
    timespan = timestop - timestart
    ifVSlog('Filmstoon:time request-response : ' + str(timespan))

    #sPattern='<div class="st-line"> Année:([^<]*)<.div>.+?line"> Durée:([^<]*)'
    #oParser = cParser()
    #aResult = oParser.parse(sHtmlContent, sPattern)
    #if (aResult[0] == True):
    #if len(aResult[1]) == 1:
    #aEntry = aResult[1][0]
    #sDesc= aEntry[0] +' ' +aEntry[1] + sDesc

    #html qui a changé spaterne hs
    #sPattern = 'iframe src="data:image.+?show.filmstoon.pro.+?php.([^"]*)&'

    # valides pattern
    #sPattern = 'data:image.+?data-src=".+?filmstoon.pw.playfst.php.([^"]*).p=http'  # temps trop long 200 ms
    #sPattern = 'data-src.+?filmstoon.pw.playfst.php.([^"]*).p=https' # 50 ms
    sPattern = 'data-src.+?playfst.php.([^"]*).p=https'  # 50

    #exemple
    #tl=Jumbo&yr=2020&im=tt6818118&butm=f8amdzps8q1k&sv=ms&sr=fst&ni=259782&fc=37290a4f2d42347bce34d609e8e0e01f

    # g1 : parametres de la requete que l'on va copier et echanger
    # avec celle genérée normalement par https://easyplayer.cc/player.php?
    # c'est quasiment la meme
    ifVSlog('Filmstoon:Try Selected Pattern = ' + sPattern)
    requestlist = []
    sHosterUrllist = []
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == False):
        oGui.addText(SITE_IDENTIFIER)
        ifVSlog(sHtmlContent)
        #ifVSlog('')
        ifVSlog('Filmstoon:Failed Pattern with url = ' + sUrl)
        ifVSlog('Filmstoon:Selected Pattern = ' + sPattern)
        #Your IP-address or subnet have been blocked
        if 'Your IP-address or subnet have been blocked' in sHtmlContent:
            #xbmc.executebuiltin('Notification(%s, %s, %d)'%('Filmstoon Plugin ','You have been blocked : Try change your IP-address ', 5000))
            ifVSlog(' Filmstoon:IP-address blocked')

    if (aResult[0] == True):
        ifVSlog(' Filmstoon:aResult[0] == True')
        for aEntry in aResult[1]:
            req = 'https://easyplayer.cc/player.php?' + str(aEntry)
            requestlist.append(req)
    #i=0
    for irequest in requestlist:
        #  url du host dans l'entete de la réponse
        urlreq = irequest
        ifVSlog('Filmstoon:urlreq' + str(urlreq))

        timestart = int(time.time())

        oRequestHandler = cRequestHandler(urlreq)
        oRequestHandler.request()
        sHeader = oRequestHandler.getResponseHeader()

        timestop = int(time.time())
        timespan = timestop - timestart
        ifVSlog('Filmstoon:time for irequest header  : ' + str(timespan))

        bDoublon = False  ## on verifie si url embed en double (mystrem)
        sremarque = ''
        ifVSlog('Filmstoon:sHeader' + str(sHeader))
        bfindheader = False
        sHosterUrl = 'not find'
        for iheader in sHeader:

            if iheader == 'refresh':
                bfindheader = True
                sHosterUrl = sHeader.getheader('refresh')
                ifVSlog('Filmstoon:header ' + sHosterUrl)
                sHosterUrl = sHosterUrl.split(';')
                sHosterUrl = sHosterUrl[1]
                sHosterUrl = sHosterUrl.replace('url=', '')
                ifVSlog('Filmstoon:Final value : sHosterUrl ' + sHosterUrl)
                # ne marche pas
                #url=https://filmstreaming1.red/registred.php?
                if 'registred' in sHosterUrl:
                    sremarque = '[ Find register link !  ] '

                ifVSlog('Filmstoon:header url=' + sHosterUrl)
                if not sHosterUrl in sHosterUrllist:
                    bDoublon = False
                    sHosterUrllist.append(sHosterUrl)
                    #i=i+1
                else:
                    bDoublon = True
                break

        if bfindheader:
            ifVSlog('Filmstoon:header find : with HosterUrl=' + sHosterUrl)
        else:
            ifVSlog('Filmstoon:header no find  HosterUrl')

        #if not bDoublon:  # a activer pour filtrer

        ifVSlog('Filmstoon:Filtre doublon desactivé ')
        if True:
            sDisplayTitle = sremarque + sMovieTitle
            ifVSlog('Filmstoon:sDisplayTitle=' + str(sDisplayTitle))

            ifVSlog('Filmstoon:teste oHoster ')

            oHoster = cHosterGui().checkHoster(sHosterUrl)

            if (oHoster != False):
                ifVSlog('Filmstoon:oHoster ==True')
                ifVSlog('Filmstoon:End Job : oHoster is OK...........')
                ifVSlog('')
                #oHoster.setDisplayName(sMovieTitle)
                oHoster.setDisplayName(sDisplayTitle)
                oHoster.setFileName(sMovieTitle)
                cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)
            else:
                ifVSlog('Filmstoon:oHoster == False')
                ifVSlog('Filmstoon:End Job : oHoster  FAILED')
                ifVSlog('')

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

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

    if "onaregarde" in sUrl:
        oParser = cParser()
        sPattern = '<a type="submit".+?href="([^"]+)"'
        sUrl = oParser.parse(sHtmlContent, sPattern)[1][0]

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

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

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

    # la qualité courante est le lien en cours ici-même
    oOutputParameterHandler = cOutputParameterHandler()
    oOutputParameterHandler.addParameter('siteUrl', sUrl)
    oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
    oOutputParameterHandler.addParameter('sThumb', sThumb)
    oOutputParameterHandler.addParameter('sDesc', sDesc)
    oOutputParameterHandler.addParameter('sYear', sYear)
    oGui.addLink(SITE_IDENTIFIER, 'showHosters', sDisplayTitle, sThumb, sDesc,
                 oOutputParameterHandler)

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

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

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

    oGui.setEndOfDirectory()
Esempio n. 57
0
def showMovies(sSearch=''):
    if sSearch:
        sUrl = sSearch
        sSearch = sSearch.replace(' ', '+')

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

    oGui = cGui()

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

    sHtmlContent = sHtmlContent.replace(
        '<div class="ifabh clickable" onclick="window.location', '')

    #first scan to optimise
    #sPattern = 'onclick="window\.location(.+?)(?:<div class="clickable|<br\/>)'
    sPattern = '<div class="search-result-thumbnail">.*?<img.+?src="//.+?/(thumbnail/[^"]+)".+?class="forstar.+?>([^<]+)</a>.+?<a title="(.+?)".+?href="/([^"]+)".+?<img.+?title="([^"]+)"'
    oParser = cParser()
    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

            sthumb = aEntry[0]
            sHost = aEntry[1]
            sCom = aEntry[2]
            sUrl = aEntry[3]
            sFlag = aEntry[4]

            # if len(sthumb) < 2:
            # sthumb = 'put1debug'
            # else:
            sthumb = URL_MAIN + sthumb

            sTitle = re.sub('l\/(.+?)\/.+$', '\\1', sUrl)

            sUrl = URL_MAIN + sUrl

            sLang = 'FR'
            if 'vostfr' in sCom or 'vostfr' in sUrl:
                sLang = 'VOSTFR'

            sQual = 'SD'
            if 'HD' in sCom or 'HD' in sUrl:
                sQual = 'HD'

            sDisplaytitle = '[COLOR coral]' + sHost + '[/COLOR] ' + '[B](' + sLang + '/' + sQual + ')[/B] ' + sTitle

            #ne pas l'afficher si host special
            if sHost not in 'freakshare.com':
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', str(sUrl))
                oOutputParameterHandler.addParameter('sMovieTitle',
                                                     str(sTitle))
                oOutputParameterHandler.addParameter('sThumbnail', str(sthumb))
                oGui.addMisc(SITE_IDENTIFIER, 'showHosters', sDisplaytitle, '',
                             sthumb, '', 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()
Esempio n. 58
0
def showMovies(sSearch=''):
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl').replace('index.php', '')
    if sSearch:
        sUrl = sSearch

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

    sPattern = '<img class="mainimg.+?src="([^"]+).+?href="([^"]+)">([^<]+)<.+?<b>([^<]+)<.+?">([^<]+)<'

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

    titles = set()

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

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

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

            # on vire le tiret des series
            sTitle = sTitle.replace(' - Saison',
                                    ' Saison').replace('COMPLETE', 'Complete')
            sMovieTitle = sTitle.split('Saison')[0]

            if '[Complete]' not in sTitle:
                sTitle = sTitle.replace('COMPLETE', '[Complete]')

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

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

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

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

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

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

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

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

        progress_.VSclose(progress_)

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

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

        oGui.setEndOfDirectory()
Esempio n. 59
0
def showLists():
    oGui = cGui()
    grab = cTMDb()
    addons = addon()

    oInputParameterHandler = cInputParameterHandler()

    iPage = 1
    if (oInputParameterHandler.exist('page')):
        iPage = oInputParameterHandler.getValue('page')

    sUrl = oInputParameterHandler.getValue('siteUrl')
    result = grab.getUrl('list/' + sUrl, iPage, '')
    total = len(result)
    if (total > 0):
        total = len(result['items'])
        progress_ = progress().VScreate(SITE_NAME)

        for i in result['items']:
            progress_.VSupdate(progress_, total)
            if progress_.iscanceled():
                break

            # Mise en forme des infos (au format meta imdb)
            i = grab._format(i, '')

            sId, sTitle, sType, sThumb, sFanart, sVote, sDesc, sYear = i[
                'tmdb_id'], i['title'], i['media_type'], i['cover_url'], i[
                    'backdrop_url'], i['rating'], i['plot'], i['year']

            if not isMatrix():
                sTitle = sTitle.encode("utf-8")

            sDisplayTitle = "%s (%s)" % (sTitle, sVote)

            oOutputParameterHandler = cOutputParameterHandler()
            oOutputParameterHandler.addParameter('siteUrl',
                                                 'http://tmdb/%s' % sId)
            oOutputParameterHandler.addParameter('sMovieTitle', sTitle)
            oOutputParameterHandler.addParameter('sThumb', sThumb)
            oOutputParameterHandler.addParameter('sId', sId)
            oOutputParameterHandler.addParameter('sFanart', sFanart)
            oOutputParameterHandler.addParameter('sTmdbId', sId)

            if isMatrix():
                oOutputParameterHandler.addParameter('searchtext', sTitle)
            else:
                oOutputParameterHandler.addParameter('searchtext',
                                                     cUtil().CleanName(sTitle))

            cGui.CONTENT = "movies"
            oGuiElement = cGuiElement()
            oGuiElement.setTmdbId(sId)
            oGuiElement.setSiteName('globalSearch')
            oGuiElement.setFunction('showSearch')
            oGuiElement.setTitle(sDisplayTitle)
            oGuiElement.setFileName(sTitle)
            if sType == 'movie':
                oGuiElement.setIcon('films.png')
                oGuiElement.setMeta(1)
                oGuiElement.setCat(1)
            elif sType == 'tv':
                oGuiElement.setIcon('series.png')
                oGuiElement.setMeta(2)
                oGuiElement.setCat(2)
            oGuiElement.setThumbnail(sThumb)
            oGuiElement.setPoster(sThumb)
            oGuiElement.setFanart(sFanart)
            oGuiElement.setDescription(sDesc)
            oGuiElement.setYear(sYear)
            if 'genre' in i:
                oGuiElement.setGenre(i['genre'])

            oGui.addFolder(oGuiElement, oOutputParameterHandler)

        progress_.VSclose(progress_)

    view = addons.getSetting('visuel-view')

    oGui.setEndOfDirectory(view)
Esempio n. 60
0
def showMovies(sSearch=''):
    oGui = cGui()

    if sSearch:
        sUrl = sSearch.replace(' ', '+')
        sPattern = '<div class="image">.+?<a href="([^"]+)".+?<img src="([^"]+)" alt="([^"]+)".+?<p>(.+?)</p>'
    else:
        oInputParameterHandler = cInputParameterHandler()
        sUrl = oInputParameterHandler.getValue('siteUrl')
        sPattern = 'article id="post-\d+".+?img src="([^"]+)" alt="([^"]+).+?(?:|class="quality">([^<]+).+?)(?:|class="dtyearfr">([^<]+).+?)href="([^"]+).+?class="texto">(.*?)</div>'

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    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)
        utils = cUtil()
        oOutputParameterHandler = cOutputParameterHandler()

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

            sLang = ''
            sYear = ''
            sDesc = ''
            if sSearch:
                sUrl = aEntry[0]
                sThumb = aEntry[1]
                sTitle = aEntry[2]
                sDesc = aEntry[3]
            else:
                sThumb = aEntry[0]
                sTitle = aEntry[1]
                if aEntry[2]:
                    sLang = aEntry[2]
                if aEntry[3]:
                    sYear = aEntry[3]
                sUrl = aEntry[4]
                if aEntry[5]:
                    sDesc = aEntry[5]

            try:
                sDesc = unicode(sDesc, 'utf-8')  # converti en unicode
                sDesc = utils.unescape(sDesc).encode(
                    'utf-8')  # retire les balises HTML
            except:
                pass

            sDisplayTitle = ('%s (%s) (%s)') % (sTitle, sLang, sYear)

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

            if '/serie' in sUrl:
                oGui.addTV(SITE_IDENTIFIER, 'showSxE', sDisplayTitle, '',
                           sThumb, sDesc, oOutputParameterHandler)
            else:
                oGui.addMovie(SITE_IDENTIFIER, 'showLink', 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()