chtxtt=chtxtin.replace("_0","_%")
ret = []
for datum in rec10d.rec10db.select_by_chtxt_epg_ch(chtxtt):
- rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4]}
+ rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}
ret.append(rett)
if len(ret) == 0:
ret.append(None)
def searchCHFromBctype(bctypein):
ret = []
for datum in rec10d.rec10db.select_by_bctype_epg_ch(bctypein):
- rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4]}
+ rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}
ret.append(rett)
if len(ret) == 0:
ret.append(None)
def searchCHFromCh(chin):
ret = []
for datum in rec10d.rec10db.select_by_ch_epg_ch(chin):
- rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4]}
+ rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}
ret.append(rett)
if len(ret) == 0:
ret.append(None)
def searchAllCHFromCh(chin):
ret = []
for datum in rec10d.rec10db.select_by_ch_epg_ch(chin):
- rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4]}
+ rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}
ret.append(rett)
if len(ret) == 0:
ret.append(None)
def getAllCH():
ret = []
for datum in rec10d.rec10db.select_all_epg_ch():
- rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4]}
+ rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4], 'chname':datum[5], 'visible':datum[7]}
ret.append(rett)
if len(ret) == 0:
ret.append(None)
def select_by_chtxt_epg_ch(self, chtxt):
db = self.connect_db()
dbexe = db[1].execute("\
- SELECT bctype,chtxt,ch,csch,updatetime \
+ SELECT bctype,chtxt,ch,csch,updatetime,chname,status,visible \
FROM epg_ch \
WHERE chtxt LIKE %s", \
(chtxt,))
def select_by_bctype_epg_ch(self, bctype):
db = self.connect_db()
dbexe = db[1].execute("\
- SELECT bctype,chtxt,ch,csch,updatetime,status \
+ SELECT bctype,chtxt,ch,csch,updatetime,status,chname,status,visible \
FROM epg_ch \
WHERE bctype = %s", \
(bctype,))
db = self.connect_db()
dbexe = db[1].execute("\
SELECT \
- bctype,chtxt,ch,csch,updatetime \
+ bctype,chtxt,ch,csch,updatetime,chname,status,visible \
FROM epg_ch \
WHERE ch = %s", \
(ch,))
def select_all_epg_ch(self):
db = self.connect_db()
dbexe = db[1].execute("\
- SELECT bctype,chtxt,ch,csch,updatetime \
+ SELECT bctype,chtxt,ch,csch,updatetime,chname,status,visible \
FROM epg_ch \
")
ret = []
INNER JOIN epg_ch \
WHERE epg_ch.chtxt=epg_timeline.channel \
AND \
+ epg_ch.visible=1 \
+ AND \
start >= %s \
AND \
stop <= %s \
os.remove(logo)\r
def addCommandSelfLog(tspath,command):\r
logpath=getLogTitle(tspath)+".command.log"\r
- print logpath\r
f=""\r
if os.path.exists(logpath):\r
f=open(logpath,'a')\r
else:\r
f=open(logpath,'w')\r
- print "test4"\r
tc=command+u"\n\n"\r
- print tc\r
- f.write(tc.encode('utf-8'),"ignore")\r
+ f.write(tc.encode('utf-8','ignore'))\r
f.close()\r
def getLogTitle(tspath):\r
logo=tspath\r
unicode(commands.getoutput(u"mkfifo "+streampath),'utf-8','ignore')\r
logmencoder=recdblist.getLogTitle(pin)+".mencoder.log"\r
logx264=recdblist.getLogTitle(pin)+".x264.log"\r
- encexe=mencoder+u" \""+pin+u"\" -vfm ffmpeg "+encvf+u",format=i420 "+fps+" "+ofps+" -oac mp3lame -ovc raw -of rawvideo -o \""+streampath+"\" 2>&1 | "+tee+" \""+logmencoder+"\" & "\r
+ encexe=mencoder+u" \""+pin+u"\" -quiet -vfm ffmpeg "+encvf+u",format=i420 "+fps+" "+ofps+" -oac mp3lame -ovc raw -of rawvideo -o \""+streampath+"\" 2>&1 | "+tee+" \""+logmencoder+"\" & "\r
encexe=encexe+getX264Commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout, streampath, x264streamsize, crf=x264crf)\r
#encexe=encexe+u" nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264_addline+u" --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize\r
encexe=u"nice -n 19 " +encexe+" 2>&1 | "+tee+" \""+logx264+"\""\r
exe=exe+getX264Commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout,"-", x264streamsize, crf=x264crf)\r
exe = "nice -n 19 " + exe+" 2>&1 | "+tee+" \""+log_x264+"\""\r
txt=""\r
- print "test"\r
#recdblist.addCommandSelfLog(log_ffmpeg,recdblist.getLogTitle(pin)+".log.zip")\r
#recdblist.addCommandSelfLog(log_x264,recdblist.getLogTitle(pin)+".log.zip")\r
recdblist.printutf8(exe)\r
- print exe\r
- recdblist.addCommandSelfLog(tspath,exe)\r
- print "test2"\r
+ recdblist.addCommandSelfLog(pin,exe)\r
try:\r
txt=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
except:\r
""\r
recdblist.addCommandLog(pin, u"FFmpeg動画エンコード", exe, txt)\r
- zip.addFile2FileZip(log_ffmpeg, recdblist.getLogTitle(tspath+".log.zip"))\r
- zip.addFile2FileZip(log_x264, recdblist.getLogTitle(tspath+".log.zip"))\r
+ zip.addFile2FileZip(log_ffmpeg, recdblist.getLogTitle(pin+".log.zip"))\r
+ zip.addFile2FileZip(log_x264, recdblist.getLogTitle(pin+".log.zip"))\r
os.remove(log_ffmpeg)\r
os.remove(log_x264)\r
def getMovieBaseSize(pin):\r
title=addTitle_Subtitle(rHisch,1,title,desc)\r
tch=chdb.searchCHFromChtxt(channel)\r
if tch!=None:\r
- if tch.get('bctype',"")==bctype:\r
+ if tch.get('bctype',"")==bctype and not tch['visible']==0:\r
bt=bayes.get(tch['chtxt'],["","",0])\r
bt2=[bt[0]+title+" ",bt[1]+desc+" "+longdesc+" ",bt[2]+1]\r
bayes[tch['chtxt']]=bt2\r
th=0
if os.path.exists(basefile):
- th=zipfile.ZipFile(basefile,'a')
+ th=zipfile.ZipFile(basefile,'a',zipfile.ZIP_DEFLATED)
else:
th=zipfile.ZipFile(basefile,'w')
if os.path.exists(addfile):