Bei den Shows aufgeraeumt, Downloadfortschritt einmal in der Minute loggen

This commit is contained in:
Stefan Bethke 2014-05-30 20:53:01 +00:00
parent 832574e06b
commit a10cd1486d

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/python
# $Schlepperbande: src/tivomirror/tivomirror,v 1.51 2013/08/06 22:17:16 stb Exp $
# $Schlepperbande: src/tivomirror/tivomirror,v 1.52 2014/03/02 22:19:36 stb Exp $
#
# Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4
# zu transkodieren.
@ -40,11 +40,11 @@ arset = dict()
arset["Futurama"] = 169
includes = dict()
includes['Almost Human'] = 1
includes['Brooklyn Nine-Nine'] = 1
includes['Castle'] = 1
includes['Cosmos: A Spacetime Odyssey'] = 1
includes['Family Guy'] = 1
includes["John Oliver's New York Stand-Up Show"] = 1
includes['Hot in Cleveland'] = 1
includes['Late Show With David Letterman'] = 1
includes['Louie'] = 1
includes['Mad Men'] = 1
@ -60,8 +60,6 @@ includes['The Daily Show With Jon Stewart'] = 1
includes['The Late Late Show With Craig Ferguson'] = 1
includes['The Tonight Show Starring Jimmy Fallon'] = 1
includes['CONSTITUTION USA With Peter Sagal'] = 1;
class flushfile(object):
def __init__(self, f):
@ -232,7 +230,10 @@ def quit_process(pid):
@timeout(7200)
def download(file, url, mak, target):
global browser, sidcookie
global session
count = 0
start = time.time()
upd = start
#url = re.sub("tivo.lassitu.de:80", "localhost:8888", url)
#url = re.sub("tivo.lassitu.de:80", "krokodil-vpn.zs64.net:8888", url)
print "--- downloading \"%s\"" % (url)
@ -247,6 +248,12 @@ def download(file, url, mak, target):
p_decode.stdin.write(chunk)
else:
break
count += 65536
now = time.time()
if (now - upd) > 60:
upd = now
mb = count / 1024.0 / 1024.0
print " %5.1f MB downloaded, %.3f MB/s" % (mb, mb / now)
finally:
try:
p_decode.stdin.close()