diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-02-13 01:36:54 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-02-13 01:36:54 +0600 |
commit | 171ca612af948b2966e56054ce3a25a9f5ab2a76 (patch) | |
tree | bd8b2dfcc2e0301ce385ad2ca3fb4dfc4195a7e5 /youtube_dl/extractor/nporadio.py | |
parent | c3d64fc1b30b46cc4f58aaa55c02918248bb1bee (diff) |
[npo:radio] Move to extractor to common npo place and add extractor for fragments
Diffstat (limited to 'youtube_dl/extractor/nporadio.py')
-rw-r--r-- | youtube_dl/extractor/nporadio.py | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/youtube_dl/extractor/nporadio.py b/youtube_dl/extractor/nporadio.py deleted file mode 100644 index d1c4ec167..000000000 --- a/youtube_dl/extractor/nporadio.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 -from __future__ import unicode_literals - -import json - -from .common import InfoExtractor - - -class NPORadioIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?npo\.nl/radio/(?P<id>.*)' - _TEST = { - 'url': 'http://www.npo.nl/radio/radio-1', - 'info_dict': { - 'id': 'radio-1', - 'ext': 'mp3', - 'title': 'NPO Radio 1', - } - } - - def _real_extract(self, url): - video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) - - title = self._html_search_regex( - self._html_get_attribute_regex('data-channel'), webpage, 'title') - - json_data = json.loads( - self._html_search_regex( - self._html_get_attribute_regex('data-streams'), webpage, 'data-streams')) - - return { - 'id': video_id, - 'title': title, - 'ext': json_data['codec'], - 'url': json_data['url'] - } - - def _html_get_attribute_regex(self, attribute): - return r'{0}\s*=\s*\'([^\']+)\''.format(attribute) |