예제 #1
0
    def searchMovie(self, title):
        """
            Method to search a movie
            @return a list of StreamItem
        """
        # Use get http://xstreamingx.com/?s=300
        #
        get_href = '?s=' + title

        response = self.openPage(get_href)
        elementList = []

        if response and response.getcode() == 200:
            content = response.read()
            elementList = self.getMoviesItemFromContent(content)

        # ___ Error during search the movie
        else:
            miscFunctions.displayNotification('Unable to search Movie ' +
                                              title)
            self.__LOGGER__.log(
                'Connection ERROR : Failed to open page (' +
                self.buildHref(get_href) + ')', xbmc.LOGERROR)

        return elementList
예제 #2
0
    def searchMovie(self, title):
        """
            Method to search a movie
            @return a list of StreamItem
        """
        # Use get http://libertyvf.com/v2/search?q=

        href = '/v2/search?q=' + webUtil.encodeStr(title)
        response = self.openPage(href)

        elementList = []

        if response and response.getcode() == 200:
            content = response.read()
            soup = BeautifulSoup(content)

            # ___ Get the div for movie
            moviesDiv = soup.find('div', {'id': 'films-search'})

            if moviesDiv is not None:

                movies = moviesDiv.findAll(
                    'div', {'class': 'col-lg-3 col-md-3 col-sm-3 col-xs-6'})

                for movie in movies:
                    title = movie.find('figcaption').find('a').text.encode(
                        'UTF-8')
                    title = strUtil.unescapeHtml(str(title))

                    self.__LOGGER__.log("Finded title: " + title,
                                        xbmc.LOGDEBUG)
                    title = strUtil.cleanTitle(title)
                    self.__LOGGER__.log("Clean title: " + str(title),
                                        xbmc.LOGDEBUG)
                    # __ Create the element
                    element = StreamItem(title)
                    element.setHref(
                        movie.find('figcaption').find('a')['href'].replace(
                            '/films/',
                            '/films/streaming/').replace('-telecharger-', '-'))
                    element.setAction(StreamItem.ACTION_DISPLAY_LINKS)
                    element.setType(StreamItem.TYPE_MOVIE)
                    element.setIconImage(movie.find('img')['src'])
                    element.setSourceId(self.ID)

                    # __ Add the element to the list
                    elementList.append(element)

        # ___ Error during search the movie
        else:
            miscFunctions.displayNotification('Unable to search Movie ' +
                                              title)
            self.__LOGGER__.log(
                'Connection ERROR : Failed to open page (' +
                self.buildHref(href) + ')', xbmc.LOGERROR)

        return elementList
예제 #3
0
    def getAnimeEpisodes(self, episodeStreamItem):
        """
            Method to get the episodes list of a season
            @return a list of StreamItem
        """        
        
        
        # ___ Initialize the list to return
        elementList = []
        
        # ___ Get the soup
        soup = self._initOpenPage(episodeStreamItem)
        
        if soup is not None:
            seasons = soup.find('article',{'class':'full-article'}).find("div",{'class':'mc-left'}).find('div',{'id':'accordian'}).find('ul').findAll('li',recursive=False)
            
            for season in seasons:
                
                title = season.find('a').text.encode('UTF-8')
                seasonPattern = re.compile('(Saison )(.*)')
                match = seasonPattern.match(title)
                if match is not None:  
                    seasonNum = match.group(2) 
                else:
                    seasonNum = title

                
                if seasonNum == str(episodeStreamItem.getSeason()):
                    
                    episodeSoup = season.find('ul').findAll('li')                    
                    for li in episodeSoup:
                        text = li.text.encode('UTF-8')                        
                        episodePattern = re.compile('(.*)(pisode )(.*)')
                        match = episodePattern.match(text)
                        if match is not None:  
                            episodeNum = match.group(3) 
                        else:
                            episodeNum = text
                        
                        href = li.find('a')['href']
                        # __ Create the element                       
                        element = episodeStreamItem.copy()
                        element.setAction(StreamItem.ACTION_DISPLAY_LINKS)
                        element.setType(StreamItem.TYPE_ANIME_EPISODE)
                        element.setEpisode(episodeNum)
                        element.setHref(href)
                        element.determineEpisodeTitle()
                        
                        elementList.append(element)
                
        
        # ___ Error during getting seasons
        else:
            miscFunctions.displayNotification('Unable to get episodes of ' + episodeStreamItem.getTitle())                   
            self.__LOGGER__.log('Connection ERROR : Failed to open page (' + self.buildHref(episodeStreamItem.getHref()) + ')', xbmc.LOGERROR)
    
        return elementList
