mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-22 20:20:09 +09:00
[bpb] Simplify (#4298)
This commit is contained in:
parent
51bbb084d3
commit
3d960a22fa
@ -1,41 +1,37 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
class BpbIE(InfoExtractor):
|
class BpbIE(InfoExtractor):
|
||||||
IE_NAME = 'Bundeszentrale für politische Bildung'
|
IE_DESC = 'Bundeszentrale für politische Bildung'
|
||||||
_VALID_URL = r'http://www\.bpb\.de/mediathek/.*'
|
_VALID_URL = r'http://www\.bpb\.de/mediathek/(?P<id>[0-9]+)/'
|
||||||
|
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.bpb.de/mediathek/297/joachim-gauck-zu-1989-und-die-erinnerung-an-die-ddr',
|
'url': 'http://www.bpb.de/mediathek/297/joachim-gauck-zu-1989-und-die-erinnerung-an-die-ddr',
|
||||||
'md5': '0792086e8e2bfbac9cdf27835d5f2093',
|
'md5': '0792086e8e2bfbac9cdf27835d5f2093',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '12490',
|
'id': '297',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Joachim Gauck zu 1989 und die Erinnerung an die DDR',
|
'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.'
|
'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):
|
def _real_extract(self, url):
|
||||||
webpage = self._download_webpage(url, '')
|
video_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
title = self._html_search_regex(r'<h2 class="white">(.*?)</h2>', webpage, 'title')
|
|
||||||
|
title = self._html_search_regex(
|
||||||
video_id = self._html_search_regex(r'http://film\.bpb\.de/player/dokument_(?P<video_id>[0-9]+)\.mp4', webpage, 'video_id')
|
r'<h2 class="white">(.*?)</h2>', webpage, 'title')
|
||||||
|
video_url = self._html_search_regex(
|
||||||
url = 'http://film.bpb.de/player/dokument_' + video_id + '.mp4'
|
r'(http://film\.bpb\.de/player/dokument_[0-9]+\.mp4)',
|
||||||
|
webpage, 'video URL')
|
||||||
description = self._og_search_description(webpage)
|
|
||||||
|
return {
|
||||||
return {
|
'id': video_id,
|
||||||
'id': video_id,
|
'url': video_url,
|
||||||
'url': url,
|
'title': title,
|
||||||
'title': title,
|
'description': self._og_search_description(webpage),
|
||||||
'description': description,
|
}
|
||||||
'ext': 'mp4'
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user