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

select_quality: fix crash while using range

fixes: #392
This commit is contained in:
Johan Andersson 2016-05-14 11:17:34 +02:00
parent c6abc2e6d9
commit 23814a9bf5

View File

@ -96,9 +96,12 @@ def protocol_prio(streams, priolist):
def select_quality(options, streams):
high = 0
if isinstance(options.quality, str):
quality = int(options.quality.split(",")[0])
if len(options.quality.split(",")) > 1:
high = int(options.quality.split(",")[1])
try:
quality = int(options.quality.split("-")[0])
if len(options.quality.split("-")) > 1:
high = int(options.quality.split("-")[1])
except ValueError:
raise error.UIException("Requested quality is invalid. use a number or range lowerNumber-higherNumber")
else:
quality = options.quality
try: