From 8b93f902a7c7c468a931e1defa3941492b139a7e Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 27 Apr 2014 16:12:58 +0200 Subject: [PATCH] rtmp: complain when the file exists --- lib/svtplay_dl/fetcher/rtmp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/svtplay_dl/fetcher/rtmp.py b/lib/svtplay_dl/fetcher/rtmp.py index bae6d2d..aadb8ba 100644 --- a/lib/svtplay_dl/fetcher/rtmp.py +++ b/lib/svtplay_dl/fetcher/rtmp.py @@ -4,6 +4,7 @@ from __future__ import absolute_import import subprocess import re import shlex +import os from svtplay_dl.log import log from svtplay_dl.utils import is_py2 @@ -26,6 +27,9 @@ class RTMP(VideoRetriever): else: self.options.output = self.options.output + extension.group(1) log.info("Outfile: %s", self.options.output) + if os.path.isfile(self.options.output) and not self.options.force: + log.info("File already exists. use --force to overwrite") + return args += ["-o", self.options.output] if self.options.silent or self.options.output == "-": args.append("-q")