def cloud_cancel_task(cookie, tokens, task_id):
 url = ''.join([const.PAN_URL, 'rest/2.0/services/cloud_dl', '?bdstoken=', tokens['bdstoken'], '&task_id=', str(task_id), '&method=cancel_task&app_id=250528', '&t=', util.timestamp(), '&channel=chunlei&clienttype=0&web=1'])
 req = net.urlopen(url, headers={'Cookie': cookie.header_output()})
 if req:
  content = req.data
  return json.loads(content.decode())
 else:
  return None

def cloud_cancel_task ( cookie , tokens , task_id ) : url = '' . join ( [ const . PAN_URL , 'rest/2.0/services/cloud_dl' , '?bdstoken=' , tokens [ 'bdstoken' ] , '&task_id=' , str ( task_id ) , '&method=cancel_task&app_id=250528' , '&t=' , util . timestamp ( ) , '&channel=chunlei&clienttype=0&web=1' ] ) req = net . urlopen ( url , headers = { 'Cookie' : cookie . header_output ( ) } ) if req : content = req . data return json . loads ( content . decode ( ) ) else : return None
task_id - 之前建立离线下载任务时的task id .