1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

getmedia: use logging instead of log

This commit is contained in:
Johan Andersson 2018-06-24 16:14:57 +02:00
parent 7668ed7a68
commit 8b54c05ca8

View File

@ -162,9 +162,13 @@ def get_one_media(stream):
options_subs_dl(subfixes) options_subs_dl(subfixes)
if not videos: if not videos:
log.error("No videos found.") errormsg = None
for exc in error: for exc in error:
log.error(str(exc)) if errormsg:
errormsg = "{}. {}".format(errormsg, str(exc))
else:
errormsg = str(exc)
logging.error("No videos found. {}".format(errormsg))
else: else:
if stream.config.get("list_quality"): if stream.config.get("list_quality"):
list_quality(videos) list_quality(videos)
@ -174,8 +178,7 @@ def get_one_media(stream):
if stream.config.get("get_url"): if stream.config.get("get_url"):
print(stream.url) print(stream.url)
return return
log.info("Selected to download %s, bitrate: %s", logging.info("Selected to download %s, bitrate: %s", stream.name, stream.bitrate)
stream.name, stream.bitrate)
stream.download() stream.download()
except UIException as e: except UIException as e:
if stream.config.get("verbose"): if stream.config.get("verbose"):
@ -189,8 +192,8 @@ def get_one_media(stream):
if stream.audio and post.detect: if stream.audio and post.detect:
post.merge() post.merge()
if stream.audio and not post.detect and stream.finished: if stream.audio and not post.detect and stream.finished:
log.warning("Cant find ffmpeg/avconv. audio and video is in seperate files. if you dont want this use -P hls or hds") logging.warning("Cant find ffmpeg/avconv. audio and video is in seperate files. if you dont want this use -P hls or hds")
if stream.name == "hls" or stream.config.get("remux"): if stream.name == "hls" or stream.config.get("remux"):
post.remux() post.remux()
if stream.config.get("silent_semi") and stream.finished: if stream.config.get("silent_semi") and stream.finished:
log.log(25, "Download of %s was completed" % stream.options.output) logging.log(25, "Download of %s was completed" % stream.options.output)