extractSubtitles from idx/rar pics
This commit is contained in:
parent
49fd4d082e
commit
28b6fb3cb5
2 changed files with 12 additions and 9 deletions
|
@ -3,7 +3,7 @@
|
||||||
# vi:si:et:sw=2:sts=2:ts=2
|
# vi:si:et:sw=2:sts=2:ts=2
|
||||||
|
|
||||||
from model import *
|
from model import *
|
||||||
|
import cache
|
||||||
|
|
||||||
def cronDaily():
|
def cronDaily():
|
||||||
findNew()
|
findNew()
|
||||||
|
@ -40,10 +40,13 @@ def cleanClipMovieCache():
|
||||||
os.remove(os.path.join(cache, d, f))
|
os.remove(os.path.join(cache, d, f))
|
||||||
|
|
||||||
#possible fuctions:
|
#possible fuctions:
|
||||||
'''
|
|
||||||
def extractSubtitles():
|
def extractSubtitles():
|
||||||
#look for rar / sub or vob / sub subtitles and extract them with
|
extractSubtitlesScript = abspath(join(dirname(cache.cache_root), "tools/subtitles.py"))
|
||||||
#tools/subtitles.py path_to_file
|
for f in ArchiveFile.select(LIKE(ArchiveFile.q.path, '%' + '.idx')):
|
||||||
#import srt after
|
base = f.absolutePath.replace('.idx', '')
|
||||||
|
srtFile = f.absolutePath.replace('.idx', '.srt')
|
||||||
'''
|
if not os.path.exists(srtFile):
|
||||||
|
cmd = 'python "%s" "%s"' % (extractSubtitlesScript, base)
|
||||||
|
os.system(cmd)
|
||||||
|
#only one subtitle at a time
|
||||||
|
return
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Archive(SQLObject):
|
||||||
socket.setdefaulttimeout(100)
|
socket.setdefaulttimeout(100)
|
||||||
url = "%s/%s?md5sum=%s" % (self.baseUrlFrontend, action, md5sum)
|
url = "%s/%s?md5sum=%s" % (self.baseUrlFrontend, action, md5sum)
|
||||||
result = read_url(url)
|
result = read_url(url)
|
||||||
print "Frontend:", result
|
#print "Frontend:", result['result']
|
||||||
socket.setdefaulttimeout(dto)
|
socket.setdefaulttimeout(dto)
|
||||||
|
|
||||||
def _get_files(self):
|
def _get_files(self):
|
||||||
|
@ -491,7 +491,7 @@ class ArchiveFile(SQLObject):
|
||||||
options += ' "%s"' % movie_file.replace('"', '\\"')
|
options += ' "%s"' % movie_file.replace('"', '\\"')
|
||||||
options += ' -o "%s"' % mini_movie_file
|
options += ' -o "%s"' % mini_movie_file
|
||||||
cmd = "mencoder %s >/dev/null 2>&1" % options
|
cmd = "mencoder %s >/dev/null 2>&1" % options
|
||||||
print cmd.encode('utf-8')
|
#print cmd.encode('utf-8')
|
||||||
os.system(cmd.encode('utf-8'))
|
os.system(cmd.encode('utf-8'))
|
||||||
|
|
||||||
def removeTimeline(self):
|
def removeTimeline(self):
|
||||||
|
|
Loading…
Reference in a new issue