summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-01-19 20:04:56 +0100
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:25:09 +0100
commit1c1821f8eb1b6c8f87e8038441343d887c8ef21f (patch)
treefb62ff435482365f171ad9a6fd09579ce79fd8c3
parent60f8049d05ff18d3cedaa80bcb9b089a0d4b3e4c (diff)
downloadyoutube-dl-1c1821f8eb1b6c8f87e8038441343d887c8ef21f.tar.gz
youtube-dl-1c1821f8eb1b6c8f87e8038441343d887c8ef21f.tar.xz
youtube-dl-1c1821f8eb1b6c8f87e8038441343d887c8ef21f.zip
Improve rtmpdump support
-rwxr-xr-xyoutube-dl7
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube-dl b/youtube-dl
index fac624e06..6b56f3f98 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -413,11 +413,12 @@ class FileDownloader(object):
 		# Download using rtmpdump. rtmpdump returns exit code 2 when
 		# the connection was interrumpted and resuming appears to be
 		# possible. This is part of rtmpdump's normal usage, AFAIK.
-		retval = subprocess.call(['rtmpdump', '-q', '-r', url, '-o', filename] + [[], ['-e']][self.params.get('continuedl', False)])
-		while retval == 2:
+		basic_args = ['rtmpdump', '-q', '-r', url, '-o', filename]
+		retval = subprocess.call(basic_args + [[], ['-e', '-k', '1']][self.params.get('continuedl', False)])
+		while retval == 2 or retval == 1:
 			self.to_stdout(u'\r[rtmpdump] %s bytes' % os.path.getsize(filename), skip_eol=True)
 			time.sleep(2.0) # This seems to be needed
-			retval = subprocess.call(['rtmpdump', '-q', '-e', '-r', url, '-o', filename])
+			retval = subprocess.call(basic_args + ['-e'] + [[], ['-k', '1']][retval == 1])
 		if retval == 0:
 			self.to_stdout(u'\r[rtmpdump] %s bytes' % os.path.getsize(filename))
 			return True