[wdr]: Add extractor for "Sendung mit dem Elefanten"
The homepage of "Sendung mit dem Elefanten" (a children's show) at http://www.wdrmaus.de/elefantenseite/ offers various videos. All videos use the same URL, but with different fragments, such as http://www.wdrmaus.de/elefantenseite/#folge_ostern_2015 . The new extractor WDRElefantIE supports these URLs; it downloads the site's internal table of contents (a JSON document) to look up the video.
This commit is contained in:
parent
86f237e649
commit
6bbc101aed
@ -1275,6 +1275,7 @@ from .watchbox import WatchBoxIE
|
|||||||
from .watchindianporn import WatchIndianPornIE
|
from .watchindianporn import WatchIndianPornIE
|
||||||
from .wdr import (
|
from .wdr import (
|
||||||
WDRIE,
|
WDRIE,
|
||||||
|
WDRElefantIE,
|
||||||
WDRMobileIE,
|
WDRMobileIE,
|
||||||
)
|
)
|
||||||
from .webcaster import (
|
from .webcaster import (
|
||||||
|
@ -241,6 +241,59 @@ class WDRIE(WDRBaseIE):
|
|||||||
return info_dict
|
return info_dict
|
||||||
|
|
||||||
|
|
||||||
|
class WDRElefantIE(WDRBaseIE):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)wdrmaus.de/elefantenseite/#(?P<display_id>.+)'
|
||||||
|
IE_NAME = 'wdr:elefant'
|
||||||
|
|
||||||
|
_TESTS = [
|
||||||
|
{
|
||||||
|
'url': 'http://www.wdrmaus.de/elefantenseite/#lieder_geburtstagslied',
|
||||||
|
'info_dict': {
|
||||||
|
'title': 'Ich bin schon 1-2-3',
|
||||||
|
'id': 'mdb-1008774',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'age_limit': None,
|
||||||
|
'upload_date': '20091119'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url': 'http://www.wdrmaus.de/elefantenseite/#folge_ostern_2015',
|
||||||
|
'info_dict': {
|
||||||
|
'title': 'Folge Oster-Spezial 2015',
|
||||||
|
'id': 'mdb-1088195',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'age_limit': None,
|
||||||
|
'upload_date': '20150406'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
display_id = mobj.group('display_id')
|
||||||
|
|
||||||
|
# Table of Contents seems to always be at this address, so fetch it directly.
|
||||||
|
# The website fetches configurationJS.php5, which links to tableOfContentsJS.php5.
|
||||||
|
table_of_contents = self._download_json(
|
||||||
|
'https://www.wdrmaus.de/elefantenseite/data/tableOfContentsJS.php5', display_id)
|
||||||
|
if display_id not in table_of_contents:
|
||||||
|
raise ExtractorError(
|
||||||
|
'No entry in site\'s table of contents for this URL. '
|
||||||
|
'Is the fragment part of the URL (after the #) correct?',
|
||||||
|
expected=True)
|
||||||
|
xml_metadata_path = table_of_contents[display_id]['xmlPath']
|
||||||
|
xml_metadata = self._download_xml(
|
||||||
|
'https://www.wdrmaus.de/elefantenseite/' + xml_metadata_path, display_id)
|
||||||
|
zmdb_url_element = xml_metadata.find('./movie/zmdb_url')
|
||||||
|
if zmdb_url_element is None:
|
||||||
|
raise ExtractorError(
|
||||||
|
'The URL looks valid, but no video was found. Note that download only works '
|
||||||
|
'on pages showing a single video, not on video selection pages.',
|
||||||
|
expected=True)
|
||||||
|
info_dict = self._extract_wdr_video(zmdb_url_element.text, display_id)
|
||||||
|
return info_dict
|
||||||
|
|
||||||
|
|
||||||
class WDRMobileIE(InfoExtractor):
|
class WDRMobileIE(InfoExtractor):
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'''(?x)
|
||||||
https?://mobile-ondemand\.wdr\.de/
|
https?://mobile-ondemand\.wdr\.de/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user