]> code.delx.au - webdl/commitdiff
safer JSON handling
authorJames Bunton <jamesbunton@delx.net.au>
Mon, 16 May 2016 12:50:54 +0000 (22:50 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Mon, 16 May 2016 12:50:54 +0000 (22:50 +1000)
brightcove.py

index ccc85e78cf2f140539b86c878a9ea58016d338f6..ad345f5cfd3812f78bedbe362907274fb513bbf3 100644 (file)
@@ -39,7 +39,7 @@ class BrightcoveVideoNode(Node):
         })
 
         doc = grab_json(desc_url, 3600)
-        video_url = doc["HLSURL"]
+        video_url = doc and doc["HLSURL"]
         if not video_url:
             return
 
@@ -55,7 +55,7 @@ class BrightcoveVideoNode(Node):
         })
 
         doc = grab_json(desc_url, 3600)
-        video_url = doc["hdsManifestUrl"]
+        video_url = doc and doc["hdsManifestUrl"]
         if not video_url:
             return