Repository: ytdl-org/youtube-dl

Issue:
Support for RTV Noord-Holland (rtvnh.nl)
- **URL:** http://www.rtvnh.nl/video/131946
- **Error:** Unsupported URL: http://www.rtvnh.nl/video/131946
- **Platform:** openSUSE 13.1, x86_64, XFCE
- **Version:** 2015.07.28

RTV Noord Holland isn't supported, it seems. Oddly, I've filed an issue regarding this host before (#5480), but back then, the error was different - it still seems to be using StreamGate, however. I'm not sure what has changed.

Output with `-v`:

```
sven@linux-etoq:~/archive> youtube-dl -v http://www.rtvnh.nl/video/131946
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.rtvnh.nl/video/131946']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.07.28
[debug] Python version 2.7.6 - Linux-3.11.10-29-desktop-x86_64-with-SuSE-13.1-x86_64
[debug] exe versions: ffmpeg 2.7.2, ffprobe 2.7.2, rtmpdump 2.4
[debug] Proxy map: {}
[generic] 131946: Requesting header
WARNING: Falling back on generic information extractor.
[generic] 131946: Downloading webpage
[generic] 131946: Extracting information
ERROR: Unsupported URL: http://www.rtvnh.nl/video/131946
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/generic.py", line 1115, in _real_extract
    doc = parse_xml(webpage)
  File "/usr/lib/python2.7/site-packages/youtube_dl/utils.py", line 1562, in parse_xml
    tree = 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: syntax error: line 1, column 0
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 656, in extract_info
    ie_result = ie.extract(url)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 279, in extract
    return self._real_extract(url)
  File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/generic.py", line 1704, in _real_extract
    raise UnsupportedError(url)
UnsupportedError: Unsupported URL: http://www.rtvnh.nl/video/131946
```



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
@@ -491,6 +491,7 @@
 from .rtp import RTPIE
 from .rts import RTSIE
 from .rtve import RTVEALaCartaIE, RTVELiveIE, RTVEInfantilIE
+from .rtvnh import RTVNHIE
 from .ruhd import RUHDIE
 from .rutube import (
     RutubeIE,
diff --git a/youtube_dl/extractor/rtvnh.py b/youtube_dl/extractor/rtvnh.py
new file mode 100644
--- /dev/null
+++ b/youtube_dl/extractor/rtvnh.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class RTVNHIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?rtvnh\.nl/video/(?P<id>[0-9]+)'
+    _TEST = {
+        'url': 'http://www.rtvnh.nl/video/131946',
+        'md5': '6e1d0ab079e2a00b6161442d3ceacfc1',
+        'info_dict': {
+            'id': '131946',
+            'ext': 'mp4',
+            'title': 'Grote zoektocht in zee bij Zandvoort naar vermiste vrouw',
+            'thumbnail': 're:^https?:.*\.jpg$'
+        }
+    }
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        meta = self._parse_json(self._download_webpage('http://www.rtvnh.nl/video/json?m=' + video_id, video_id), video_id)
+        formats = self._extract_smil_formats('http://www.rtvnh.nl/video/smil?m=' + video_id, video_id)
+
+        for item in meta['source']['fb']:
+            if item.get('type') == 'hls':
+                formats.extend(self._extract_m3u8_formats(item['file'], video_id, ext='mp4', entry_protocol='m3u8_native'))
+            elif item.get('type') == '':
+                formats.append({'url': item['file']})
+        
+        return {
+            'id': video_id,
+            'title': meta['title'].strip(),
+            'thumbnail': meta['image'],
+            'formats': formats
+        }


Test patch: