Season- und Episoden-Nummer mit in den Titel
This commit is contained in:
parent
4ef5d42b91
commit
500219a4af
1 changed files with 18 additions and 15 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/local/bin/python
|
#!/usr/local/bin/python
|
||||||
|
|
||||||
# $Schlepperbande: src/tivomirror/tivomirror,v 1.48 2012/08/23 19:12:32 stb Exp $
|
# $Schlepperbande: src/tivomirror/tivomirror,v 1.49 2013/02/21 07:06:02 stb Exp $
|
||||||
#
|
#
|
||||||
# Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4
|
# Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4
|
||||||
# zu transkodieren.
|
# zu transkodieren.
|
||||||
|
@ -99,6 +99,7 @@ class TivoItem:
|
||||||
def __init__(self, i):
|
def __init__(self, i):
|
||||||
self.title = getTagText(i, "Title")
|
self.title = getTagText(i, "Title")
|
||||||
self.episode = getTagText(i, "EpisodeTitle")
|
self.episode = getTagText(i, "EpisodeTitle")
|
||||||
|
self.episodeNumber = getTagText(i, "EpisodeNumber")
|
||||||
self.description = trimDescription(getTagText(i, "Description"))
|
self.description = trimDescription(getTagText(i, "Description"))
|
||||||
d = getTagText(i, "CaptureDate")
|
d = getTagText(i, "CaptureDate")
|
||||||
self.date = datetime.datetime.utcfromtimestamp(int(d, 16))
|
self.date = datetime.datetime.utcfromtimestamp(int(d, 16))
|
||||||
|
@ -121,6 +122,19 @@ class TivoItem:
|
||||||
self.episode = self.description
|
self.episode = self.description
|
||||||
else:
|
else:
|
||||||
self.episode = self.datestr
|
self.episode = self.datestr
|
||||||
|
if self.episodeNumber and self.episodeNumber != u'0':
|
||||||
|
en = int(self.episodeNumber)
|
||||||
|
if en >= 100:
|
||||||
|
self.name = "%s S%02dE%02d %s" % (self.title, en / 100, en % 100, self.episode)
|
||||||
|
else:
|
||||||
|
self.name = "%s E%s %s" % (self.title, self.episodeNumber, self.episode)
|
||||||
|
else:
|
||||||
|
self.name = "%s - %s" % (self.title, self.episode)
|
||||||
|
self.dir = "%s/%s" % (targetdir, re.sub("[:/]", "-", self.title))
|
||||||
|
self.file = "%s/%s" % (self.dir, re.sub("[:/]", "-", self.name))
|
||||||
|
self.name = self.name.encode("utf-8");
|
||||||
|
self.dir = self.dir.encode("utf-8");
|
||||||
|
self.file = self.file.encode("utf-8");
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return repr(self.title)
|
return repr(self.title)
|
||||||
|
|
||||||
|
@ -283,6 +297,7 @@ def savetoc(toc):
|
||||||
fd.write(toc)
|
fd.write(toc)
|
||||||
fd.close()
|
fd.close()
|
||||||
|
|
||||||
|
|
||||||
def wantitem(item, downloaddb):
|
def wantitem(item, downloaddb):
|
||||||
if item.inprogress == "Yes":
|
if item.inprogress == "Yes":
|
||||||
return "recording"
|
return "recording"
|
||||||
|
@ -298,6 +313,7 @@ def wantitem(item, downloaddb):
|
||||||
return "not included"
|
return "not included"
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def mirror(dom, downloaddb):
|
def mirror(dom, downloaddb):
|
||||||
avail = getAvail(targetdir)
|
avail = getAvail(targetdir)
|
||||||
if avail < minfree:
|
if avail < minfree:
|
||||||
|
@ -309,13 +325,6 @@ def mirror(dom, downloaddb):
|
||||||
print "*** %d shows listed" % (items.length)
|
print "*** %d shows listed" % (items.length)
|
||||||
for i in items:
|
for i in items:
|
||||||
item = TivoItem(i)
|
item = TivoItem(i)
|
||||||
item.name = "%s - %s" % (item.title, item.episode)
|
|
||||||
#dir = "%s/tivo/%s" % (curdir, re.sub("[:/]", "-", item.title))
|
|
||||||
item.dir = "%s/%s" % (targetdir, re.sub("[:/]", "-", item.title))
|
|
||||||
item.file = "%s/%s" % (item.dir, re.sub("[:/]", "-", item.name))
|
|
||||||
item.name = item.name.encode("utf-8");
|
|
||||||
item.dir = item.dir.encode("utf-8");
|
|
||||||
item.file = item.file.encode("utf-8");
|
|
||||||
|
|
||||||
reason = wantitem(item, downloaddb)
|
reason = wantitem(item, downloaddb)
|
||||||
if (reason != ""):
|
if (reason != ""):
|
||||||
|
@ -336,18 +345,12 @@ def mirror(dom, downloaddb):
|
||||||
|
|
||||||
print "*** Completed %s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
|
print "*** Completed %s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
|
||||||
|
|
||||||
|
|
||||||
def printtoc(dom, downloaddb):
|
def printtoc(dom, downloaddb):
|
||||||
items = dom.getElementsByTagName("Item")
|
items = dom.getElementsByTagName("Item")
|
||||||
print "*** %d shows listed" % (items.length)
|
print "*** %d shows listed" % (items.length)
|
||||||
for i in items:
|
for i in items:
|
||||||
item = TivoItem(i)
|
item = TivoItem(i)
|
||||||
item.name = "%s - %s" % (item.title, item.episode)
|
|
||||||
#dir = "%s/tivo/%s" % (curdir, re.sub("[:/]", "-", item.title))
|
|
||||||
item.dir = "%s/%s" % (targetdir, re.sub("[:/]", "-", item.title))
|
|
||||||
item.file = "%s/%s" % (item.dir, re.sub("[:/]", "-", item.name))
|
|
||||||
item.name = item.name.encode("utf-8");
|
|
||||||
item.dir = item.dir.encode("utf-8");
|
|
||||||
item.file = item.file.encode("utf-8");
|
|
||||||
reason = wantitem(item, downloaddb)
|
reason = wantitem(item, downloaddb)
|
||||||
if (reason != ""):
|
if (reason != ""):
|
||||||
print "--- %-11.11s: %s" % (reason, item.name)
|
print "--- %-11.11s: %s" % (reason, item.name)
|
||||||
|
|
Loading…
Reference in a new issue