Beispiel #1
0
 def _fetch(self, date=''):
     for i in channel():
         if (date!=''):
             full_url = url_builder(i).set_data_by_str(date).build()
         else:
             full_url = url_builder(i).build()
         print full_url
         html_data = urllib2.urlopen(full_url).read()
         self.epg_parser._clean_()
         self.epg_parser.feed(html_data)
         self.model.insert(full_url, self.epg_parser.get_video_list())
Beispiel #2
0
 def GET(self):
     input_data = web.input()
     channel    = input_data.get('channel')
     date       = input_data.get('date')
     model      = db()
     
     if (not channel) or (not date):
         return 'error'
     else:
         url = url_builder(channel).set_data_by_str(date).build()
         
         if (not model.select(url)):
             epg.get(date)
             
         plist = model.select(url)
         if (plist):
             mdict               = {}
             mdict['date']       = date
             mdict['channel']    = channel
             mdict['list']       = []
             mdict['total_size'] = len(plist)
             for prog in plist:
                 tmp              = {}
                 prog             = eval(prog)
                 tmp['time']      = prog[0]
                 tmp['name']      = prog[1]
                 tmp['cover_url'] = "www.qq.com"
                 mdict['list'].append(tmp)
             return json.dumps(mdict)
         else:
             return 'no keys' 
Beispiel #3
0
    def GET(self):
        mdict      = {}
        input_data = web.input()
        day_time   = input_data.get('daytime')
        clock_time = input_data.get('clocktime')

        url  = url_builder('cctv1').set_data_by_str(day_time).build()
        model = db()
            
        if (not model.select(url)):
            epg.get(day_time)
                
        program_list,query_time = db().get_certaintime_list(clock_time, day_time)
        
        for elem in program_list:
            elem['cover_url'] = "www.qq.com"
        mdict['total_size']   = len(program_list)
        mdict['list']         = program_list
        mdict['query_time'] = query_time
        return json.dumps(mdict)
Beispiel #4
0
 def __init__(self, app_info):
     self.results = dict()
     self.app = data.metadata['binary_name']
     # get urls from url_builder
     self.builder = url_builder(app_info)
     self.fuzz_inputs = self.builder.build()