X-Git-Url: https://code.delx.au/webdl/blobdiff_plain/a3f2687e31e478893ee0ca5400a08f67d1d6beb5..b6ad3911d2593698d5ed405520aa2cc0e6ce2ea0:/sbs.py diff --git a/sbs.py b/sbs.py index 1644820..4af3632 100644 --- a/sbs.py +++ b/sbs.py @@ -41,8 +41,14 @@ class SbsNode(Node): desc_url = doc_qs["releaseUrl"][0] doc = grab_xml(desc_url, 0) + error = doc.xpath("//smil:param[@name='exception']/@value", namespaces=NS) + if error: + raise Exception("Error downloading, SBS said: " + error[0]) + video = doc.xpath("//smil:video", namespaces=NS)[0] video_url = video.attrib["src"] + if not video_url: + raise Exception("Unsupported video '%s': %s" % (self.title, desc_url)) ext = urlparse.urlsplit(video_url).path.rsplit(".", 1)[1] filename = self.title + "." + ext video_url = append_to_qs(video_url, VIDEO_MAGIC)