summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/ZDF.py
diff options
context:
space:
mode:
authorGravatar synweap15 <shamdog+github@gmail.com> 2014-12-30 20:21:23 +0100
committerGravatar synweap15 <shamdog+github@gmail.com> 2014-12-30 20:21:23 +0100
commitac9ba34bd5e629ddfbe67dec88ff2e0653e80356 (patch)
treef77bc281bd083145b19e82bf0e5ff34f5cd6f01a /module/plugins/hoster/ZDF.py
parent[Oboom] new hoster and account (diff)
parentUpdate some MultiHoster __pattern__ (diff)
downloadpyload-ac9ba34bd5e629ddfbe67dec88ff2e0653e80356.tar.xz
Merge pull request #1 from pyload/stable
Merge
Diffstat (limited to 'module/plugins/hoster/ZDF.py')
-rw-r--r--module/plugins/hoster/ZDF.py31
1 files changed, 19 insertions, 12 deletions
diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py
index e718f283e..8d3de5b26 100644
--- a/module/plugins/hoster/ZDF.py
+++ b/module/plugins/hoster/ZDF.py
@@ -1,22 +1,26 @@
# -*- coding: utf-8 -*-
import re
+
from xml.etree.ElementTree import fromstring
from module.plugins.Hoster import Hoster
-XML_API = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=%i"
-
+# Based on zdfm by Roland Beermann (http://github.com/enkore/zdfm/)
class ZDF(Hoster):
- # Based on zdfm by Roland Beermann
- # http://github.com/enkore/zdfm/
- __name__ = "ZDF Mediathek"
- __version__ = "0.8"
- __pattern__ = r'http://(?:www\.)?zdf\.de/ZDFmediathek/[^0-9]*([0-9]+)[^0-9]*'
+ __name__ = "ZDF Mediathek"
+ __type__ = "hoster"
+ __version__ = "0.80"
+
+ __pattern__ = r'http://(?:www\.)?zdf\.de/ZDFmediathek/\D*(\d+)\D*'
+
__description__ = """ZDF.de hoster plugin"""
- __author_name__ = ""
- __author_mail__ = ""
+ __license__ = "GPLv3"
+ __authors__ = []
+
+ XML_API = "http://www.zdf.de/ZDFmediathek/xmlservice/web/beitragsDetails?id=%i"
+
@staticmethod
def video_key(video):
@@ -25,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(XML_API % self.get_id(pyfile.url)))
+ 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")