From 2eb9af443a1fd0bb7add8fe85c29fc4bff4f20b0 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 27 Apr 2014 13:19:56 +0200 Subject: [PATCH] select_qualtiy: it wants ints. --- lib/svtplay_dl/utils/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/svtplay_dl/utils/__init__.py b/lib/svtplay_dl/utils/__init__.py index 72bf6ed..5d602de 100644 --- a/lib/svtplay_dl/utils/__init__.py +++ b/lib/svtplay_dl/utils/__init__.py @@ -106,7 +106,7 @@ def check_redirect(url): return url def select_quality(options, streams): - available = sorted(x.bitrate for x in streams) + available = sorted(int(x.bitrate) for x in streams) try: optq = int(options.quality) @@ -136,9 +136,8 @@ def select_quality(options, streams): log.error("Can't find that quality. Try one of: %s (or try --flexible-quality)", ", ".join([str(elm) for elm in available])) sys.exit(4) - for i in streams: - if i.bitrate == selected: + if int(i.bitrate) == selected: stream = i return stream