ustaname=unicode(station_name)
rec10d.rec10db.add_chdata(ubct,uontv,uchtxt,uch,ucsch,ustation,ustaname,u"2009-04-01 00:00:00")
-#db.commit
-
#チャンネルの設定
#chadd('放送種別','ontvコード(ontvのサイトなどで調べられる)','略称(何でもよい)','チャンネル(物理チャンネル)','CS放送の場合の内訳','iEPGデジタルのstation','iEPGのstation')
#iEPGDigitalはテレビ王国のサイトでiEPGはサイトによってまちまちのようなので自分の使うサイトに即したものにしてください
db[1].executemany('INSERT IGNORE INTO tv (bctype,channel,start,stop,title,exp) values(%s,%s,%s,%s,%s,%s)', tvlists)
#db.commit()
self.close_db(db)
- def select_by_title_tv(self,title):
- db=self.connect_db()
- ret=[]
- dbr=db[1].execute("SELECT channel,title,start,stop FROM tv WHERE title LIKE \"%"+titletxt+"%\"")
- dbl=db[1].fetchall()
- self.close_db(db)
- if dbr>0:
- for ch, title, start, stop in dbl:
- btime=start.replace(" +0900","")
- btime=btime[0:4]+"-"+btime[4:6]+"-"+btime[6:8]+" "+btime[8:10]+":"+btime[10:12]+":00"
- etime=stop.replace(" +0900","")
- etime=etime[0:4]+"-"+etime[4:6]+"-"+etime[6:8]+" "+etime[8:10]+":"+etime[10:12]+":00"
- try:
- chtxt=chdb.ontvsearch(ch)['chtxt']
- except:
- chtxt="Unknown"
- ret.append(chtxt+","+title.encode('utf-8')+","+btime+","+etime)
- return ret
+
+
def select_by_time_ngram_tv(self,btime,etime,chtxt):
db=self.connect_db()
dbexe="SELECT chdata.chtxt,title,start,stop FROM tv INNER JOIN chdata WHERE chdata.ontv=tv.channel AND start >= %s AND start <= %s AND chdata.chtxt=%s"
dbl=dbb.select_all_rectime()
for db in dbl:
self.add_rectime(db['type'],db['chtxt'],db['title'],db['btime'],db['etime'],db['deltatime'],db['deltaday'],db['opt'])
-
\ No newline at end of file
+
+""" def select_by_title_tv(self,title):
+ db=self.connect_db()
+ ret=[]
+ dbr=db[1].execute("SELECT channel,title,start,stop FROM tv WHERE title LIKE \"%"+titletxt+"%\"")
+ dbl=db[1].fetchall()
+ self.close_db(db)
+ if dbr>0:
+ for ch, title, start, stop in dbl:
+ btime=start.replace(" +0900","")
+ btime=btime[0:4]+"-"+btime[4:6]+"-"+btime[6:8]+" "+btime[8:10]+":"+btime[10:12]+":00"
+ etime=stop.replace(" +0900","")
+ etime=etime[0:4]+"-"+etime[4:6]+"-"+etime[6:8]+" "+etime[8:10]+":"+etime[10:12]+":00"
+ try:
+ chtxt=chdb.ontvsearch(ch)['chtxt']
+ except:
+ chtxt="Unknown"
+ ret.append(chtxt+","+title.encode('utf-8')+","+btime+","+etime)
+ return ret"""
\ No newline at end of file
db.executemany('INSERT OR IGNORE INTO tv (bctype,channel,start,stop,title,exp) values (?,?,?,?,?,?)', tvlists)
db.commit()
self.close_db(db)
- def select_by_title_tv(self,title):
- db=self.connect_db(480)
- ret=[]
- for ch, title, start, stop in db.execute("SELECT channel,title,start,stop FROM tv WHERE title LIKE \"%"+titletxt+"%\""):
- btime=start.replace(" +0900","")
- btime=btime[0:4]+"-"+btime[4:6]+"-"+btime[6:8]+" "+btime[8:10]+":"+btime[10:12]+":00"
- etime=stop.replace(" +0900","")
- etime=etime[0:4]+"-"+etime[4:6]+"-"+etime[6:8]+" "+etime[8:10]+":"+etime[10:12]+":00"
- try:
- chtxt=chdb.ontvsearch(ch)['chtxt']
- except:
- chtxt="Unknown"
- ret.append(chtxt+","+title.encode('utf-8')+","+btime+","+etime)
- self.close_db(db)
- return ret
def select_by_time_ngram_tv(self,btime,etime,chtxt):
db=self.connect_db(480)
dbexe="SELECT chdata.chtxt,title,start,stop FROM tv INNER JOIN chdata WHERE chdata.ontv=tv.channel AND start >= ? AND start <= ? AND chdata.chtxt=?"
db.executemany('INSERT OR IGNORE INTO ch values (?,?,?)', chlists)
db.commit()
self.close_db(db)
+""" def select_by_title_tv(self,title):
+ db=self.connect_db(480)
+ ret=[]
+ for ch, title, start, stop in db.execute("SELECT channel,title,start,stop FROM tv WHERE title LIKE \"%"+titletxt+"%\""):
+ btime=start.replace(" +0900","")
+ btime=btime[0:4]+"-"+btime[4:6]+"-"+btime[6:8]+" "+btime[8:10]+":"+btime[10:12]+":00"
+ etime=stop.replace(" +0900","")
+ etime=etime[0:4]+"-"+etime[4:6]+"-"+etime[6:8]+" "+etime[8:10]+":"+etime[10:12]+":00"
+ try:
+ chtxt=chdb.ontvsearch(ch)['chtxt']
+ except:
+ chtxt="Unknown"
+ ret.append(chtxt+","+title.encode('utf-8')+","+btime+","+etime)
+ self.close_db(db)
+ return ret
+"""
\ No newline at end of file
updatebc("cs1")
updatebc("cs2")
updatebc("bs")
-def search(titletxt):
- return rec10d.rec10db.select_by_title_tv(titletxt)
+#def search(titletxt):
+## return rec10d.rec10db.select_by_title_tv(titletxt)
def searchtime2(titletxt,timet,deltatime,chtxt):
time=datetime.datetime.strptime(timet,"%Y-%m-%d %H:%M:%S")
ret=[]
if inum+status.getBSCSRecording()+status.getTERecording() < 2:
update=chdb.update()
#print "番組表更新処理"
-
if len(update)>0 and status.getEPGUpdating()==0:
status.setEPGUpdating(1)
print "番組表を更新"
"""
isAnime=0
size="SD"
- isDualsep=0
if re.search("a",opts):
isAnime=1
#print "isAnime"
- if re.search("X",opts):
- isDualsep=1
dualpass=0
if re.search("2",opts):
dualpass=1
else:
encvf=encvf+"scale=1280:720,harddup"
bitrate="bitrate="+tv2avi.Bitrate_HD
- if isDualsep==1:
- #pas="mencoder \'"+pin+"\' -quiet -novideo -aid 2 -dumpaudio -dumpfile \'"+pin+"sepaudio"+"\'"
- #pas="mplayer -aid 2 -dumpaudio -dumpfile \'"+pin+"sepaudio"+"\'"+" \'"+pin+"\'"
- #print pas
- #os.system(pas)
- #commands.getoutput(pas)
- encvf=encvf+" -aid 1 -audiofile \'"+pin+"addaudio.wav"
if dualpass==1:
pas1exe="mencoder \'"+pin+"\' -quiet -ovc x264 "+encvf+" -x264encopts "+bitrate+":threads=auto:pass=1:turbo=2 -passlogfile \'"+pin+".log\' "+"-oac mp3lame -lameopts cbr:br=128 -o /dev/null"
pas2exe="mencoder \'"+pin+"\' -quiet -ovc x264 "+encvf+" -x264encopts "+bitrate+":threads=auto:pass=2 -passlogfile \'"+pin+".log\' "+"-oac mp3lame -lameopts cbr:br=128 -o \'"+pout+"\'"
else:
encvf=encvf+"scale=1280:720,harddup"
bitrate="bitrate="+tv2avi.Bitrate_HD
-
if dualpass==1:
pas1exe="mencoder \'"+pin+"\' -ovc xvid "+encvf+" -xvidencopts "+bitrate+":threads=2:pass=1:turbo -passlogfile \'"+pin+".log\' "+"-oac mp3lame -lameopts cbr:br=128 -o /dev/null"
pas2exe="mencoder \'"+pin+"\' -ovc xvid "+encvf+" -xvidencopts "+bitrate+":threads=2:pass=2 -passlogfile \'"+pin+".log\' "+"-oac mp3lame -lameopts cbr:br=128 -o \'"+pout+"\'"
import ts2x264
import ts2xvid
import tv2ts
-import recdb
import commands
global Bitrate_HD
global Bitrate_FHD
exe = wine+' ' + bontsdemux + " -i \"" + bonpin + "\" -delay "+delay+" -nd -sound 1 -o \"" + bonpout + "\" -start -quit"
#print exe
exe = xvfb+' -a ' + exe
- #exe = 'xvfb-run -a -e xvfberror.txt ' + exe
- #exe='export Display=:2&&'+exe
print exe
commands.getoutput(exe)
- #os.system(exe)
ffpin=pin.replace(".ts","")
ffpin1 = pin.replace("ts", "wav")
ffpin2 = pin.replace("ts", "m2v")