def restore_trash(cookie, tokens, fidlist):
 url = ''.join([const.PAN_API_URL, 'recycle/restore?channel=chunlei&clienttype=0&web=1', '&t=', util.timestamp(), '&bdstoken=', tokens['bdstoken']])
 data = ('fidlist=' + encoder.encode_uri_component(json.dumps(fidlist)))
 req = net.urlopen(url, headers={'Cookie': cookie.header_output(), 'Content-type': const.CONTENT_FORM_UTF8}, data=data.encode())
 if req:
  content = req.data
  return json.loads(content.decode())
 else:
  return None

def restore_trash ( cookie , tokens , fidlist ) : url = '' . join ( [ const . PAN_API_URL , 'recycle/restore?channel=chunlei&clienttype=0&web=1' , '&t=' , util . timestamp ( ) , '&bdstoken=' , tokens [ 'bdstoken' ] ] ) data = ( 'fidlist=' + encoder . encode_uri_component ( json . dumps ( fidlist ) ) ) req = net . urlopen ( url , headers = { 'Cookie' : cookie . header_output ( ) , 'Content-type' : const . CONTENT_FORM_UTF8 } , data = data . encode ( ) ) if req : content = req . data return json . loads ( content . decode ( ) ) else : return None
fildlist - 要还原的文件/目录列表 .