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

Catch all the Exceptions when the script is crashing

This commit is contained in:
Johan Andersson 2015-09-06 14:56:54 +02:00
parent 8408375356
commit 56bef49edf

View File

@ -175,6 +175,7 @@ def get_one_media(stream, options):
subs = []
error = []
streams = stream.get(options)
try:
for i in streams:
if isinstance(i, VideoRetriever):
if options.preferred:
@ -186,6 +187,13 @@ def get_one_media(stream, options):
subs.append(i)
if isinstance(i, Exception):
error.append(i)
except Exception as e:
if options.verbose:
raise e
else:
print("Script crashed. please run the script again and add --verbose as an argument")
print("Make an issue with the url you used and include the stacktrace. please include the version of the script")
sys.exit(3)
if options.subtitle and options.output != "-":