From f7a86d19f0639129e3261727b29f448ac84750ea Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Wed, 22 Dec 2010 17:12:24 +0000 Subject: [PATCH] (Fehlerhafte) Detektion falscher MAKs ausschalten, Kosmetik --- src/tivomirror/tivomirror | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/tivomirror/tivomirror b/src/tivomirror/tivomirror index afc7c3d..e2326b9 100755 --- a/src/tivomirror/tivomirror +++ b/src/tivomirror/tivomirror @@ -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):