From 9bbf861e1b42cac4aa84d80e86ceb92773640af9 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 27 Apr 2014 16:12:46 +0200 Subject: [PATCH] hls: complain when the file exists --- lib/svtplay_dl/fetcher/hls.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/svtplay_dl/fetcher/hls.py b/lib/svtplay_dl/fetcher/hls.py index 5636c34..416052e 100644 --- a/lib/svtplay_dl/fetcher/hls.py +++ b/lib/svtplay_dl/fetcher/hls.py @@ -82,6 +82,9 @@ class HLS(VideoRetriever): if not extension: self.options.output = "%s.ts" % self.options.output 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 file_d = open(self.options.output, "wb") else: file_d = sys.stdout