diff options
Diffstat (limited to 'module/plugins/hoster/ZDF.py')
-rw-r--r-- | module/plugins/hoster/ZDF.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py index d51a16a80..04a395e1e 100644 --- a/module/plugins/hoster/ZDF.py +++ b/module/plugins/hoster/ZDF.py @@ -9,15 +9,15 @@ from module.plugins.Hoster import Hoster # Based on zdfm by Roland Beermann (http://github.com/enkore/zdfm/) class ZDF(Hoster): - __name__ = "ZDF Mediathek" - __type__ = "hoster" + __name__ = "ZDF Mediathek" + __type__ = "hoster" __version__ = "0.8" - __pattern__ = r'http://(?:www\.)?zdf\.de/ZDFmediathek/[^0-9]*([0-9]+)[^0-9]*' + __pattern__ = r'http://(?:www\.)?zdf\.de/ZDFmediathek/\D*(\d+)\D*' __description__ = """ZDF.de hoster plugin""" - __author_name__ = None - __author_mail__ = None + __license__ = "GPLv3" + __authors__ = [] XML_API = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=%i" @@ -29,21 +29,24 @@ class ZDF(Hoster): any(f.text == "progressive" for f in video.iter("facet")), ) + @staticmethod def video_valid(video): return video.findtext("url").startswith("http") and video.findtext("url").endswith(".mp4") and \ video.findtext("facets/facet").startswith("progressive") + @staticmethod def get_id(url): - return int(re.search(r"[^0-9]*([0-9]{4,})[^0-9]*", url).group(1)) + return int(re.search(r"\D*(\d{4,})\D*", url).group(1)) + def process(self, pyfile): xml = fromstring(self.load(self.XML_API % self.get_id(pyfile.url))) status = xml.findtext("./status/statuscode") if status != "ok": - self.fail("Error retrieving manifest.") + self.fail(_("Error retrieving manifest")) video = xml.find("video") title = video.findtext("information/title") |