diff options
author | Oskar Jauch <oskar.jauch@gmail.com> | 2014-11-24 20:02:00 +0100 |
---|---|---|
committer | Oskar Jauch <oskar.jauch@gmail.com> | 2014-11-24 20:02:00 +0100 |
commit | 355682be016e6916ea0b3565f7e5fb496f3a660a (patch) | |
tree | d7cf4befa90247c18126c594f5a0eed01e444135 /youtube_dl | |
parent | b74e86f48aa6d007b681e2723ff28fe82a49fa9d (diff) |
bpb Add new extractor
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/__init__.py | 1 | ||||
-rw-r--r-- | youtube_dl/extractor/bpb.py | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index fb5e6ac77..a038f298a 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -32,6 +32,7 @@ from .bilibili import BiliBiliIE from .blinkx import BlinkxIE from .bliptv import BlipTVIE, BlipTVUserIE from .bloomberg import BloombergIE +from .bpb import BpbIE from .br import BRIE from .breakcom import BreakIE from .brightcove import BrightcoveIE diff --git a/youtube_dl/extractor/bpb.py b/youtube_dl/extractor/bpb.py new file mode 100644 index 000000000..560688589 --- /dev/null +++ b/youtube_dl/extractor/bpb.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor + +class BpbIE(InfoExtractor): + IE_NAME = 'Bundeszentrale für politische Bildung' + _VALID_URL = r'http://www\.bpb\.de/mediathek/.*' + + _TEST = { + 'url': 'http://www.bpb.de/mediathek/297/joachim-gauck-zu-1989-und-die-erinnerung-an-die-ddr', + 'md5': '0792086e8e2bfbac9cdf27835d5f2093', + 'info_dict': { + 'id': '12490', + 'ext': 'mp4', + 'title': 'Joachim Gauck zu 1989 und die Erinnerung an die DDR', + 'description': 'Joachim Gauck, erster Beauftragter für die Stasi-Unterlagen, spricht auf dem Geschichtsforum über die friedliche Revolution 1989 und eine "gewisse Traurigkeit" im Umgang mit der DDR-Vergangenheit.' + } + } + + def _real_extract(self, url): + webpage = self._download_webpage(url, '') + + title = self._html_search_regex(r'<h2 class="white">(.*?)</h2>', webpage, 'title') + + video_id = self._html_search_regex(r'http://film\.bpb\.de/player/dokument_(?P<video_id>[0-9]+)\.mp4', webpage, 'video_id') + + url = 'http://film.bpb.de/player/dokument_' + video_id + '.mp4' + + description = self._og_search_description(webpage) + + return { + 'id': video_id, + 'url': url, + 'title': title, + 'description': description, + 'ext': 'mp4' + } |