1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
6 from .common import InfoExtractor
14 class RegioTVIE(InfoExtractor):
15 _VALID_URL = r'https?://(?:www\.)?regio-tv\.de/video/(?P<id>[0-9]+).html'
18 'url': 'http://www.regio-tv.de/video/395808.html',
22 'title': u'Wir in Ludwigsburg',
23 'description': u'Mit unseren zuckers\xfc\xdfen Adventskindern, au\xdferdem besuchen wir die Abendsterne!',
28 def _real_extract(self, url):
29 mobj = re.match(self._VALID_URL, url)
30 video_id = mobj.group('id')
32 webpage = self._download_webpage(url, video_id)
33 key = self._html_search_regex(r''',key: "(.*?)"''', webpage, 'key')
35 title = self._html_search_regex(
36 r'<meta property="og:title" content="\s*(.*?)\s*"\s*/?\s*>',
39 soapxml = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><getHTML5VideoData xmlns="http://v.telvi.de/"><key xsi:type="xsd:string">%s</key></getHTML5VideoData></soap:Body></soap:Envelope>' % key
40 request = sanitized_Request('http://v.telvi.de/?wsdl', soapxml)
41 request.add_header('Origin', 'http://www.regio-tv.de')
42 request.add_header('Referer', url)
43 video_data = self._download_xml(request, video_id, 'video data')
46 'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
47 'soap': 'http://schemas.xmlsoap.org/soap/envelope/',
50 url = video_data.find(xpath_with_ns('.//video', NS_MAP)).text
51 thumbnail = video_data.find(xpath_with_ns('.//image', NS_MAP)).text
53 description = self._html_search_meta('description', webpage)
59 'thumbnail': thumbnail,
60 'description': description,