OSDN Git Service

make it to rec10 0.6.0
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 20 Aug 2009 07:01:46 +0000 (07:01 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 20 Aug 2009 07:01:46 +0000 (07:01 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@117 4e526526-5e11-4fc0-8910-f8fd03428081

12 files changed:
rec10/trunk/src/chdb.py
rec10/trunk/src/config.ini
rec10/trunk/src/configreader.py
rec10/trunk/src/dbviewer.py
rec10/trunk/src/gridserver.py [moved from rec10/trunk/src/rec10gridserver.py with 100% similarity]
rec10/trunk/src/install.py
rec10/trunk/src/missed.py
rec10/trunk/src/readme.txt
rec10/trunk/src/tester.py
rec10/trunk/src/ts2x264.py
rec10/trunk/src/ts2xvid.py
rec10/trunk/src/tv2avi.py

index 4f90e74..77771dc 100644 (file)
@@ -52,27 +52,18 @@ def update():
     BSupdate=0
     for datum in rec10d.rec10db.select_get_update_chdata("6"):
         bctype=datum[0]
-        chtxt=datum[1]
         if bctype=="cs1" or bctype==u"cs1":
             if CSupdate==0:
                 ret.append(u"cs1")
                 CSupdate=1
-                #print "csの番組表取得開始"
-                #rec10d.rec10db.update_by_bctype_chdata(bctype)
         elif bctype=="cs2" or bctype==u"cs2":
             if CS2update==0:
                 ret.append(u"cs2")
                 CS2update=1
-                #print "cs2の番組表取得開始"
-                #rec10d.rec10db.update_by_bctype_chdata(bctype)
         elif bctype=="bs" or bctype==u"bs":
             if BSupdate==0:
                 ret.append(u"bs")
                 BSupdate=1
-                #print "bsの番組表取得開始"
-                #rec10d.rec10db.update_by_bctype_chdata(bctype)
         else:
             ret.append(bctype)
-            #print "取得開始"
-            #rec10d.rec10db.update_by_bctype_and_chtxt_chdata(bctype,chtxt)
     return ret
\ No newline at end of file
index 2a365fc..5398ad5 100644 (file)
@@ -1,24 +1,24 @@
 [path]
 recpt1 = /usr/local/bin/recpt1
 b25 = /usr/local/bin/b25
+wine = /usr/bin/wine
+xvfb-run = /usr/bin/xvfb-run
 bontsdemux = /path to/BonTsDemux.exe
-temppath = 
-recpath = 
+#recpathは録画先のフォルダを指定
+recpath = /path of /recording
 epgdump = 
 tssplitter_lite = 
-wine = wine
-epg2xmlpath = /media/ramdisk
 gridserver_port=10910
 ##dbの種類を決める。 db= SQLite もしくはMySQL
 #
 [db]
-#db = MySQL
-db = SQLite
-#mysql_dbname=rec10
-#mysql_host=localhost
-#mysql_user=nobody
-#mysql_passwd=nobody
-#mysql_port=3306
+db = MySQL
+#db = SQLite
+mysql_dbname=rec10
+mysql_host=localhost
+mysql_user=nobody
+mysql_passwd=nobody
+mysql_port=3306
 [env]
 enc_max=4
 te_max=2
index 445ed09..ce74f37 100644 (file)
@@ -4,13 +4,10 @@
 # Copyright (C) 2009 Yukikaze
 import os
 import ConfigParser
-
 mypath=str(os.path.dirname(os.path.abspath(__file__)))+"/"
-
 confp=ConfigParser.SafeConfigParser()
 Conf='config.ini'
 confp.read(mypath+Conf)
-
 def getpath(string):
     global confp
     return confp.get('path',string)
index 6e7036b..f3765e1 100644 (file)
@@ -3,17 +3,11 @@
 # Rec10 TS Recording Tools
 # Copyright (C) 2009 Yukikaze
 import recdb
-import sqlite3
-import os
-dbpath=str(os.path.dirname(os.path.abspath(__file__)))+"/"+"ch.db"
+import rec10d
 tasks=recdb.getall()
-db=sqlite3.connect(dbpath)
-
-
 print "チャンネルデータ"
-for bctype, ontv, chtxt, ch, csch ,updatetime in db.execute("SELECT bctype,ontv,chtxt,ch,csch,updatetime FROM chdata"):
+for bctype, ontv, chtxt, ch, csch ,updatetime in rec10d.rec10db.select_all_chdata():
     print {"txt":bctype+","+ontv+","+chtxt+","+ch+","+csch+","+updatetime,"ch":ch}
-db.close()
 print "録画予約"
 for task in tasks:
         #value=line.split(",")
index 88a7a90..be3efef 100644 (file)
@@ -6,5 +6,5 @@ import timerec
 import chdata
 import epgdb
 chdata
-#timerec.task()
-epgdb.updateall_bak()
\ No newline at end of file
+timerec.task()
+#epgdb.updateall_bak()
\ No newline at end of file
index 761dd50..3846131 100755 (executable)
@@ -6,7 +6,6 @@ import os
 import configreader
 import glob
 import time
-import sqlite3
 dbpath=str(os.path.dirname(os.path.abspath(__file__)))+"/"+"ch.db"
 if __name__ == "__main__":
     print "Hello Rec10 Recording Que Search.";
@@ -15,8 +14,6 @@ def search_b25(path):
     録画フォルダを検索し、各QUEの実行状況を表示する
     """
     b25list=glob.glob(path+"/*.b25")
-    tslist=glob.glob(path+"/*.ts")
-    avilist=glob.glob(path+"/*.avi")
     for b25f in b25list:
         ##b25f is title.ts.b25  avi is title.avi
         dir=os.path.split(b25f)[0]
index d691b86..d021179 100644 (file)
@@ -1,7 +1,7 @@
 ###########################################
 #     Rec10 for PT1                  #
 #                     Ver.0.6.0      #
-# 2009/08/15    Yukikaze                 #
+# 2009/08/20    Yukikaze                 #
 #  Copyright (C) 2009 Yukikaze   #
 ###########################################
 
@@ -26,22 +26,58 @@ epgdump(included)
 b25(non-included)
 recpt1(recfriioでもいいはずです)(non-included)
 
-以上のソフトについては実行パスをconfig.iniに書いておいてください
 
-まず/usr/lib/python(バージョン)/site-package/sitecustomize.pyを作成し
+1:外部ツールの設定
+同梱のTsSplitter_liteとepgdumpはコンパイルした後に実行ファイルを取り出し、
+好みの場所に設置します。
+BonTsDemuxはファイル自体を移動してください。
+
+その後TsSlplitter_lite、BonTsDemux.exe、epgdump,b25,recpt1(recfriioなどでも可)
+の実行ファイルへのパスをconfig.iniに書き込んでください。
+
+2:Pythonのデフォルトエンコーディングの設定
+rootで
+/usr/lib/python(バージョン)/site-package/sitecustomize.pyを作成し
+
 import sys
 sys.setdefaultencoding('utf-8')
-を追記します。
 
-その後chdate.pyのチャンネル設定部分を書き換え、chdate.pyを実行してください
-次にinstall.pyを実行すると番組表の取得が始まります。
-wwwフォルダにあるrectool.plを好みの場所に移動させ、そのフォルダにch.dbにたいするリンクを作成してください。
+を登録します。
+これでPythonの既定の文字コードがutf-8になります。
+
+3:rec10自体のインストール
+rec10フォルダの中身を好きな場所に移します。
+その後chdata.pyのチャンネル設定を書き換えます。
+chadd('放送種別','ontvコード(ontvのサイトなどで調べられる)','略称(何でもよい)',
+    'チャンネル(物理チャンネル)','CS放送の場合の内訳','iEPGデジタルのstation','iEPGのstation')
+というようになります。
+Rec10WEBを用いたiEPG対応を行わない場合は最後の二項目はからで構いません。
+
+書いたのちにinstall.pyを実行します(python ./install.py などで実行できます。)
+
+4:補助ツールのインストール
+wwwフォルダにあるrectool.plを好みの場所に移動させ、そのフォルダにconfig.iniにたいするリンクもしくはコピーを作成してください。
+cpanで必要なモジュールを追加します。
+必要なモジュールは
+
+CGI::Carp
+DBI
+Date::Simple
+DateTime
+CGI::Minimal
+MIME::Base64
+Config::Simple
+Data::Dumper
+
+です
+
+5.仕上げ
 最後にrec10d.pyをcronで五分おきに実行するようにしてください
 crontab -e を実行するとcronを編集できるようになるので
-*/5 * * * * /rec10d.py
-のように書いてください
+*/5 * * * * python /pathto/rec10d.py
+のように書いてください(5扮ごとに実行)
 ログが見たい場合は
-*/5 * * * * /rec10d.py > /dev/pts/0
+*/5 * * * * python /path to/rec10d.py > /dev/pts/0
 などのようにすれば/dev/pts/0端末に出力します(ttyコマンドで調べられます)
 
 以上で設定は終了です。
@@ -50,7 +86,8 @@ crontab -e を実行するとcronを編集できるようになるので
 dbviewer.pyを実行すると現在のデーターベースを見ることができます。
 エンコードの設定を変えたい場合はts2x264を参照してください
 
-チャンネルの設定を買えた場合は一度chdate.pyを変更したのちに実行してください
+チャンネルの設定を買えた場合はchdata.pyを編集したの知に
+chdata.pyを実行してください(python /path to /chdata.py)
 その後番組表が更新されます
 
 バグだらけのコードですが、改善点などを指摘していただけるとうれしいです。
index e803176..c948564 100644 (file)
@@ -26,9 +26,11 @@ if __name__ == "__main__":
     #epgdb.updateall_bak()
     #import rectime data from SQLite to MySQL
     #rec10d.rec10db.import_from_SQLite(path+"ch.db")
-    tnow=datetime.datetime.now()
-    bt=tnow+datetime.timedelta(seconds=20)
-    et=bt+datetime.timedelta(seconds=20)
-    btime=bt.strftime("%Y-%m-%d %H:%M:%S")
-    etime=et.strftime("%Y-%m-%d %H:%M:%S")
-    recdb.rec_reckey(recdb.REC_FINAL_RESERVE,u"テスト", "hisch", btime, etime, "Sd")
\ No newline at end of file
+    #tnow=datetime.datetime.now()
+    #bt=tnow+datetime.timedelta(seconds=20)
+    #et=bt+datetime.timedelta(seconds=20)
+    #btime=bt.strftime("%Y-%m-%d %H:%M:%S")
+    #etime=et.strftime("%Y-%m-%d %H:%M:%S")
+    #recdb.rec_reckey(recdb.REC_FINAL_RESERVE,u"テスト", "hisch", btime, etime, "Sd")
+    #os.system("echo $PATH")
+    ""
\ No newline at end of file
index 9f0eaaf..40d96ef 100644 (file)
@@ -15,8 +15,6 @@ def ts2x264(pin,pout,opts):#sizeは"HD"か"SD"
     """
     isAnime=0
     size="SD"
-
-    makemini=0
     if re.search("a",opts):
         isAnime=1
         #print "isAnime"
index 04bbf50..0a9a2fd 100644 (file)
@@ -14,7 +14,6 @@ def ts2xvid(pin,pout,opts):#sizeは"HD"か"SD"
     pin = pin.encode('utf-8')
     isAnime=0
     size="SD"
-    makemini=0
     if re.search("a",opts):
         isAnime=1
         #print "isAnime"
index 6ce63a2..6fe16f6 100644 (file)
@@ -75,10 +75,6 @@ def b252ts(pout,chtxt,btime,etime,opt):
                 opts=opts+"Ha2"
         else:
             opts=opt
-        if re.search("x",opt):
-            makexvid = 0
-        else:
-            makexvid = 1
         if dualaudio == 1:
             dualaudiots2avi(aviin, tsout + "sa.avi")
             aviin = tsout + "sa.avi"
@@ -130,10 +126,6 @@ def timetv2avi(pout, chtxt, btime, etime,opt):
             opts=opts+"Ha2"
     else:
         opts=opt
-    if re.search("x",opt):
-        makexvid = 0
-    else:
-        makexvid = 1
     if dualaudio == 1:
         dualaudiots2avi(aviin, tsout + "sa.avi")
         aviin = tsout + "sa.avi"
@@ -244,28 +236,31 @@ def dualaudiots2avi(pin, pout):
     bonpin = "Z:\\" + pin[1:]
     outf = os.path.splitext(pin)[0]
     bonpout = "Z:\\" + outf[1:]
+    xvfb = configreader.getpath('xvfb-run')
     exe = 'wine ' + bontsdemux + " -i \"" + bonpin + "\" -delay 167 -nd -sound 0 -o \"" + bonpout + "\" -start -quit"
     #print exe
-    exe = 'xvfb-run -a -e xvfberror.txt ' + exe
+    exe = xvfb+' -a ' + exe
     print exe
     os.system(exe)
     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
-    commands.getoutput(exe)
-    #os.system(exe)
+    #commands.getoutput(exe)
+    os.system(exe)
     os.remove(ffpin1)
     os.remove(ffpin2)
 def dualaudio2sep(pin,pout,delay):
     bontsdemux = configreader.getpath('bontsdemux')
     wine = configreader.getpath('wine')
+    xvfb = configreader.getpath('xvfb-run')
     bonpin = "Z:\\" + pin[1:]
     outf = os.path.splitext(pin)[0]
     bonpout = "Z:\\" + outf[1:]
-    exe = 'wine ' + bontsdemux + " -i \"" + bonpin + "\" -delay "+delay+" -nd -sound 1 -o \"" + bonpout + "\" -start -quit"
+    exe = wine+' ' + bontsdemux + " -i \"" + bonpin + "\" -delay "+delay+" -nd -sound 1 -o \"" + bonpout + "\" -start -quit"
     #print exe
-    exe = 'xvfb-run -a -e xvfberror.txt ' + exe
+    exe = xvfb+' -a ' + exe
+    #exe = 'xvfb-run -a -e xvfberror.txt ' + exe
     #exe='export Display=:2&&'+exe
     print exe
     commands.getoutput(exe)
@@ -277,7 +272,7 @@ def dualaudio2sep(pin,pout,delay):
     ffpout2=ffpin+"2_delay"+delay+".wav"
     shutil.move(ffpin1, ffpout1)
     exe = 'wine ' + bontsdemux + " -i \"" + bonpin + "\" -delay "+delay+" -nd -sound 2 -encode Demux\(wav\) -o \"" + bonpout + "\" -start -quit"
-    exe = 'xvfb-run -a -e xvfberror.txt ' + exe
+    exe = xvfb+' -a ' + exe
     print exe
     commands.getoutput(exe)
     #os.system(exe)
@@ -299,11 +294,13 @@ def dualaudio2sep(pin,pout,delay):
 def pentaaudiots2avi(pin, pout):
     bontsdemux = configreader.getpath('bontsdemux')
     bonpin = "Z:\\" + pin[1:]
+    xvfb = configreader.getpath('xvfb-run')
     outf = os.path.splitext(pin)[0]
     bonpout = "Z:\\" + outf[1:]
     exe = 'wine ' + bontsdemux + " -i \"" + bonpin + "\" -delay 167 -nd -sound 3 -o \"" + bonpout + "\" -start -quit"
     #print exe
-    exe = 'xvfb-run -a ' + exe
+    exe = xvfb+' -a ' + exe
+    #exe = 'xvfb-run -a ' + exe
     #exe='export Display=:2&&'+exe
     print exe
     commands.getoutput(exe)