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))
评论列表
文章目录