Repository: ytdl-org/youtube-dl

Issue:
site-support request: tagesschau.de
Content should be easy to extract:
div#convent \* div.controls div.buttons a

```
$ youtube-dl --verbose http://www.tagesschau.de/multimedia/video/video1399128.html
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.tagesschau.de/multimedia/video/video1399128.html']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.04.19
[debug] Python version 2.7.6 - Linux-3.12.20-desktop-1.mga4-x86_64-with-mandrake-4-Official
[debug] Proxy map: {}
[generic] video1399128: Requesting header
WARNING: Falling back on generic information extractor.
[generic] video1399128: Downloading webpage
[generic] video1399128: Extracting information
ERROR: Unsupported URL: http://www.tagesschau.de/multimedia/video/video1399128.html; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "/home/hartmut/lib/python/youtube_dl/extractor/generic.py", line 390, in _real_extract
    doc = parse_xml(webpage)
  File "/home/hartmut/lib/python/youtube_dl/utils.py", line 1377, in parse_xml
    return xml.etree.ElementTree.XML(s.encode('utf-8'), **kwargs)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1300, in XML
    parser.feed(text)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
    raise err
ParseError: mismatched tag: line 143, column 2
Traceback (most recent call last):
  File "/home/hartmut/lib/python/youtube_dl/YoutubeDL.py", line 514, in extract_info
    ie_result = ie.extract(url)
  File "/home/hartmut/lib/python/youtube_dl/extractor/common.py", line 161, in extract
    return self._real_extract(url)
  File "/home/hartmut/lib/python/youtube_dl/extractor/generic.py", line 630, in _real_extract
    raise ExtractorError('Unsupported URL: %s' % url)
ExtractorError: Unsupported URL: http://www.tagesschau.de/multimedia/video/video1399128.html; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
```

site-support request: tagesschau.de
Content should be easy to extract:
div#convent \* div.controls div.buttons a

```
$ youtube-dl --verbose http://www.tagesschau.de/multimedia/video/video1399128.html
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'http://www.tagesschau.de/multimedia/video/video1399128.html']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.04.19
[debug] Python version 2.7.6 - Linux-3.12.20-desktop-1.mga4-x86_64-with-mandrake-4-Official
[debug] Proxy map: {}
[generic] video1399128: Requesting header
WARNING: Falling back on generic information extractor.
[generic] video1399128: Downloading webpage
[generic] video1399128: Extracting information
ERROR: Unsupported URL: http://www.tagesschau.de/multimedia/video/video1399128.html; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "/home/hartmut/lib/python/youtube_dl/extractor/generic.py", line 390, in _real_extract
    doc = parse_xml(webpage)
  File "/home/hartmut/lib/python/youtube_dl/utils.py", line 1377, in parse_xml
    return xml.etree.ElementTree.XML(s.encode('utf-8'), **kwargs)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1300, in XML
    parser.feed(text)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1642, in feed
    self._raiseerror(v)
  File "/usr/lib64/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
    raise err
ParseError: mismatched tag: line 143, column 2
Traceback (most recent call last):
  File "/home/hartmut/lib/python/youtube_dl/YoutubeDL.py", line 514, in extract_info
    ie_result = ie.extract(url)
  File "/home/hartmut/lib/python/youtube_dl/extractor/common.py", line 161, in extract
    return self._real_extract(url)
  File "/home/hartmut/lib/python/youtube_dl/extractor/generic.py", line 630, in _real_extract
    raise ExtractorError('Unsupported URL: %s' % url)
ExtractorError: Unsupported URL: http://www.tagesschau.de/multimedia/video/video1399128.html; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
```



Discussion:

Resolving patch:
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -266,6 +266,7 @@
 from .swrmediathek import SWRMediathekIE
 from .syfy import SyfyIE
 from .sztvhu import SztvHuIE
+from .tagesschau import TagesschauIE
 from .teamcoco import TeamcocoIE
 from .techtalks import TechTalksIE
 from .ted import TEDIE
diff --git a/youtube_dl/extractor/tagesschau.py b/youtube_dl/extractor/tagesschau.py
new file mode 100644
--- /dev/null
+++ b/youtube_dl/extractor/tagesschau.py
@@ -0,0 +1,82 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+import re
+
+from .common import InfoExtractor
+
+
+class TagesschauIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?tagesschau\.de/multimedia/video/video(?P<id>-?\d+)\.html'
+
+    _TESTS = [{
+        'url': 'http://www.tagesschau.de/multimedia/video/video1399128.html',
+        'md5': 'bcdeac2194fb296d599ce7929dfa4009',
+        'info_dict': {
+            'id': '1399128',
+            'ext': 'mp4',
+            'title': 'Harald Range, Generalbundesanwalt, zu den Ermittlungen',
+            'description': 'md5:69da3c61275b426426d711bde96463ab',
+            'thumbnail': 're:^http:.*\.jpg$',
+        },
+    }, {
+        'url': 'http://www.tagesschau.de/multimedia/video/video-196.html',
+        'md5': '8aaa8bf3ae1ca2652309718c03019128',
+        'info_dict': {
+            'id': '196',
+            'ext': 'mp4',
+            'title': 'Ukraine-Konflikt: Klitschko in Kiew als B\xfcrgermeister vereidigt',
+            'description': 'md5:f22e4af75821d174fa6c977349682691',
+            'thumbnail': 're:http://.*\.jpg',
+        },
+    }]      
+
+    def _real_extract(self, url):
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+
+        if video_id.startswith('-'):
+            display_id = video_id.strip('-')
+        else:
+            display_id = video_id
+
+        webpage = self._download_webpage(url, display_id)
+
+        playerpage = self._download_webpage(
+            'http://www.tagesschau.de/multimedia/video/video%s~player_autoplay-true.html' % video_id, display_id, 'Downloading player page')
+
+        medias = re.findall(r'"(http://media.+?)", type:"video/(.+?)", quality:"(.+?)"', playerpage)
+
+        formats = []
+        for url, ext, res in medias:
+            
+            if res == 's':
+                res = 'small'
+                quality = 0
+            elif res == 'm':
+                res = 'medium'
+                quality = 1
+            elif res == 'l':
+                res = 'large'
+                quality = 2
+            else:
+                quality = 0
+
+            formats.append({
+                'format_id': res+'_'+ext,
+                'url': url,
+                'quality': quality,
+                'ext': ext,
+            })
+
+        self._sort_formats(formats)
+
+        thumbnail = re.findall(r'"(/multimedia/.+?\.jpg)"', playerpage)[-1]
+
+        return {
+            'id': display_id,
+            'title': self._og_search_title(webpage).strip(),
+            'thumbnail': 'http://www.tagesschau.de'+thumbnail,
+            'formats': formats,
+            'description': self._og_search_description(webpage).strip(),
+        }


Test patch: