OSDN Git Service

some fixes
[rec10/rec10-git.git] / rec10 / trunk / src / tv2ts.py
index b8054a3..1fce8df 100644 (file)
@@ -10,6 +10,7 @@ import base64
 #import re
 #import glob
 import time
+import hashlib
 #japanesenkf.overrideEncodings()
 
 mypath=str(os.path.dirname(os.path.abspath(__file__)))+"/"
@@ -30,7 +31,11 @@ def tv2ts(pout,ch,csch,time):
     #tsmix2ts(temp[0]+"mix."+temp[1],pout,csch)
     #os.remove(temp[0]+"mix."+temp[1])
     temp=pout.split(".")
-    t=base64.b16encode(pout)
+    #t=base64.b16encode(pout)
+    #t=t[0:30]
+    t=hashlib.md5(pout).hexdigest()
+    #m.update(pout)
+    #t=m.hexdigest()
     #t=str(random.randint(10000,90000))
     tempt=os.path.split(pout)
     path=tempt[0]
@@ -46,7 +51,12 @@ def tv2ts(pout,ch,csch,time):
 
 def b252ts(pout,ch,csch):
     temp=pout.split(".")
-    t=base64.b16encode(pout)
+    #m=hashlib.md5
+    #m.update(pout)
+    #t=m.hexdigest()
+    t=hashlib.md5(pout).hexdigest()
+    #t=base64.b16encode(pout)
+    #t=t[0:30]
     #t=str(random.randint(10000,90000))
     tempt=os.path.split(pout)
     path=tempt[0]