Exemplo n.º 1
0
 def search(self, video_type, title, year, season=''):  # @UnusedVariable
     results = []
     if video_type == VIDEO_TYPES.MOVIE:
         results = self.__movie_search(title, year)
     else:
         norm_title = scraper_utils.normalize_title(title)
         html = self._http_get(self.base_url, cache_limit=48)
         for item in scraper_utils.parse_directory(self, html):
             if norm_title in scraper_utils.normalize_title(item['title']) and item['directory']:
                 result = {'url': scraper_utils.pathify_url(item['link']), 'title': scraper_utils.cleanse_title(item['title']), 'year': ''}
                 results.append(result)
     return results
Exemplo n.º 2
0
 def __movie_search(self, title, year):
     results = []
     norm_title = scraper_utils.normalize_title(title)
     html = self._http_get(self.base_url, cache_limit=48)
     for item in scraper_utils.parse_directory(self, html):
         if not item['directory']:
             meta = scraper_utils.parse_movie_link(item['title'])
             if meta['dubbed']: continue
             if (norm_title in scraper_utils.normalize_title(meta['title'])) and (not year or not meta['year'] or year == meta['year']):
                 match_title = meta['title'].replace('.', ' ')
                 match_title += ' [%sp.%s]' % (meta['height'], meta['extra'])
                 result = {'url': scraper_utils.pathify_url(item['link']), 'title': scraper_utils.cleanse_title(match_title), 'year': meta['year']}
                 results.append(result)
     return results