OSDN Git Service

This is the first branches of rec10 0.4
[rec10/rec10-git.git] / rec10 / branches / 0.4 / trunk / src / ts2epg.py
diff --git a/rec10/branches/0.4/trunk/src/ts2epg.py b/rec10/branches/0.4/trunk/src/ts2epg.py
new file mode 100644 (file)
index 0000000..82b11d1
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+# coding: UTF-8
+# Rec10 TS Recording Tools
+# Copyright (C) 2009 Yukikaze
+#import sys # モジュール属性 argv を取得するため
+import os
+import configreader
+import tv2ts
+import re
+import chdb
+
+
+def write(pout,ch):
+    """
+    tsを取得してepgの入ったxmlとして書き出す
+    """
+    print "ts2epg処理"
+    bctype=chdb.chsearch(ch)['bctype']
+    print ch+":"+bctype
+    time="120"
+    if re.search('cs',bctype):
+        mode="/CS"
+        time="300"
+    elif re.search('bs',bctype):
+        mode="/BS"
+        time="300"
+    else :
+        mode=chdb.bctypesearch('te'+ch)['ontv']
+    tsepg2xml=configreader.getpath("tsepg2xml")
+    tv2ts.tv2tsmix(pout+".ts",ch,"180")
+    exe="export LANG=ja_JP.UTF-8 && /usr/bin/nice -n 19 wine "+tsepg2xml+" "+mode+" "+pout+".ts >"+pout
+    print exe
+    os.system(exe)
+
+        
+