def list_subtitles(videos, languages, pool_class=ProviderPool, **kwargs):
 listed_subtitles = defaultdict(list)
 checked_videos = []
 for video in videos:
  if (not check_video(video, languages=languages)):
   logger.info('Skipping video %r', video)
   continue
  checked_videos.append(video)
 if (not checked_videos):
  return listed_subtitles
 with pool_class(**kwargs) as pool:
  for video in checked_videos:
   logger.info('Listing subtitles for %r', video)
   subtitles = pool.list_subtitles(video, (languages - video.subtitle_languages))
   listed_subtitles[video].extend(subtitles)
   logger.info('Found %d subtitle(s)', len(subtitles))
 return listed_subtitles

def list_subtitles ( videos , languages , pool_class = ProviderPool , ** kwargs ) : listed_subtitles = defaultdict ( list ) checked_videos = [ ] for video in videos : if ( not check_video ( video , languages = languages ) ) : logger . info ( 'Skipping video %r' , video ) continue checked_videos . append ( video ) if ( not checked_videos ) : return listed_subtitles with pool_class ( ** kwargs ) as pool : for video in checked_videos : logger . info ( 'Listing subtitles for %r' , video ) subtitles = pool . list_subtitles ( video , ( languages - video . subtitle_languages ) ) listed_subtitles [ video ] . extend ( subtitles ) logger . info ( 'Found %d subtitle(s)' , len ( subtitles ) ) return listed_subtitles
list subtitles .