mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
http: complain when the file exists
This commit is contained in:
parent
6e037c53d7
commit
5c190169f2
@ -4,6 +4,7 @@ from __future__ import absolute_import
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
|
|
||||||
from svtplay_dl.output import progress # FIXME use progressbar() instead
|
from svtplay_dl.output import progress # FIXME use progressbar() instead
|
||||||
from svtplay_dl.log import log
|
from svtplay_dl.log import log
|
||||||
@ -34,6 +35,9 @@ class HTTP(VideoRetriever):
|
|||||||
else:
|
else:
|
||||||
self.options.output = "%s.mp4" % self.options.output
|
self.options.output = "%s.mp4" % self.options.output
|
||||||
log.info("Outfile: %s", 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")
|
file_d = open(self.options.output, "wb")
|
||||||
else:
|
else:
|
||||||
file_d = sys.stdout
|
file_d = sys.stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user