From 0596ee743bde967ea2bbdd3c206a8c540e7e4b09 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 28 Oct 2018 16:29:17 +0100 Subject: [PATCH] riksdagen: add support without subdomain. fixes: #976 --- lib/svtplay_dl/service/riksdagen.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/svtplay_dl/service/riksdagen.py b/lib/svtplay_dl/service/riksdagen.py index d6a1cc1..ed64f04 100644 --- a/lib/svtplay_dl/service/riksdagen.py +++ b/lib/svtplay_dl/service/riksdagen.py @@ -1,6 +1,8 @@ from __future__ import absolute_import import re +import copy from svtplay_dl.fetcher.hls import hlsparse +from svtplay_dl.fetcher.http import HTTP from svtplay_dl.service import Service, OpenGraphThumbMixin @@ -8,10 +10,10 @@ from svtplay_dl.error import ServiceError class Riksdagen(Service, OpenGraphThumbMixin): - supported_domains_re = ["www.riksdagen.se"] + supported_domains_re = ["riksdagen.se", "www.riksdagen.se"] def get(self): - match = re.search("_([A-Z0-9]+)$", self.url) + match = re.search("_([a-zA-Z0-9]+)$", self.url) if not match: yield ServiceError("Cant find video id.") return @@ -32,3 +34,6 @@ class Riksdagen(Service, OpenGraphThumbMixin): streams = hlsparse(self.config, self.http.request("get", data2["url"]), data2["url"], output=self.output) for n in list(streams.keys()): yield streams[n] + if i["mimetype"] == "video/mp4": + for n in i["bandwidth"]: + yield HTTP(copy.copy(self.config), n["url"], n["quality"], output=self.output)