def add_torrent_task(self, torrent_path, save_path='<STR_LIT:/>', selected_idx=(), **kwargs):
<EOL>torrent_handler = open(torrent_path, '<STR_LIT:rb>')<EOL>basename = os.path.basename(torrent_path)<EOL>self.delete(['<STR_LIT:/>' + basename])<EOL>response = self.upload('<STR_LIT:/>', torrent_handler, basename).json()<EOL>remote_path = response['<STR_LIT:path>']<EOL>logging.debug('<STR_LIT>' + remote_path)<EOL>response = self._get_torrent_info(remote_path).json()<EOL>if response.get('<STR_LIT>'):<EOL><INDENT>print(response.get('<STR_LIT>'))<EOL>return<EOL><DEDENT>if not response['<STR_LIT>']['<STR_LIT>']:<EOL><INDENT>return<EOL><DEDENT>if isinstance(selected_idx, (tuple, list, set)):<EOL><INDENT>if len(selected_idx) > <NUM_LIT:0>:<EOL><INDENT>selected_idx = '<STR_LIT:U+002C>'.join(map(str, selected_idx))<EOL><DEDENT>else:<EOL><INDENT>selected_idx = '<STR_LIT:U+002C>'.join(map(str, range(<NUM_LIT:1>, len(response['<STR_LIT>']['<STR_LIT>']) + <NUM_LIT:1>)))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>selected_idx = '<STR_LIT>'<EOL><DEDENT>data = {<EOL>'<STR_LIT>': response['<STR_LIT>']['<STR_LIT>'],<EOL>'<STR_LIT>': save_path,<EOL>'<STR_LIT>': selected_idx,<EOL>'<STR_LIT>': '<STR_LIT:1>',<EOL>'<STR_LIT>': remote_path,<EOL>'<STR_LIT:type>': '<STR_LIT:2>'  <EOL>}<EOL>url = '<STR_LIT>'.format(BAIDUPAN_SERVER)<EOL>return self._request('<STR_LIT>', '<STR_LIT>', url=url, data=data, **kwargs)<EOL>
添加本地BT任务

:param torrent_path: 本地种子的路径

:param save_path: 远程保存路径

:param selected_idx: 要下载的文件序号 —— 集合为空下载所有，非空集合指定序号集合，空串下载默认

:return: requests.Response

    .. note::
        返回正确时返回的 Reponse 对象 content 中的数据结构

        {"task_id":任务编号,"rapid_download":是否已经完成（急速下载）,"request_id":请求识别号}