# Copyright (C) 2009 Yukikaze
import n_gram
import rec10d
+import datetime
def get_db_key(key,chtxt):
return rec10d.rec10db.select_by_key_in_auto_bayes_key(key, chtxt)
def change_db_epg(chtxt,beforenum,newnum):
def veryfySize(path):
#vsize=[297,497,596,1196]#SD 30m 1h 1.5h 2h
vsize=[245,275,295,591,830]
- vsize=vsize+[325,560,590,602,690,860]
+ vsize=vsize+[325,449,560,590,602,690,860,1237]
#vsize=vsize+[458,916]#HD 30m 1h
#vsize=vsize+[381,895,447]
ret = 0
(opts,args)=parser.parse_args(sys.argv)
if opts.ltitle!="":
sf=searchFolder(opts.ltitle, recordedpath)
- recdblist.printutf8(os.path.join(sf, destNameMKV(opts.ltitle,recpath,sf)+".mp4"))
+ recdblist.printutf8(os.path.join(sf, destNameMP4(opts.ltitle,recpath,sf)+".mp4"))
elif opts.auto:
sa=search_mp4(recpath, recordedpath)
for t in sa:
tnow = datetime.datetime.now()
dtt = bt-tnow
dt = dtt.days * 24 * 60 * 60 + dtt.seconds
- if (dt < 58 * 60 and dt > 20 * 60):
+ if (dt < 58 * 60 and dt > 30 * 60):
bctypet = chdb.chtxtsearch(chtxt)['bctype']
chdatat = rec10d.rec10db.select_by_bctype_epg_ch(bctypet)
dt1 = datetime.datetime.strptime(chdatat[0][5], "%Y-%m-%d %H:%M:%S")-datetime.datetime.now()
print type(inst)
print inst
else:
- recdblist.printutf8("nothing match")
+ recdblist.printutf8(u"追いかけ機能エラー:番組データが見付かりません。")
else:
if rec10d.rec10db.select_by_bctype_epg_ch(bctypet)[0][6] != "0":
rec10d.rec10db.update_status_by_bctype_epg_ch(bctypet, "3")
sys.exit()
+ elif (dt <= 30 * 60 and dt > 20 * 60):
+ recdata = epgdb.searchtime2(title, btime, "5", chtxt)
+ chtxtn = recdata[0]
+ titlen = recdata[1]
+ btimen = recdata[2]
+ etimen = recdata[3]
+ exp = recdata[4]
+ longexp = recdata[5]
+ category=recdata[6]
+ bt = datetime.datetime.strptime(btimen, "%Y-%m-%d %H:%M:%S")
+ et = datetime.datetime.strptime(etimen, "%Y-%m-%d %H:%M:%S")
+ btimen = bt.strftime("%Y-%m-%d %H:%M:%S")
+ etimen = et.strftime("%Y-%m-%d %H:%M:%S")
+ if chtxt != "":
+ try:
+ recdb.del_reckey(typetxtnow, title, chtxt, btime)
+ recdb.rec_reckey(typetxtfinal, titlen, chtxtn, btimen, etimen, opt)
+ recdb.rec_reclog(titlen, chtxtn, btimen, etimen, opt, exp, longexp, category)
+ auto_rec.add_key(chtxt, titlen,exp+" "+longexp)
+ auto_rec.add_key("ALL", titlen,exp+" "+longexp)
+ recdblist.printutf8(u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen)
+ except Exception, inst:
+ print "Error happended in Oikake DB"
+ print type(inst)
+ print inst
elif dt <= 20 * 60:
try:
recdb.del_reckey(typetxtnow, title, chtxt, btime)
encvf=""
txt=""
if isAnime == 1:
- encvf = "-vf yadif=3,pp=l5,framestep=2,"
+ encvf = "-vf yadif=0,"
else:
- encvf = "-vf yadif=3,pp=l5,framestep=2,"
+ encvf = "-vf yadif=0,"
if size == "HD":
encvf = encvf + "scale=1280:720,harddup"
bitrate = "bitrate=" + tv2avi.Bitrate_HD
xmldate['channel:id'] = ""
xmldate['display-name'] = ""
elif name == "programme":
- """
- #ubctype = unicode(bctype)
- #uch = unicode(xmldate['programme:channel'])
- #ustart = unicode(xmldate['programme:start'].replace(" +0900", ""))
- #ustop = unicode(xmldate['programme:stop'].replace(" +0900", ""))
- ###utitle = unicode(xmldate['title'].replace(",", "-"))
- udesc = unicode(xmldate['desc'])
- ulongdesc = unicode(xmldate['longdesc'])
- ucategory = unicode(xmldate['category'])"""
ubctype=bctype
uch=xmldate['programme:channel']
ustart=xmldate['programme:start'].replace(" +0900", "")
tvlists.append([ubctype, uch, ustart, ustop, utitle, udesc,ulongdesc,ucategory])
if auto_rec.calc_key(tch['chtxt'], utitle, udesc+" "+ulongdesc):
recdb.add_auto_bayes(tch['chtxt'],utitle, ustart,ustop)
-
xmldate['title'] = ""
xmldate['desc'] = ""
xmldate['longdesc'] = ""