예제 #1
0
파일: view.py 프로젝트: blessworld/kukubird
 def GET(self):
     callback = web.input().callback
     comic_id = web.input().id
     vols, min_capture, max_capture = mirrordb.get_comic_length(comic_id)
     try:
         aka_name = mirrordb.get_comic_aka_name_by_id(comic_id)
     except:
         return render.error("查询出错",'/')
     print callback + '(' + json.dumps({"aka_name":aka_name, "vols":vols, "min_capture":min_capture, "max_capture":max_capture}) + ')'
     return callback + '(' + json.dumps({"aka_name":aka_name, "vols":vols, "min_capture":min_capture, "max_capture":max_capture}) + ')'
예제 #2
0
    def GET(self):

        return '此功能已关闭'
        comic_id = web.input().comic_id        
        
        res = db.query('select * from ' + ComicResource + ' where comic_id="' + comic_id + '"').list()
        comic_aka_name = res[0]['aka_name']
        vol_no, min_capture, max_capture = mirrordb.get_comic_length(int(comic_id))
        
        #如果是卷
        if vol_no > 0:
            for vol in xrange(1, vol_no + 1):
                #先获取每一卷的totalpages
                totalpages = db.query('select  count(page) as count_page from CooComicServerComicURL where comic_id=' + 
                                      str(comic_id) + ' and vol=' + str(vol) + ' group by vol')[0]['count_page']
                for i in xrange(1, int(totalpages) + 1):
                    stri = '%03d' %(i)                
                    url = backregurl + comic_aka_name + '/vol_' + str(vol) + '/' + stri + '.jpg'
                    try:
                        #这里改一下数据库
                        db.insert(ComicURL + 'V2', vol = vol, capture = -1, 
                                  page = stri, url = url, comic_id = comic_id, quality_rank = 0)
                    except:
                        return 'URL已经录入,重复!'
                
        #话
        if min_capture > 0:
            for capture in xrange(min_capture, max_capture + 1):
                #先获取每一话的totalpages
                totalpages = db.query('select  count(page) as count_page from CooComicServerComicURL where comic_id=' + 
                                      str(comic_id) + ' and capture=' + str(capture) + ' group by capture')[0]['count_page']
                for i in xrange(1, int(totalpages) + 1):
                    stri = '%03d' %(i)                
                    url = backregurl + comic_aka_name + '/capture_' + str(capture) + '/' + stri + '.jpg'
                    try:
                        #这里改一下数据库
                        db.insert(ComicURL + 'V2', vol = -1, capture = capture, 
                                  page = stri, url = url, comic_id = comic_id, quality_rank = 0)
                    except:
                        return 'URL已经录入,重复!'
            
        #搞定了,返回一个OK页面
        return 'OK'