monitor2.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:LetvCloud 作者: jiangchao0304 项目源码 文件源码
def chkVodFile(checkDate=None):
    checkForFixed=True
    if checkDate ==None:
        checkDate=getNowYmd()
        checkForFixed=False
    #??????
    url=edu_api_course.format(schoolId,checkDate ,'00:00','23:59')
    result = urllib2.urlopen(url, timeout=10).read()
    jsonObj = json.loads(result)
    logging.info("????????")
    if jsonObj["status"]=="0" :
        nowTime = time.localtime()
        for course in jsonObj["data"]:
            if checkForFixed ==True:
                logging.info("????????{0}??".format(checkDate))
                chkVodDone(course)
            else:
                startTime =   time.strptime(course["startTime"],"%H:%M")
                endTime = time.strptime(course["endTime"],"%H:%M")
                if startTime.tm_hour == nowTime.tm_hour and   5< nowTime.tm_min - startTime.tm_min < 10:
                    logging.info("???????????:{0} ??????:{1}".format(time.strftime("%H:%M",nowTime),startTime))
                    chkVodCapture(course)
                if endTime.tm_hour == nowTime.tm_hour and   5< nowTime.tm_min - endTime.tm_min < 10:
                    logging.info("????????,????:{0} ??????:{1}".format(time.strftime("%H:%M",nowTime), endTime))
                    chkVodDone(course)
    else:
        logging.info("{0}-{1}??????".format(schoolId,checkDate))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号