예제 #4
0
    def getTopMovie(self, streamItem=False):
        """
            Method to get top movie
            @return a list of StreamItem
        """
        href = ''
        response = self.openPage(href)
        elementList = []

        if response and response.getcode() == 200:
            content = response.read()
            soup = BeautifulSoup(content)

            # For every post, get title and topicLink
            movies = soup.find('ul', {'id': 'tab-popular-2'}).findAll('li')

            for index in range(0, len(movies)):

                movie = movies[index]
                el = movie.find('p', {'class': 'tab-item-title'}).find('a')
                title = el.text.encode('UTF-8')
                title = strUtil.unescapeHtml(str(title))
                # Remove '  Film Complet en Streaming'
                title = self.removeFilmComplet(title)
                self.__LOGGER__.log("Finded title: " + title, xbmc.LOGDEBUG)
                href = el['href']
                year = strUtil.getYearFromTitle(title)
                quality = strUtil.getQualityFromTitle(title)
                lang = strUtil.getLangFromTitle(title)
                title = strUtil.cleanTitle(title)
                self.__LOGGER__.log("Clean title: " + str(title),
                                    xbmc.LOGDEBUG)

                # __ Create the element
                element = StreamItem(title)
                element.setHref(href)
                element.setYear(year)
                element.setQuality(quality)
                element.setLang(lang)
                element.setAction(StreamItem.ACTION_DISPLAY_LINKS)
                element.setType(StreamItem.TYPE_MOVIE)

                # __ Add the element to the list
                elementList.append(element)

        # ___ Error during open last movie page
        else:
            miscFunctions.displayNotification('Unable to get top movie ')
            self.__LOGGER__.log(
                'Connection ERROR : Failed to open page (' +
                self.buildHref(href) + ')', xbmc.LOGERROR)

        return elementList
예제 #5
0
 def searchTvShow(self, title):
     """
         Method to search a tv show
         @return a list of StreamItem
     """
     get_href = '?s='+title
     response = self.openPage(get_href)
     elementList = []
     
     if response and response.getcode() == 200:    
         content = response.read()            
         elementList = self.getItemsFromContent(content,StreamItem.TYPE_MOVIE)            
         
     # ___ Error during search the movie
     else:
         miscFunctions.displayNotification('Unable to search Movie ' + title)                   
         self.__LOGGER__.log('Connection ERROR : Failed to open page (' + self.buildHref(get_href) + ')', xbmc.LOGERROR)
 
     return elementList
예제 #6
0
    def getLastMovie(self, streamItem=False):
        """
            Method to get all last movie
            @return a list of StreamItem
        """
        response = self.openPage('')
        elementList = []

        if response and response.getcode() == 200:
            content = response.read()
            elementList = self.getMoviesItemFromContent(content)

        # ___ Error during open last movie page
        else:
            miscFunctions.displayNotification('Unable to get last movie ')
            self.__LOGGER__.log(
                'Connection ERROR : Failed to open page (' +
                self.buildHref('') + ')', xbmc.LOGERROR)

        return elementList
예제 #7
0
 def searchAnime(self, title):
     """
         Method to search a anime
         @return a list of StreamItem
     """
     post_href = 'search'
     data = {'k':title}
     response = self.postPage(post_href,data)
     elementList = []
     
     if response and response.getcode() == 200:    
         content = response.read()            
         elementList = self.getItemsFromContent(content, StreamItem.TYPE_ANIME) 
         
     # ___ Error during search the movie
     else:
         miscFunctions.displayNotification('Unable to search Anime ' + title)                   
         self.__LOGGER__.log('Connection ERROR : Failed to open page (' + self.buildHref(post_href) + ')', xbmc.LOGERROR)
 
     return elementList
예제 #8
0
 def getAnimeSeasons(self, tvShowStreamItem):
     """
         Method to get the seasons list of an anime
         @return a list of StreamItem
     """
     
     # ___ Initialize the list to return
     elementList = []
     
     # ___ Get the soup
     soup = self._initOpenPage(tvShowStreamItem)
     
     if soup is not None:
         seasons = soup.find('article',{'class':'full-article'}).find("div",{'class':'mc-left'}).find('div',{'id':'accordian'}).find('ul').findAll('li',recursive=False)
         
         for season in seasons:
             
             title = season.find('a').text.encode('UTF-8')
             seasonPattern = re.compile('(Saison )(.*)')
             match = seasonPattern.match(title)
             if match is not None:  
                 seasonNum = match.group(2) 
             else:
                 seasonNum = title
                 
             # __ Create the element               
             element = tvShowStreamItem.copy()
             element.setAction(StreamItem.ACTION_DISPLAY_EPISODES)
             element.setType(StreamItem.TYPE_ANIME_SEASON)
             element.setSeason(seasonNum)
             element.determineSeasonTitle()
             
             elementList.append(element)
     
     # ___ Error during getting seasons
     else:
         miscFunctions.displayNotification('Unable to get seasons of ' + tvShowStreamItem.getTitle())                   
         self.__LOGGER__.log('Connection ERROR : Failed to open page (' + self.buildHref(tvShowStreamItem.getHref()) + ')', xbmc.LOGERROR)
 
     return elementList
