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] Fixes #14961 #15026

Closed
wants to merge 10 commits into from
8 changes: 6 additions & 2 deletions youtube_dl/extractor/heise.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# coding: utf-8
from __future__ import unicode_literals

import re

from .common import InfoExtractor
from .youtube import YoutubeIE
from ..utils import (
Expand Down Expand Up @@ -54,8 +56,10 @@ class HeiseIE(InfoExtractor):
}]

def _real_extract(self, url):
mobile_url = re.sub(r'^(https?://)(?:www\.)?', r'\1m.', url)
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
mobile_webpage = self._download_webpage(mobile_url, video_id)

title = self._html_search_meta('fulltitle', webpage, default=None)
if not title or title == "c't":
Expand All @@ -69,10 +73,10 @@ def _real_extract(self, url):

container_id = self._search_regex(
r'<div class="videoplayerjw"[^>]+data-container="([0-9]+)"',
webpage, 'container ID')
mobile_webpage, 'container ID')
sequenz_id = self._search_regex(
r'<div class="videoplayerjw"[^>]+data-sequenz="([0-9]+)"',
webpage, 'sequenz ID')
mobile_webpage, 'sequenz ID')

doc = self._download_xml(
'http://www.heise.de/videout/feed', video_id, query={
Expand Down