1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 13:44:14 +01:00

nrk: dont crash if we can’t find id

This commit is contained in:
Johan Andersson 2016-10-06 22:51:54 +02:00
parent 84d13a9f0c
commit cd9b18c91e

View File

@ -22,8 +22,10 @@ class Nrk(Service, OpenGraphThumbMixin):
return
# First, fint the video ID from the html document
video_id = re.search("<meta name=\"programid\".*?content=\"([^\"]*)\"", self.get_urldata()).group(1)
if video_id is None:
match = re.search("<meta name=\"programid\".*?content=\"([^\"]*)\"", self.get_urldata())
if match:
video_id = match.group(1)
else:
yield ServiceError("Can't find video id.")
return