OSDN Git Service

fix oikake bug.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sun, 29 Nov 2009 04:45:07 +0000 (04:45 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sun, 29 Nov 2009 04:45:07 +0000 (04:45 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@283 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/auto_rec.py
rec10/trunk/src/classify.py
rec10/trunk/src/timerec.py
rec10/trunk/src/ts2x264.py
rec10/trunk/src/xml2db.py

index c268916..5fc6e31 100644 (file)
@@ -4,6 +4,7 @@
 # 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):
index c1cc076..60ba905 100644 (file)
@@ -113,7 +113,7 @@ def search_mp4(temppath,recpath):
 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
@@ -267,7 +267,7 @@ if __name__ == "__main__":
     (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:
index 62a1400..6e232b4 100644 (file)
@@ -260,7 +260,7 @@ def type_reserve(typetxt,chtxt,title,bt,et,opt):
     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()
@@ -291,11 +291,36 @@ def type_reserve(typetxt,chtxt,title,bt,et,opt):
                     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)
index c59ae0e..3c8ec3d 100644 (file)
@@ -35,9 +35,9 @@ def encode(pin,pout,size,isAnime,is2pass):
     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
index 2100d71..da6213e 100644 (file)
@@ -70,15 +70,6 @@ def end_element(name):
             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", "")
@@ -98,7 +89,6 @@ def end_element(name):
                     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'] = ""