예제 #9
0
    def getTvShowSeasons(self, tvShowStreamItem):
        """
            Method to get the seasons list of a tv show
            @return a list of StreamItem
        """

        # ___ Initialize the list to return
        elementList = []

        # ___ Get the soup
        soup = self._initOpenPage(tvShowStreamItem)

        if soup is not None:
            seasons = soup.find('select', {'id': 'saison'}).findAll('option')

            for season in seasons:
                seasonNum = season['value']
                title = season.text.encode('UTF-8')

                # __ Create the element
                element = tvShowStreamItem.copy()
                element.setAction(StreamItem.ACTION_DISPLAY_EPISODES)
                element.setType(StreamItem.TYPE_TVSHOW_SEASON)
                element.setSeason(seasonNum)
                element.determineSeasonTitle()

                elementList.append(element)

        # ___ Error during getting seasons
        else:
            miscFunctions.displayNotification('Unable to get seasons of ' +
                                              tvShowStreamItem.getTitle())
            self.__LOGGER__.log(
                'Connection ERROR : Failed to open page (' +
                self.buildHref(tvShowStreamItem.getHref()) + ')',
                xbmc.LOGERROR)

        return elementList
예제 #10
0
 def searchMovie(self, title):
     """
         Method to search a movie
         @return a list of StreamItem
     """
     post_href = 'search'
     data = {'k':title}
     headers=webUtil.HEADER_CFG
     headers['Referer'] = self.WEB_PAGE_BASE
     headers['Host'] = 'streamay.ws'
     response = self.postPage(post_href,data)
     elementList = []
     
     if response and response.getcode() == 200:    
         content = response.read()
         elementList = self.getItemsFromContent(content, StreamItem.TYPE_MOVIE)
                 
     # ___ Error during search the movie
     else:
         miscFunctions.displayNotification('Unable to search Movie ' + title)                   
         self.__LOGGER__.log('Connection ERROR : Failed to open page (' + self.buildHref(post_href) + ')', xbmc.LOGERROR)
 
     return elementList
예제 #11
0
    def searchMovie(self, title):
        """
            Method to search a movie
            @return a list of StreamItem
        """
        # Use get ?s=300
        get_href = '?s=' + webUtil.encodeStr(title)

        response = self.openPage(get_href)
        elementList = []

        if response and response.getcode() == 200:
            content = response.read()
            soup = BeautifulSoup(content)

            # For every post, get title and topicLink
            if soup.find('div', {'class': 'post-list group'}) is not None:
                movies = soup.find('div', {
                    'class': 'post-list group'
                }).findAll('article')
            else:
                return elementList

            for index in range(0, len(movies)):

                movie = movies[index]
                el = movie.find('h2', {
                    'class': 'post-title entry-title'
                }).find('a')
                title = el.text.encode('UTF-8')
                title = strUtil.unescapeHtml(str(title))
                # Remove '  Film Complet en Streaming'
                title = self.removeFilmComplet(title)
                self.__LOGGER__.log("Finded title: " + title, xbmc.LOGDEBUG)
                href = el['href']
                year = strUtil.getYearFromTitle(title)
                quality = strUtil.getQualityFromTitle(title)
                lang = strUtil.getLangFromTitle(title)
                title = strUtil.cleanTitle(title)
                self.__LOGGER__.log("Clean title: " + str(title),
                                    xbmc.LOGDEBUG)

                # __ Create the element
                element = StreamItem(title)
                element.setHref(href)
                element.setYear(year)
                element.setQuality(quality)
                element.setLang(lang)
                element.setAction(StreamItem.ACTION_DISPLAY_LINKS)
                element.setType(StreamItem.TYPE_MOVIE)
                element.setSourceId(self.ID)

                # __ Add the element to the list
                elementList.append(element)

        # ___ Error during search the movie
        else:
            miscFunctions.displayNotification('Unable to search Movie ' +
                                              title)
            self.__LOGGER__.log(
                'Connection ERROR : Failed to open page (' +
                self.buildHref(get_href) + ')', xbmc.LOGERROR)

        return elementList
