(Fehlerhafte) Detektion falscher MAKs ausschalten, Kosmetik

This commit is contained in:
Stefan Bethke 2010-12-22 17:12:24 +00:00
parent 9fe8a84533
commit f7a86d19f0

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/python
# $Schlepperbande: src/tivomirror/tivomirror,v 1.38 2010/12/18 10:03:31 stb Exp $
# $Schlepperbande: src/tivomirror/tivomirror,v 1.39 2010/12/18 22:53:24 stb Exp $
#
# Stefans Script, um die Sendungen vom Tivo runterzuladen und in MPEG4
# zu transkodieren.
@ -176,14 +176,14 @@ def transcode(file, src, passno, ar):
def download(file, url, mak, target):
print "--- dowloading \"%s\"" % (url)
start = time.clock()
start = time.time()
p_curl = subprocess.Popen(["curl", "--anyauth", "--fail", \
"--insecure", "--cookie", "tivo/.cookies.txt", \
"--silent", "--show-error", \
"--user", "tivo:%s" % mak, "--url", url ], \
stdout=subprocess.PIPE)
p_decode = subprocess.Popen(["tivodecode", "--mak", mak, \
"--out", target, "-"], stdin=p_curl.stdout)
"--no-verify", "--out", target, "-"], stdin=p_curl.stdout)
try:
waitForProcs([p_curl.pid, p_decode.pid])
except Exception, e:
@ -197,9 +197,10 @@ def download(file, url, mak, target):
print "error transcoding file: too small"
os.remove(target)
raise TivoException("downloaded file is too small")
elapsed = time.clock() - start
elapsed = time.time() - start
throughput = size / elapsed
print "%d bytes transferred in %d seconds, %4.1fk/s" % (size, elapsed, throughput / 1000.0)
print "%5.3fGB transferred in %.f.%02.f hours, %.1fkB/s" % (
size/1e9, elapsed/3600, int(elapsed / 60) % 60, throughput/1e3)
def download_decode(file, url, mak, ar):