1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

hls: handle error when getting key

This commit is contained in:
Johan Andersson 2014-12-20 21:04:37 +01:00
parent a2e430b699
commit 72ec064cc3

View File

@ -83,7 +83,10 @@ class HLS(VideoRetriever):
sys.exit(2)
match = re.search(r'URI="(https?://.*?)"', keydata)
key = get_http_data(match.group(1))
error, key = get_http_data(match.group(1))
if error:
log.error("Can't get crypto key to decode files.")
return
rand = os.urandom(16)
decryptor = AES.new(key, AES.MODE_CBC, rand)