1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

hds: complain when the file exists

This commit is contained in:
Johan Andersson 2014-04-27 16:12:38 +02:00
parent c606b9b031
commit ea9bd80356

View File

@ -7,7 +7,7 @@ import re
import struct
import logging
import binascii
import os
import xml.etree.ElementTree as ET
from svtplay_dl.output import progressbar, progress_stream, ETA
@ -79,6 +79,9 @@ class HDS(VideoRetriever):
if not extension:
self.options.output = "%s.flv" % 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