def get_category(cookie, tokens, category, page=1):
 timestamp = util.timestamp()
 url = ''.join([const.PAN_API_URL, 'categorylist?channel=chunlei&clienttype=0&web=1', '&category=', str(category), '&pri=-1&num=100', '&t=', timestamp, '&page=', str(page), '&order=time&desc=1', '&_=', timestamp, '&bdstoken=', cookie.get('STOKEN').value])
 req = net.urlopen(url, headers={'Cookie': cookie.header_output()})
 if req:
  content = req.data
  return json.loads(content.decode())
 else:
  return None

def get_category ( cookie , tokens , category , page = 1 ) : timestamp = util . timestamp ( ) url = '' . join ( [ const . PAN_API_URL , 'categorylist?channel=chunlei&clienttype=0&web=1' , '&category=' , str ( category ) , '&pri=-1&num=100' , '&t=' , timestamp , '&page=' , str ( page ) , '&order=time&desc=1' , '&_=' , timestamp , '&bdstoken=' , cookie . get ( 'STOKEN' ) . value ] ) req = net . urlopen ( url , headers = { 'Cookie' : cookie . header_output ( ) } ) if req : content = req . data return json . loads ( content . decode ( ) ) else : return None
get a category from the database .