

def _req_lixian_add_task_bt(self, t):
    self._load_signatures()
    url = 'http://115.com/lixian/'
    params = {
        'ct': 'lixian',
        'ac': 'add_task_bt',
    }
    _wanted = []
    for (i, b) in enumerate(t.files):
        if b.selected:
            _wanted.append(str(i))
    wanted = ','.join(_wanted)
    data = {
        'info_hash': t.info_hash,
        'wanted': wanted,
        'savepath': t.name,
        'uid': self.user_id,
        'sign': self._signatures['offline_space'],
        'time': self._lixian_timestamp,
    }
    req = Request(method='POST', url=url, params=params, data=data)
    res = self.http.send(req)
    if res.state:
        return True
    else:
        msg = res.content.get('error_msg')
        self.logger.error(msg)
        raise RequestFailure('Failed to create new task.')

dataset/ETHPy150Open shichao-an/115wangpan/u115/api.py API._req_lixian_add_task_bt/original