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:
parent
8408375356
commit
56bef49edf
@ -175,17 +175,25 @@ def get_one_media(stream, options):
|
||||
subs = []
|
||||
error = []
|
||||
streams = stream.get(options)
|
||||
for i in streams:
|
||||
if isinstance(i, VideoRetriever):
|
||||
if options.preferred:
|
||||
if options.preferred.lower() == i.name():
|
||||
try:
|
||||
for i in streams:
|
||||
if isinstance(i, VideoRetriever):
|
||||
if options.preferred:
|
||||
if options.preferred.lower() == i.name():
|
||||
videos.append(i)
|
||||
else:
|
||||
videos.append(i)
|
||||
else:
|
||||
videos.append(i)
|
||||
if isinstance(i, subtitle):
|
||||
subs.append(i)
|
||||
if isinstance(i, Exception):
|
||||
error.append(i)
|
||||
if isinstance(i, subtitle):
|
||||
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 != "-":
|
||||
|
Loading…
Reference in New Issue
Block a user