diff options
| author | Sergey M․ <dstftw@gmail.com> | 2015-08-09 19:11:23 +0600 | 
|---|---|---|
| committer | Sergey M․ <dstftw@gmail.com> | 2015-08-09 19:11:23 +0600 | 
| commit | 3a30508b943c044e5f684b703ff58ac352686f63 (patch) | |
| tree | 4d2ef2dd7cdfbad1d14e5b5a523b31ee42d1cb09 | |
| parent | e0b9d78fab76e2c2819c8a9a7512ad4533319b72 (diff) | |
[telegraaf] Add extractor (Closes #6492)
| -rw-r--r-- | youtube_dl/extractor/__init__.py | 1 | ||||
| -rw-r--r-- | youtube_dl/extractor/telegraaf.py | 35 | 
2 files changed, 36 insertions, 0 deletions
| diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index e38e77a27..dad3ec87f 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -596,6 +596,7 @@ from .techtalks import TechTalksIE  from .ted import TEDIE  from .telebruxelles import TeleBruxellesIE  from .telecinco import TelecincoIE +from .telegraaf import TelegraafIE  from .telemb import TeleMBIE  from .teletask import TeleTaskIE  from .tenplay import TenPlayIE diff --git a/youtube_dl/extractor/telegraaf.py b/youtube_dl/extractor/telegraaf.py new file mode 100644 index 000000000..6f8333cfc --- /dev/null +++ b/youtube_dl/extractor/telegraaf.py @@ -0,0 +1,35 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor +from ..utils import remove_end + + +class TelegraafIE(InfoExtractor): +    _VALID_URL = r'https?://(?:www\.)?telegraaf\.nl/tv/(?:[^/]+/)+(?P<id>\d+)/[^/]+\.html' +    _TEST = { +        'url': 'http://www.telegraaf.nl/tv/nieuws/binnenland/24353229/__Tikibad_ontruimd_wegens_brand__.html', +        'md5': '83245a9779bcc4a24454bfd53c65b6dc', +        'info_dict': { +            'id': '24353229', +            'ext': 'mp4', +            'title': 'Tikibad ontruimd wegens brand', +            'description': 'md5:05ca046ff47b931f9b04855015e163a4', +            'thumbnail': 're:^https?://.*\.jpg$', +            'duration': 33, +        }, +    } + +    def _real_extract(self, url): +        playlist_id = self._match_id(url) + +        webpage = self._download_webpage(url, playlist_id) + +        playlist_url = self._search_regex( +            r"iframe\.loadPlayer\('([^']+)'", webpage, 'player') + +        entries = self._extract_xspf_playlist(playlist_url, playlist_id) +        title = remove_end(self._og_search_title(webpage), ' - VIDEO') +        description = self._og_search_description(webpage) + +        return self.playlist_result(entries, playlist_id, title, description) | 
