1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-23 10:32:54 +08:00

Add welt.de extractor.

Fixes #17553
This commit is contained in:
Matthias P. Walther 2018-10-09 19:50:49 +02:00
parent 5d90a8a5f3
commit a6dee7433c
2 changed files with 32 additions and 0 deletions

View File

@ -1371,6 +1371,7 @@ from .weibo import (
WeiboMobileIE
)
from .weiqitv import WeiqiTVIE
from .welt import WeltIE
from .wimp import WimpIE
from .wistia import WistiaIE
from .worldstarhiphop import WorldStarHipHopIE

View File

@ -0,0 +1,31 @@
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class WeltIE(InfoExtractor):
IE_NAME = 'welt.de'
_VALID_URL = r'''https?://(?:www\.)?welt\.de/mediathek/dokumentation/.*sendung(?P<id>\d+)/.*'''
_TESTS = [
{
'url': 'https://www.welt.de/mediathek/dokumentation/space/sendung170058475/ISS-Leben-auf-der-Weltraumstation.html',
'info_dict': {
'ext': 'mp4',
'title': 'ISS - Leben auf der Weltraumstation',
}
}
]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<title>([^<]+)</title>', webpage, 'title')
video_url = self._html_search_regex(r'<source data-content="Video.source" src="(https://weltn24.+?_2000.mp4)"', webpage, 'video_url')
return [{
'id': video_id,
'url': video_url,
'ext': 'mp4',
'title': title,
}]