Example #1
0
 def recommend_album(self, one_album):
     the_url     = "http://%s:%d/rec/%d/%d/" % (config.RECOMMEND_SERVER, config.RECOMMEND_PORT, self.cp_id, one_album.album_id)
     logging.info(the_url)
     the_data    = utils.retry_http_download_data(the_url, config.MAX_RETRY_COUNT)
     if(the_data == None):
         logging.error("url=[%s], data=[%s]"%(the_url, "None"))
         return False
     return True
Example #2
0
 def get_albums(self):
     #http://10.53.130.22:8102/cal/1/1/1/
     the_url     = "http://%s:%d/cal/%d/%d/%d/" % (config.EPG_SERVER, config.EPG_PORT, self.cp_id, self.channel_id, self.page_no)
     logging.info(the_url)
     the_data    = utils.retry_http_download_data(the_url, config.MAX_RETRY_COUNT)
     if(the_data == None):
         logging.error("url=[%s], data=[%s]"%(the_url, "None"))
         return False
     #logging.info("url=[%s], data=[%s]"%(the_url, the_data))
     ret = self.parse_json(the_data)
     return ret