1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-03 03:13:11 +08:00

[heise] fix title extraction, modify test accordingly

This commit is contained in:
Kay B 2018-03-06 22:40:15 +01:00
parent 6202f08e1b
commit 18f011fd03

View File

@ -17,16 +17,14 @@ class HeiseIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?heise\.de/(?:[^/]+/)+[^/]+-(?P<id>[0-9]+)\.html'
_TESTS = [{
'url': 'http://www.heise.de/video/artikel/Podcast-c-t-uplink-3-3-Owncloud-Tastaturen-Peilsender-Smartphone-2404147.html',
'md5': 'ffed432483e922e88545ad9f2f15d30e',
'md5': '0b0c0bc1e960d188982b2491ec2d7e76',
'info_dict': {
'id': '2404147',
'id': '1_kkrq94sm',
'ext': 'mp4',
'title': "Podcast: c't uplink 3.3 Owncloud / Tastaturen / Peilsender Smartphone",
'format_id': 'mp4_720p',
'timestamp': 1411812600,
'upload_date': '20140927',
'description': 'md5:c934cbfb326c669c2bcabcbe3d3fcd20',
'thumbnail': r're:^https?://.*/gallery/$',
'title': "ct uplink 33",
'format_id': 'mp4-2957',
'timestamp': 1512734959,
'upload_date': '20171208',
}
}, {
# YouTube embed
@ -76,7 +74,9 @@ class HeiseIE(InfoExtractor):
if not title or title == "c't":
title = self._search_regex(
r'<div[^>]+class="videoplayerjw"[^>]+data-title="([^"]+)"',
webpage, 'title')
webpage, 'title', default=None, fatal=False)
if not title:
self._og_search_title(webpage)
yt_urls = YoutubeIE._extract_urls(webpage)
if yt_urls: