Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[heise] fix title extraction, modify test accordingly #15784

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions youtube_dl/extractor/heise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,7 +74,9 @@ def _real_extract(self, url):
if not title or title == "c't":
title = self._search_regex(
r'<div[^>]+class="videoplayerjw"[^>]+data-title="([^"]+)"',
webpage, 'title')
webpage, 'title', default=None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean, "nothing changed"? If I use the version on master, the title extraction still fails for some videos (the latest c't uplink episode worked out just fine), especially the one in the unit test.

Regards

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding another fallback here does not make much sense since title is not used when delegated to kaltura anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway as said, If i don't do so, some videos can't be downloaded, because the title extraction fails. Also, not all videos get directed to KalturaIE, I think (can't provide an example right now though).

Is there any way of giving the extracted title to KalturaIE?

Regards!

if not title:
title = self._og_search_title(webpage)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding another fallback here does not make much sense since title is not used when delegated to kaltura anyway.


yt_urls = YoutubeIE._extract_urls(webpage)
if yt_urls:
Expand Down