port changes to subtitles.py, add cronDaily
This commit is contained in:
parent
e14b0aabcd
commit
8720317a56
2 changed files with 6 additions and 2 deletions
|
@ -5,6 +5,10 @@
|
|||
from model import *
|
||||
|
||||
|
||||
def cronDaily():
|
||||
findNew()
|
||||
extractNew()
|
||||
|
||||
def findNew():
|
||||
archive = Archive.get(1)
|
||||
archive.importFiles()
|
||||
|
|
|
@ -33,8 +33,8 @@ def srt2dict(srt, encoding = "utf-8"):
|
|||
start_stop = subtitle[1].split(' --> ')
|
||||
subtitle[0] =u"%s" % int(subtitle[0])
|
||||
subdict[subtitle[0]] = {
|
||||
'start': start_stop[0],
|
||||
'stop': start_stop[1],
|
||||
'start': start_stop[0].replace('.', ','),
|
||||
'stop': start_stop[1].replace('.', ','),
|
||||
'text': u'\n'.join(subtitle[2:]),
|
||||
}
|
||||
return subdict
|
||||
|
|
Loading…
Reference in a new issue