def fetch_if_no_local_subtitles(self, sub_savedir=None): info = self.__info if not info['subtitle']: # if parse_local_subtitles() not done info['subtitle'] = defaultdict(bool) if info['subtitle']['embed'] and set(info['subtitle']['embed'])&{'chs','cht','chn','chi','zh','tw','hk'}: # have Chinese text subtitles pass elif info['subtitle']['external']: # TODO: language? pass else: info['subtitle']['remote'] = subtitle.fetch_and_save_subtitle(info['abspath'], info['shash'], sub_savedir) for s in info['subtitle']['remote']: singleton.get_mplayer().send('sub_load "{0}"'.format(s)) singleton.get_mplayer().send('sub_file 0')
def fetch_if_no_local_subtitles(self, sub_savedir=None): info = self.__info if not info['subtitle']: # if parse_local_subtitles() not done info['subtitle'] = defaultdict(bool) if info['subtitle']['embed'] and set(info['subtitle']['embed']) & { 'chs', 'cht', 'chn', 'chi', 'zh', 'tw', 'hk' }: # have Chinese text subtitles pass elif info['subtitle']['external']: # TODO: language? pass else: info['subtitle']['remote'] = subtitle.fetch_and_save_subtitle( info['abspath'], info['shash'], sub_savedir) for s in info['subtitle']['remote']: singleton.get_mplayer().send('sub_load "{0}"'.format(s)) singleton.get_mplayer().send('sub_file 0')
def fetch_remote_subtitles(self, sub_savedir=None): info = self.__info subtitle.fetch_and_save_subtitle(info['abspath'], info['shash'], sub_savedir)