OSDN Git Service

fix some miss.
[rec10/rec10-git.git] / rec10 / trunk / src / tv2mp4.py
index 9f18430..b27257d 100644 (file)
@@ -26,6 +26,9 @@ def ts2mp4(pin, pout, opt):
         time.sleep(10)\r
         if os.path.isfile(tpraw) and os.path.getsize(tpraw)>10*1000:\r
             raw2mp4(tpraw, tpmp4, opt)\r
+        time.sleep(10)\r
+        if os.path.exists(tpraw):\r
+            os.remove(tpraw)\r
 def raw2mp4(pin,pout,opt):\r
     dir=os.path.split(pout)[0]\r
     title=os.path.split(pout)[1]\r
@@ -50,7 +53,10 @@ def raw2mp4(pin,pout,opt):
     if isdualaac==1:\r
         wineexe=configreader.getpath("wine")\r
         pincap=pin.replace(".264",".srt")\r
-        cap2ass=configreader.getpath("caption2ass")\r
+        try:\r
+            cap2ass=configreader.getpath("caption2ass")\r
+        except:\r
+            cap2ass=""\r
         pints=pin.replace(".264",".ts")\r
         paac1=pin.replace(".264","_1.aac")\r
         paac2=pin.replace(".264","_2.aac")\r
@@ -74,7 +80,10 @@ def raw2mp4(pin,pout,opt):
     elif ispentaaudio==1:\r
         wineexe=configreader.getpath("wine")\r
         pincap=pin.replace(".264",".srt")\r
-        cap2ass=configreader.getpath("caption2ass")\r
+        try:\r
+            cap2ass=configreader.getpath("caption2ass")\r
+        except:\r
+            cap2ass=""\r
         pints=pin.replace(".264",".ts")\r
         paac1=pin.replace(".264","_1.aac")\r
         paac2=pin.replace(".264","_2.aac")\r
@@ -98,7 +107,10 @@ def raw2mp4(pin,pout,opt):
     else:\r
         wineexe=configreader.getpath("wine")\r
         pincap=pin.replace(".264",".srt")\r
-        cap2ass=configreader.getpath("caption2ass")\r
+        try:\r
+            cap2ass=configreader.getpath("caption2ass")\r
+        except:\r
+            cap2ass=""\r
         pints=pin.replace(".264",".ts")\r
         pinaac=pin.replace(".264",".aac")\r
         e0=wineexe+u" "+cap2ass+u" -format srt \"Z:\\"+pints+"\" \"Z:\\"+pincap+"\""\r
@@ -116,8 +128,14 @@ def raw2mp4(pin,pout,opt):
     recdblist.addlog(pout, txt, "mp4box-log")\r
     if status.getSettings_auto_del_tmp()==1:\r
         if os.path.exists(pout):\r
-            if os.path.getsize(pout)>100*1000*1000:\r
-                deltitle(dir,title)\r
+            if re.search(opt,"MW8") or re.search(opt,"MW9"):\r
+                if os.path.getsize(pout)>50*1000*1000:\r
+                    deltitle(dir,title)\r
+            elif re.search(opt,"8") or re.search(opt,"9"):\r
+                ""\r
+            else:\r
+                if os.path.getsize(pout)>100*1000*1000:\r
+                    deltitle(dir,title)\r
 def mkv2mp4(pin,pout):\r
     exeb = configreader.getpath(u"mkvextract")\r
     exe = configreader.getpath(u"mp4Box")\r