OSDN Git Service

fix many bugs.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Wed, 21 Oct 2009 12:03:46 +0000 (12:03 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Wed, 21 Oct 2009 12:03:46 +0000 (12:03 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@183 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/chdata.py
rec10/trunk/src/checker.py
rec10/trunk/src/classify.py
rec10/trunk/src/guess.py
rec10/trunk/src/tester.py
rec10/trunk/src/timerec.py
rec10/trunk/src/tv2avi.py
rec10/trunk/src/tv2ts.py

index 0edf895..98af554 100644 (file)
@@ -43,6 +43,7 @@ chadd('te18', '0405.ontvjapan.com', 'cbc', '18', '0')
 chadd('te21', '0406.ontvjapan.com', 'toukai', '21', '0')
 chadd('te19', '0407.ontvjapan.com', 'chukyo', '19', '0')
 chadd('te23', '0420.ontvjapan.com', 'aichi', '23', '0')
+chadd('te27', '0417.ontvjapan.com', 'mie', '27', '0')
 
 
 
index 5a34791..fb43db7 100644 (file)
@@ -17,7 +17,7 @@ def checkB25Decode(b25filepath, decodedfilepath):
             if dtime > 120:
                 if (compareFilesize(b25filepath, decodedfilepath, 10) and minimizeCheck(decodedfilepath, 800)):
                     ret = 1
-    print "delete b25 is " + str(ret)
+    #print "delete b25 is " + str(ret)
     return ret
 def compareFilesize(pathbase, path, percentage):
     """
index 0ab674c..82b7816 100644 (file)
@@ -163,6 +163,7 @@ def execMove(title,temppath,recpath):
         delpath.append(os.path.join(temppath,title+".ts.tsmix"))
         delpath.append(os.path.join(temppath,title+".ts.log"))
         delpath.append(os.path.join(temppath,title+".sa.avi"))
+        delpath.append(os.path.join(temppath,title+".sa.avi.log"))
         delpath.append(os.path.join(temppath,title+".log"))
         for dp in delpath:
             try:
index d65eb76..6416bd3 100644 (file)
@@ -37,11 +37,16 @@ def detNum(title,movepath):
                 ff.append([p1['num'],p1['title'],time1])
                 if maxnum<p1['num']+1:
                     maxnum=p1['num']+1
+    detMultiDeltaDays(ff)
+def detMultiDeltaDays(num_with_title_with_dates):
+    maxnum=0
+    for ft in num_with_title_with_dates:
+        if maxnum<ft[0]+1:
+            maxnum=ft[0]+1
+    ff=num_with_title_with_dates
     f3=[None]*maxnum
-    print f3
     fret={}
     for i in range(0, maxnum, 1):
-        print i
         f3[i]=[]
     for f2 in ff:
         f3[f2[0]].append(f2)
@@ -49,7 +54,7 @@ def detNum(title,movepath):
         for j in range(i+1,maxnum,1):
             for ft3 in f3[i]:
                 for ft4 in f3[j]:
-                    for gdd in guessDeltaDay(i, ft3[2], j, ft4[2]):
+                    for gdd in detSingleDeltaDay(i, ft3[2], j, ft4[2]):
                         print gdd
                         if fret.get(gdd[0])!=None:
                             print fret
@@ -57,7 +62,17 @@ def detNum(title,movepath):
                         else:
                             fret[gdd[0]]=gdd[1]
     print fret
-def guessDeltaDay(num1,date1,num2,date2):
+    maxk=0
+    maxp=0
+    for i in range(maxnum):
+        if fret.get(i)!=None:
+            if maxp<fret[i]:
+                maxk=i
+                maxp=fret[i]
+    print maxk
+    print maxp
+    return maxk
+def detSingleDeltaDay(num1,date1,num2,date2):
     dd=date1-date2
     if date1<date2:
         dd=date2-date1
index 018aa4a..257d1e1 100644 (file)
@@ -56,5 +56,5 @@ if __name__ == "__main__":
     #classify.detNameType("te#st#25")
     #classify.detNameType("te#st#32 subtest")
     #guess.detNameType("",recordedpath)
-    #guess.detNum("よくわかる現代魔法",recordedpath+"アニメ/ひだまりスケッチ")
+    guess.detNum("よくわかる現代魔法",recordedpath+"アニメ/ファイト一発!充電ちゃん!!(Cmpl.)")
     ""
\ No newline at end of file
index 8c9464f..b9522b5 100644 (file)
@@ -240,7 +240,7 @@ def task():
                         btime = bt.strftime("%Y-%m-%d %H:%M:%S")
                         etime = et.strftime("%Y-%m-%d %H:%M:%S")
                         recdb.rec_reckey(recdb.REC_ENCODE_QUE, title, chtxt, btime, etime, opt)
-                        print checker.checkB25Decode(recpath + "/" + title + ".ts.b25", recpath + "/" + title + ".ts")
+                        #print checker.checkB25Decode(recpath + "/" + title + ".ts.b25", recpath + "/" + title + ".ts")
                         #if checker.checkB25Decode(recpath + "/" + title + ".ts.b25", recpath + "/" + title + ".ts") == 1:
                             #os.remove(recpath + "/" + title + ".ts.b25")
                         sys.exit()
index e882d80..89bd785 100644 (file)
@@ -246,6 +246,7 @@ def dualaudiots2avi(pin, pout):
     outf = os.path.splitext(pin)[0]
     bonpout = "Z:\\" + outf[1:]
     xvfb = configreader.getpath('xvfb-run')
+    logpath=pin.replace("ts","log")
     exe = 'wine ' + bontsdemux + " -i \"" + bonpin + "\" -delay 167 -nd -sound 0 -o \"" + bonpout + "\" -start -quit"
     #print exe
     exe = xvfb + ' -a ' + exe
@@ -254,7 +255,7 @@ def dualaudiots2avi(pin, pout):
     ffpin1 = pin.replace("ts", "wav")
     ffpin2 = pin.replace("ts", "m2v")
     exe = "ffmpeg -y  -i \'" + ffpin1 + "\' -i \'" + ffpin2 + "\' -r 29.97 -vsync 200 -vcodec copy -acodec libmp3lame -async 200 -ab 128k -f avi  \'" + pout + "\'"
-    #print exe
+    print exe
     #commands.getoutput(exe)
     os.system(exe)
     os.remove(ffpin1)
index 824a410..6546cb2 100644 (file)
@@ -43,6 +43,10 @@ def tv2ts(pout, ch, csch, time):
     tch="0"
     if csch!="0":
         tch=csch
+    elif ch=="101":
+        tch="101"
+    elif ch=="102":
+        tch="102"
     #else:
     #    tch=ch
     tsmix2ts(pout + ".tsmix", pout, tch)
@@ -59,6 +63,10 @@ def b252ts(pout, ch, csch):
     tch="0"
     if csch!="0":
         tch=csch
+    elif ch=="101":
+        tch="101"
+    elif ch=="102":
+        tch="102"
     #else:
     #    tch=ch
     tsmix2ts(pout + ".tsmix", pout, tch)