def list_share_files(cookie, tokens, uk, shareid, dirname, page=1):
 if (not dirname):
  return list_share_single_file(cookie, tokens, uk, shareid)
 url = ''.join([const.PAN_URL, 'share/list?channel=chunlei&clienttype=0&web=1&num=50', '&t=', util.timestamp(), '&page=', str(page), '&dir=', encoder.encode_uri_component(dirname), '&t=', util.latency(), '&shareid=', shareid, '&order=time&desc=1', '&uk=', uk, '&_=', util.timestamp(), '&bdstoken=', tokens['bdstoken']])
 req = net.urlopen(url, headers={'Cookie': cookie.header_output(), 'Referer': const.SHARE_REFERER})
 if req:
  content = req.data
  info = json.loads(content.decode())
  if (info['errno'] == 0):
   return info['list']
 return list_share_single_file(cookie, tokens, uk, shareid)

def list_share_files ( cookie , tokens , uk , shareid , dirname , page = 1 ) : if ( not dirname ) : return list_share_single_file ( cookie , tokens , uk , shareid ) url = '' . join ( [ const . PAN_URL , 'share/list?channel=chunlei&clienttype=0&web=1&num=50' , '&t=' , util . timestamp ( ) , '&page=' , str ( page ) , '&dir=' , encoder . encode_uri_component ( dirname ) , '&t=' , util . latency ( ) , '&shareid=' , shareid , '&order=time&desc=1' , '&uk=' , uk , '&_=' , util . timestamp ( ) , '&bdstoken=' , tokens [ 'bdstoken' ] ] ) req = net . urlopen ( url , headers = { 'Cookie' : cookie . header_output ( ) , 'Referer' : const . SHARE_REFERER } ) if req : content = req . data info = json . loads ( content . decode ( ) ) if ( info [ 'errno' ] == 0 ) : return info [ 'list' ] return list_share_single_file ( cookie , tokens , uk , shareid )
uk - user key shareid - 共享文件的id值 dirname - 共享目录 .