3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009 Yukikaze
26 recpath = configreader.getpath('recpath')
27 movepath = configreader.getpath('move_destpath')
28 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
34 recdb.delete_old("24")
35 recdb.delete_old_auto_bayes("1")
36 recdb.delete_old_auto_keyword("1")
37 tasks = recdb.getnow("2")
38 inum = recdb.countRecNow_minutes("10")
39 print u"番組表更新処理"+ datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
40 print "inum:" + str(inum) + "bscsrec:" + str(status.getBSCSRecording()) + "terec:" + str(status.getTERecording())
43 dnow=datetime.datetime.now()
44 if dnow.hour==12 and dnow.minute<5 :
49 for k in recdb.get_key():
57 auto_process.auto_check(recpath)
59 update = chdb.update()
69 if bctype.find('te') > -1:
70 recnum = status.getTERecording() + recdb.countRecNow_minutes_TE("10")
71 print bctype + "//ing:" + str(status.getTERecording()) + ":task:" + str(recdb.countRecNow_minutes_TE("10"))
73 recnum = status.getBSCSRecording() + recdb.countRecNow_minutes_BSCS("10")
74 print bctype + "//ing:" + str(status.getBSCSRecording()) + ":task:" + str(recdb.countRecNow_minutes_BSCS("10"))
77 rec10d.rec10db.update_status_by_bctype_epg_ch(bctype, "0")
78 epgdb.updatebc(bctype)
79 update = chdb.update()
86 typetxt = task["type"]
97 bt = datetime.datetime.strptime(btime, "%Y-%m-%d %H:%M:%S")
100 bt = datetime.datetime.strptime("2009-01-01 00:00:00", "%Y-%m-%d %H:%M:%S")
102 etime = task['etime']
103 et = datetime.datetime.strptime(etime, "%Y-%m-%d %H:%M:%S")
106 et = datetime.datetime.strptime("2009-01-01 00:00:00", "%Y-%m-%d %H:%M:%S")
111 tnow = datetime.datetime.now()
113 dt = dtt.days * 24 * 60 * 60 + dtt.seconds
114 if task["type"] == recdblist.REC_RESERVE:#"res,"+chtxt+","+title+","+btime+","+etime+","+opt
116 if pid != 0:#親プロセスの場合
118 else:#子プロセスの場合 アップデートを行って終了
119 type_reserve(task["type"],chtxt,title,bt,et,opt)
121 elif task["type"] == recdblist.REC_KEYWORD:#"key,"+chtxt+","+keyword+","+btime+","+deltatime+","+opt
122 deltatime = task['deltatime']
124 if pid != 0:#親プロセスの場合
126 else:#子プロセスの場合 アップデートを行って終了
127 type_keyword(task["type"],chtxt,title, bt, et, opt, deltatime)
129 elif task["type"] == recdblist.REC_KEYWORD_EVERY_SOME_DAYS:#"keyevery,"+chtxt+","+keyword+","+btime+","+deltatime+","+opt+","+deltaday
130 deltatime = task['deltatime']
131 deltaday = task['deltaday']
133 if pid != 0:#親プロセスの場合
135 else:#子プロセスの場合 アップデートを行って終了
136 type_keyword_every_day(task["type"],chtxt, title, bt, et, opt, deltatime, deltaday)
138 elif task["type"] == recdblist.REC_FINAL_RESERVE:#"rec,"+chtxt+","+title+","+btime+","+etime+","+opt
140 if pid != 0:#親プロセスの場合
142 else:#子プロセスの場合 アップデートを行って終了
143 type_final(task["type"],chtxt, title, bt, et, opt)
145 elif task["type"] == recdblist.REC_TS_DECODE_QUE:
148 if pid != 0:#親プロセスの場合
150 else:#子プロセスの場合 アップデートを行って終了
152 type_decode_que(task["type"],chtxt, title, bt, et, opt)
154 elif task["type"] == recdblist.REC_ENCODE_QUE:
155 encodenum=encodenum+1
157 if pid != 0:#親プロセスの場合
159 else:#子プロセスの場合 アップデートを行って終了
160 time.sleep(5*encodenum)
161 type_encode_que(task["type"],chtxt, title, bt, et, opt)
163 elif task["type"] == recdblist.REC_AVI_TO_MKV:
169 recdb.del_reckey(recdblist.REC_AVI_TO_MKV, title, chtxt, btime)
170 recdb.rec_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime, etime, opt)
171 tv2mkv.avi2mkv(os.path.join(recpath,title+".avi"),os.path.join(recpath,title+".mkv"))
172 recdb.del_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime)
174 elif task["type"] == recdblist.REC_AVI_TO_MP4:
180 recdb.del_reckey(recdblist.REC_AVI_TO_MP4, title, chtxt, btime)
181 recdb.rec_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime, etime, opt)
182 tv2mp4.avi2mp4(os.path.join(recpath,title+".avi"),os.path.join(recpath,title+".mp4"))
183 recdb.del_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime)
185 elif task["type"] == recdblist.REC_MKV_TO_MP4:
191 recdb.del_reckey(recdblist.REC_AVI_TO_MP4, title, chtxt, btime)
192 recdb.rec_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime, etime, opt)
193 tv2mp4.mkv2mp4(os.path.join(recpath,title+".mkv"),os.path.join(recpath,title+".mp4"))
194 recdb.del_reckey(recdblist.REC_CHANGING_CANTAINER, title, chtxt, btime)
196 elif task["type"] == recdblist.REC_AUTO_KEYWORD:#"key,"+chtxt+","+keyword+","+btime+","+deltatime+","+opt
199 recdatum = epgdb.searchtime_auto(title, btime, deltatime, chtxt)
200 for recdata in recdatum:
209 btt = datetime.datetime.strptime(btimet, "%Y-%m-%d %H:%M:%S")
210 ett = datetime.datetime.strptime(etimet, "%Y-%m-%d %H:%M:%S")
211 btimet = btt.strftime("%Y-%m-%d %H:%M:%S")
212 etimet = ett.strftime("%Y-%m-%d %H:%M:%S")
214 recdb.rec_reckey(recdblist.REC_AUTO_SUGGEST_REC, titlet, chtxtt, btimet, etimet, opt)
215 except Exception, inst:
218 dd = datetime.timedelta(days=1)
221 btxt = bt.strftime("%Y-%m-%d %H:%M:%S")
222 etxt = et.strftime("%Y-%m-%d %H:%M:%S")
224 recdb.del_reckey(recdblist.REC_AUTO_KEYWORD, title, chtxt, btime)
225 recdb.auto_keyreserv(title, chtxt, btxt, etxt, "24", opt)
226 except Exception, inst:
229 elif task["type"] == recdblist.REC_MOVE_AFTER_RECORD:#"res,"+chtxt+","+title+","+btime+","+etime+","+opt
231 if pid != 0:#親プロセスの場合
233 else:#子プロセスの場合 アップデートを行って終了
234 type_reserve(task["type"],chtxt,title,bt,et,opt)
236 elif task["type"] == recdblist.REC_MOVE_AFTER_DECODE:#"res,"+chtxt+","+title+","+btime+","+etime+","+opt
238 if pid != 0:#親プロセスの場合
240 else:#子プロセスの場合 アップデートを行って終了
241 type_reserve(task["type"],chtxt,title,bt,et,opt)
243 elif task["type"] == recdblist.REC_MOVE_AFTER_ENCODE:#"res,"+chtxt+","+title+","+btime+","+etime+","+opt
245 if pid != 0:#親プロセスの場合
247 else:#子プロセスの場合 アップデートを行って終了
248 type_reserve(task["type"],chtxt,title,bt,et,opt)
250 elif task["type"] == recdblist.REC_MOVE_AFTER_RECORD_FINAL:#"rec,"+chtxt+","+title+","+btime+","+etime+","+opt
252 if pid != 0:#親プロセスの場合
254 else:#子プロセスの場合 アップデートを行って終了
255 type_final(task["type"],chtxt, title, bt, et, opt)
257 elif task["type"] == recdblist.REC_MOVE_AFTER_DECODE_FINAL:#"rec,"+chtxt+","+title+","+btime+","+etime+","+opt
259 if pid != 0:#親プロセスの場合
261 else:#子プロセスの場合 アップデートを行って終了
262 type_final(task["type"],chtxt, title, bt, et, opt)
264 elif task["type"] == recdblist.REC_MOVE_AFTER_ENCODE_FINAL:#"rec,"+chtxt+","+title+","+btime+","+etime+","+opt
266 if pid != 0:#親プロセスの場合
268 else:#子プロセスの場合 アップデートを行って終了
269 type_final(task["type"],chtxt, title, bt, et, opt)
271 elif task["type"] == recdblist.REC_MOVE_AFTER_DECODE_DECODE_QUE:
274 if pid != 0:#親プロセスの場合
276 else:#子プロセスの場合 アップデートを行って終了
278 type_decode_que(task["type"],chtxt, title, bt, et, opt)
280 elif task["type"] == recdblist.REC_MOVE_AFTER_ENCODE_DECODE_QUE:
283 if pid != 0:#親プロセスの場合
285 else:#子プロセスの場合 アップデートを行って終了
288 type_decode_que(task["type"],chtxt, title, bt, et, opt)
290 elif task["type"] == recdblist.REC_MOVE_AFTER_ENCODE_ENCODE_QUE:
291 encodenum=encodenum+1
293 if pid != 0:#親プロセスの場合
295 else:#子プロセスの場合 アップデートを行って終了
296 time.sleep(5*encodenum)
297 type_encode_que(task["type"],chtxt, title, bt, et, opt)
300 def search_keyword(key):
301 tnow = datetime.datetime.now()
302 nows =tnow.strftime("%Y-%m-%d %H:%M:%S")
304 recdatum = epgdb.searchtime_auto(k,nows, "144")
305 for recdata in recdatum:
311 btt = datetime.datetime.strptime(btimet, "%Y-%m-%d %H:%M:%S")
312 ett = datetime.datetime.strptime(etimet, "%Y-%m-%d %H:%M:%S")
313 btimet = btt.strftime("%Y-%m-%d %H:%M:%S")
314 etimet = ett.strftime("%Y-%m-%d %H:%M:%S")
316 recdb.add_auto_keyword(chtxtt, titlet, btimet, etimet)
317 except Exception, inst:
320 def type_reserve(typetxt,chtxt,title,bt,et,opt):
321 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
322 etime = et.strftime("%Y-%m-%d %H:%M:%S")
325 if typetxt==recdblist.REC_RESERVE:
326 typetxtfinal=recdblist.REC_FINAL_RESERVE
327 elif typetxt==recdblist.REC_MOVE_AFTER_DECODE:
328 typetxtfinal=recdblist.REC_MOVE_AFTER_DECODE_FINAL
329 elif typetxt==recdblist.REC_MOVE_AFTER_RECORD:
330 typetxtfinal=recdblist.REC_MOVE_AFTER_RECORD_FINAL
331 elif typetxt==recdblist.REC_MOVE_AFTER_ENCODE:
332 typetxtfinal=recdblist.REC_MOVE_AFTER_ENCODE_FINAL
333 tnow = datetime.datetime.now()
335 dt = dtt.days * 24 * 60 * 60 + dtt.seconds
336 if (dt < 58 * 60 and dt > 20 * 60):
337 bctypet = chdb.chtxtsearch(chtxt)['bctype']
338 chdatat = rec10d.rec10db.select_by_bctype_epg_ch(bctypet)
339 dt1 = datetime.datetime.strptime(chdatat[0][5], "%Y-%m-%d %H:%M:%S")-datetime.datetime.now()
340 dt1 = dt1.days * 24 * 60 * 60 + dt1.seconds
342 recdata = epgdb.searchtime2(title, btime, "5", chtxt)
350 bt = datetime.datetime.strptime(btimen, "%Y-%m-%d %H:%M:%S")
351 et = datetime.datetime.strptime(etimen, "%Y-%m-%d %H:%M:%S")
352 btimen = bt.strftime("%Y-%m-%d %H:%M:%S")
353 etimen = et.strftime("%Y-%m-%d %H:%M:%S")
356 recdb.del_reckey(typetxtnow, title, chtxt, btime)
357 recdb.rec_reckey(typetxtfinal, titlen, chtxtn, btimen, etimen, opt)
358 recdb.rec_reclog(titlen, chtxtn, btimen, etimen, opt, exp, longexp, category)
359 auto_rec.add_key(chtxt, titlen,exp+" "+longexp)
360 auto_rec.add_key("ALL", titlen,exp+" "+longexp)
361 print "Oikake "+title+" : "+titlen+" "+btimen+" "+etimen
362 except Exception, inst:
363 print "Error happended in Oikake DB"
367 print "nothing match"
369 if rec10d.rec10db.select_by_bctype_epg_ch(bctypet)[0][6] != "0":
370 rec10d.rec10db.update_status_by_bctype_epg_ch(bctypet, "3")
374 recdb.del_reckey(typetxtnow, title, chtxt, btime)
375 recdb.rec_reckey(typetxtfinal, title, chtxt, btime, etime, opt)
376 except Exception, inst:
379 def type_final(typetxt,chtxt,title,bt,et,opt):
380 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
381 etime = et.strftime("%Y-%m-%d %H:%M:%S")
385 if typetxt==recdblist.REC_FINAL_RESERVE:
386 typetxting=recdblist.REC_TS_RECORDING
387 typetxtdecque=recdblist.REC_TS_DECODE_QUE
388 elif typetxt==recdblist.REC_MOVE_AFTER_DECODE_FINAL:
389 typetxting=recdblist.REC_MOVE_AFTER_DECODE_RECORDING
390 typetxtdecque=recdblist.REC_MOVE_AFTER_DECODE_DECODE_QUE
391 elif typetxt==recdblist.REC_MOVE_AFTER_RECORD_FINAL:
392 typetxting=recdblist.REC_MOVE_AFTER_RECORD_RECORDING
394 elif typetxt==recdblist.REC_MOVE_AFTER_ENCODE_FINAL:
395 typetxting=recdblist.REC_MOVE_AFTER_ENCODE_RECORDING
396 typetxtdecque=recdblist.REC_MOVE_AFTER_ENCODE_DECODE_QUE
397 tnow = datetime.datetime.now()
399 dt = dtt.days * 24 * 60 * 60 + dtt.seconds
401 if dt < 6 * 60 and dt > 0:
402 recdb.del_reckey(typetxtnow, title, chtxt, btime)
403 recdb.rec_reckey(typetxting, title, chtxt, btime, etime, opt)
404 print u"録画開始 "+title+" "+btime+" "+etime
407 testpath=[os.path.join(recpath,title+".ts.b25")]
408 testpath.append(os.path.join(recpath,title+".ts"))
409 testpath.append(os.path.join(recpath,title+".avi"))
410 testpath.append(os.path.join(recpath,title+".mkv"))
411 testpath.append(os.path.join(recpath,title+".log"))
414 if os.path.exists(ti):
417 ttitle=title+"_"+datetime.datetime.now().strftime("%Y%m%d%H%M")
418 tv2avi.timetv2b25(recpath + "/" + ttitle + ".avi", chtxt, btime, etime, opt)
419 recdb.del_reckey(typetxting, title, chtxt, btime)
420 if typetxtdecque != "":
421 tnow = datetime.datetime.now()
422 bt = datetime.datetime.strptime(btime, "%Y-%m-%d %H:%M:%S")
423 et = datetime.datetime.strptime(etime, "%Y-%m-%d %H:%M:%S")
425 bt = tnow + datetime.timedelta(seconds=600)
426 et = et + dt + datetime.timedelta(seconds=600)
427 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
428 etime = et.strftime("%Y-%m-%d %H:%M:%S")
429 recdb.rec_reckey(typetxtdecque, ttitle, chtxt, btime, etime, opt)
431 shutil.copy(os.path.join(recpath,title+".ts.b25"), os.path.join(movepath,title+".ts.b25"))
433 def type_keyword(typetxt,chtxt,title,bt,et,opt,deltatime):
434 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
435 etime = et.strftime("%Y-%m-%d %H:%M:%S")
438 if typetxt==recdblist.REC_KEYWORD:
439 typetxtres=recdblist.REC_RESERVE
440 tnow = datetime.datetime.now()
442 dt = dtt.days * 24 * 60 * 60 + dtt.seconds
445 recdata = epgdb.searchtime2(title, btime, deltatime, chtxt)
454 bt = datetime.datetime.strptime(btimet, "%Y-%m-%d %H:%M:%S")
455 et = datetime.datetime.strptime(etimet, "%Y-%m-%d %H:%M:%S")
456 btimet = bt.strftime("%Y-%m-%d %H:%M:%S")
457 etimet = et.strftime("%Y-%m-%d %H:%M:%S")
459 recdb.del_reckey(typetxtnow, title, chtxt, btime)
460 recdb.rec_reckey(typetxtres, titlet, chtxtt, btimet, etimet, opt)
461 recdb.rec_reclog(titlet, chtxtt, btimet, etimet, opt, exp,longexp,category)
462 auto_rec.add_key(chtxt, titlet,exp+" "+longexp)
463 auto_rec.add_key("ALL", titlet,exp+" "+longexp)
464 print u"key "+title+u" : "+titlet+u" "+btimet+u" "+etimet
465 #except Exception, inst:
466 # print "Error happened in REC_KEYWORD DB"
470 print "nothing match"
472 def type_keyword_every_day(type,chtxt,title,bt,et,opt,deltatime,deltaday):
473 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
474 etime = et.strftime("%Y-%m-%d %H:%M:%S")
475 tnow = datetime.datetime.now()
477 dt = dtt.days * 24 * 60 * 60 + dtt.seconds
478 dd = datetime.timedelta(days=int(deltaday))
480 recdb.del_reckey(recdblist.REC_KEYWORD_EVERY_SOME_DAYS, title, chtxt, btime)
483 btxt = bt.strftime("%Y-%m-%d %H:%M:%S")
484 etxt = et.strftime("%Y-%m-%d %H:%M:%S")
485 recdb.everyreserv(title, chtxt, btxt, etxt, deltatime, opt, deltaday)
487 recdb.keyreserv(title, chtxt, btime, etime, deltatime, opt)
488 recdb.del_reckey(recdblist.REC_KEYWORD_EVERY_SOME_DAYS, title, chtxt, btime)
491 btxt = bt.strftime("%Y-%m-%d %H:%M:%S")
492 etxt = et.strftime("%Y-%m-%d %H:%M:%S")
493 recdb.everyreserv(title, chtxt, btxt, etxt, deltatime, opt, deltaday)
496 def type_decode_que(typetxt,chtxt,title,bt,et,opt):
497 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
498 etime = et.strftime("%Y-%m-%d %H:%M:%S")
499 tnow = datetime.datetime.now()
501 dt = dtt.days * 24 * 60 * 60 + dtt.seconds
506 if typetxt== recdblist.REC_TS_DECODE_QUE:
507 typetxting=recdblist.REC_TS_DECODING
508 typetxtmiss=recdblist.REC_MISS_DECODE
509 typetxtencque=recdblist.REC_ENCODE_QUE
510 elif typetxt== recdblist.REC_MOVE_AFTER_DECODE_DECODE_QUE:
511 typetxting=recdblist.REC_MOVE_AFTER_DECODE_DECODING
512 typetxtmiss=recdblist.REC_MISS_DECODE
514 elif typetxt== recdblist.REC_MOVE_AFTER_ENCODE_DECODE_QUE:
515 typetxting=recdblist.REC_MOVE_AFTER_ENCODE_DECODING
516 typetxtmiss=recdblist.REC_MISS_DECODE
517 typetxtencque=recdblist.REC_MOVE_AFTER_ENCODE_ENCODE_QUE
518 tnow = datetime.datetime.now()
520 dt = dtt.days * 24 * 60 * 60 + dtt.seconds
522 if status.getB25Decoding() < 2:
523 pin = recpath + "/" + title
524 recdb.del_reckey(typetxtnow, title, chtxt, btime)
525 recdb.rec_reckey(typetxting, title, chtxt, btime, etime, opt)
526 tv2avi.b252ts(pin, chtxt, btime, etime, opt)
527 recdb.del_reckey(typetxting, title, chtxt, btime)
528 if not os.access(recpath + "/" + title + ".ts", os.F_OK):
529 recdb.del_reckey(typetxting, title, chtxt, btime)
530 recdb.rec_reckey(typetxtmiss, title, chtxt, btime, etime, opt)
531 bt = datetime.datetime.strptime(btime, "%Y-%m-%d %H:%M:%S")
532 et = datetime.datetime.strptime(etime, "%Y-%m-%d %H:%M:%S")
534 if not typetxtencque=="":
535 tnow = datetime.datetime.now()
536 bt = tnow + datetime.timedelta(seconds=600)
538 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
539 etime = et.strftime("%Y-%m-%d %H:%M:%S")
540 recdb.rec_reckey(typetxtencque, title, chtxt, btime, etime, opt)
542 if opt.rfind("d")>=0:
543 shutil.copy(os.path.join(recpath,title+".sa.avi"),os.path.join(movepath,title+".sa.avi"))
544 elif opt.rfind("5")>=0:
545 shutil.copy(os.path.join(recpath,title+".sa.avi"),os.path.join(movepath,title+".sa.avi"))
547 shutil.copy(os.path.join(recpath,title+".ts"), os.path.join(movepath,title+".ts"))
548 #print checker.checkB25Decode(recpath + "/" + title + ".ts.b25", recpath + "/" + title + ".ts")
549 if checker.checkB25Decode(recpath + "/" + title + ".ts.b25", recpath + "/" + title + ".ts") == 1:
550 os.remove(recpath + "/" + title + ".ts.b25")
552 recdb.del_reckey(typetxtnow, title, chtxt, btime)
553 bt = bt + datetime.timedelta(seconds=600)
554 et = et + datetime.timedelta(seconds=600)
555 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
556 etime = et.strftime("%Y-%m-%d %H:%M:%S")
557 recdb.rec_reckey(typetxtnow, title, chtxt, btime, etime, opt)
560 def type_encode_que(typetxt,chtxt,title,bt,et,opt):
561 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
562 etime = et.strftime("%Y-%m-%d %H:%M:%S")
563 tnow = datetime.datetime.now()
565 dt = dtt.days * 24 * 60 * 60 + dtt.seconds
569 if typetxt==recdblist.REC_ENCODE_QUE:
570 typetxting=recdblist.REC_ENCODE_LOCAL
571 typetxtfin=recdblist.REC_FIN_LOCAL
572 elif typetxt==recdblist.REC_MOVE_AFTER_ENCODE_ENCODE_QUE:
573 typetxting=recdblist.REC_ENCODE_LOCAL
574 typetxtfin=recdblist.REC_MOVE_END
576 if status.getEncoding() < int(configreader.getenv("enc_max")):
578 pin = recpath + "/" + title + ".ts"
579 if re.search("d", opt):
580 pin = recpath + "/" + title + ".sa.avi"
581 if re.search("5", opt):
582 pin = recpath + "/" + title + ".sa.avi"
583 #pout = recpath + "/" + title + ".avi"
584 pout = recpath + "/" + title + ".mp4"
585 print [pin, pout, opt]
587 #print pin+":"+pout+":"+opt
588 recdb.del_reckey(typetxtnow, title, chtxt, btime)
589 recdb.rec_reckey(typetxting, title, chtxt, btime, etime, opt)
590 #tv2mkv.ts2mkv(pin, pout, opt)
591 tv2mp4.ts2mp4(pin, pout, opt)
592 #tv2avi.ts2avi(pin, pout, opt)
593 recdb.del_reckey(typetxting, title, chtxt, btime)
594 if typetxtfin==recdblist.REC_MOVE_END:
595 shutil.copy(os.path.join(recpath,title+".mp4"), os.path.join(movepath,title+".mp4"))
596 recdb.rec_reckey(typetxtfin, title, chtxt, btime, etime, opt)
599 recdb.del_reckey(typetxtnow, title, chtxt, btime)
600 bt = bt + datetime.timedelta(seconds=600)
601 et = et + datetime.timedelta(seconds=600)
602 btime = bt.strftime("%Y-%m-%d %H:%M:%S")
603 etime = et.strftime("%Y-%m-%d %H:%M:%S")
604 recdb.rec_reckey(typetxtnow, title, chtxt, btime, etime, opt)