예제 #12
0
    def getTvShowEpisodes(self, episodeStreamItem):
        """
            Method to get the episodes list of a season
            @return a list of StreamItem
        """

        # ___ Initialize the list to return
        elementList = []

        # ___ Get the soup
        soup = self._initOpenPage(episodeStreamItem)

        if soup is not None:
            seasons = soup.find('select', {'id': 'saison'})
            recupepiPattern = re.compile(
                '(recupepis\(\$\(\'#saison\'\)\.val\(\),\')(\d+)(\',\')(.*?)(\',\'streaming\'\))'
            )
            match = recupepiPattern.match(seasons['onchange'])
            if match is not None:
                id = match.group(2)
                title = match.group(4)
            else:
                return elementList

            post_href = '/v2/ajaxepisode.php'
            data = {
                'saison': episodeStreamItem.getSeason(),
                'idserie': id,
                'title': title,
                'typeserie': 'streaming'
            }
            response = self.postPage(post_href, data)
            if response and response.getcode() == 200:
                content = response.read()
                # ___ Initialize BeautifulSoup
                soup = BeautifulSoup(content)
                # ___ Close the connection
                response.close()

                episodes = soup.findAll('option')
                for episode in episodes:
                    title = episode.text.encode('utf-8')
                    href = episodeStreamItem.getHref() + episode['value']
                    # __ Create the element
                    element = episodeStreamItem.copy()
                    element.setAction(StreamItem.ACTION_DISPLAY_LINKS)
                    element.setType(StreamItem.TYPE_TVSHOW_EPISODE)
                    element.setHref(href)
                    element.determineEpisodeTitle()
                    episodePattern = re.compile('(.*)(Episode )(.*)')
                    match = episodePattern.match(title)
                    if match is not None:
                        episodeNum = match.group(3)
                        arrayEp = episodeNum.split('-')
                        for ep in arrayEp:
                            element.addEpisode(ep)

                    elementList.append(element)

        # ___ Error during getting seasons
        else:
            miscFunctions.displayNotification('Unable to get episodes of ' +
                                              episodeStreamItem.getTitle())
            self.__LOGGER__.log(
                'Connection ERROR : Failed to open page (' +
                self.buildHref(episodeStreamItem.getHref()) + ')',
                xbmc.LOGERROR)

        return elementList
예제 #13
0
 def searchMovie(self, title):
     """
         Method to search a movie
         @return a list of StreamItem
     """
     # Use post http://mega-stream.fr/recherche
     #
     # search:3
     #
     
     post_href = '/recherche'
     # Data to post
     data = {'search':title}
     response = self.postPage(post_href, data)
     
     elementList = []
     
     if response and response.getcode() == 200:    
         content = response.read()
         soup = BeautifulSoup(content)      
         
         # ___ The first sectio is for movie       
         movies = soup.findAll('div',{'class':'section'})[0].findAll('div',{'class':'movie-item ignore-select'})
         
         for index in range(0,len(movies)):
             
             movie = movies[index] 
                            
             title = movie.find('img')['alt'].encode('UTF-8')
             title = strUtil.unescapeHtml(str(title))
             
             self.__LOGGER__.log("Finded title: "+title,xbmc.LOGDEBUG)
             href = movie.find('div',{'class':'movie-series'}).find('a')['href']
             titleExtract = movie.find('div',{'class':'movie-series'}).find('a').text.encode('UTF-8')
             year = strUtil.getYearFromTitle(titleExtract) 
             quality = strUtil.getQualityFromTitle(titleExtract)  
             lang = strUtil.getLangFromTitle(titleExtract)
             title = strUtil.cleanTitle(title)                
             self.__LOGGER__.log("Clean title: "+str(title),xbmc.LOGDEBUG)        
             
             # __ Create the element
             element = StreamItem(title)
             element.setHref(href)                
             element.setYear(year)             
             if movie.find('span') is not None:
                 element.setQuality(movie.find('span').text.encode('UTF-8'))             
             element.setLang(lang)
             element.setAction(StreamItem.ACTION_DISPLAY_LINKS)
             element.setType(StreamItem.TYPE_MOVIE)
             element.setSourceId(self.ID)  
             element.setIconImage(movie.find('img')['src'])                  
                             
             
             # __ Add the element to the list
             elementList.append(element)
     
         
         
     # ___ Error during search the movie
     else:
         miscFunctions.displayNotification('Unable to search Movie ' + title)                   
         self.__LOGGER__.log('Connection ERROR : Failed to open page (' + self.buildHref(post_href) + ')', xbmc.LOGERROR)
 
     return elementList