def enable_share(cookie, tokens, fid_list):
 url = ''.join([const.PAN_URL, 'share/set?channel=chunlei&clienttype=0&web=1', '&bdstoken=', tokens['bdstoken']])
 data = encoder.encode_uri('fid_list={0}&schannel=0&channel_list=[]'.format(fid_list))
 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 enable_share ( cookie , tokens , fid_list ) : url = '' . join ( [ const . PAN_URL , 'share/set?channel=chunlei&clienttype=0&web=1' , '&bdstoken=' , tokens [ 'bdstoken' ] ] ) data = encoder . encode_uri ( 'fid_list={0}&schannel=0&channel_list=[]' . format ( fid_list ) ) 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
fid_list - 是一个list .