mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
get_multiple_media: this should be config
This commit is contained in:
parent
a53b02c854
commit
d693e16596
@ -17,19 +17,19 @@ from svtplay_dl.utils.text import exclude
|
|||||||
from svtplay_dl.error import UIException
|
from svtplay_dl.error import UIException
|
||||||
|
|
||||||
|
|
||||||
def get_multiple_media(urls, options):
|
def get_multiple_media(urls, config):
|
||||||
if options.output and os.path.isfile(options.output):
|
if config.get("output") and os.path.isfile(config.output):
|
||||||
log.error("Output must be a directory if used with multiple URLs")
|
log.error("Output must be a directory if used with multiple URLs")
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
elif options.output and not os.path.exists(options.output):
|
elif config.get("output") and not os.path.exists(config.get("output")):
|
||||||
try:
|
try:
|
||||||
os.makedirs(options.output)
|
os.makedirs(config.get("output"))
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
log.error("%s: %s", e.strerror, e.filename)
|
log.error("%s: %s", e.strerror, e.filename)
|
||||||
return
|
return
|
||||||
|
|
||||||
for url in urls:
|
for url in urls:
|
||||||
get_media(url, copy.copy(options))
|
get_media(url, copy.copy(config))
|
||||||
|
|
||||||
|
|
||||||
def get_media(url, options, version="Unknown"):
|
def get_media(url, options, version="Unknown"):
|
||||||
|
Loading…
Reference in New Issue
Block a user