From 67bb0a66293d7ce42b3814c81a683da87b84ddd3 Mon Sep 17 00:00:00 2001 From: Victor Beek Date: Tue, 23 Jan 2018 09:10:57 +0000 Subject: [PATCH] Added exception handling to additionalChannels --- nederland24.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nederland24.py b/nederland24.py index 0c1980b..0f84eb1 100644 --- a/nederland24.py +++ b/nederland24.py @@ -180,10 +180,11 @@ def additionalChannels(url, depth): url = tag.find('media:content')['url'] img = os.path.join(IMG_DIR, "npo_placeholder.png") addLink(title, url, "playVideo", img, '') - finally: i += 1 if i == int(depth): break + except (AttributeError): # Prevent error when there are no additional channels available + break def playVideo(url):