Skip to content

Commit

Permalink
[tagesschau] Relax _VALID_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed May 1, 2016
1 parent 6a0f9a2 commit 651ad35
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions youtube_dl/extractor/tagesschau.py
Expand Up @@ -125,7 +125,7 @@ def _real_extract(self, url):


class TagesschauIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tagesschau\.de/[^/]+/(?:[^/]+/)*?[^/#?]+?(?P<id>-?[0-9]+)(?:~_?[^/#?]+?)?\.html'
_VALID_URL = r'https?://(?:www\.)?tagesschau\.de/(?P<path>[^/]+/(?:[^/]+/)*?[^/#?]+?(?P<id>-?[0-9]+)?)(?:~_?[^/#?]+?)?\.html'

_TESTS = [{
'url': 'http://www.tagesschau.de/multimedia/video/video-102143.html',
Expand Down Expand Up @@ -197,6 +197,9 @@ class TagesschauIE(InfoExtractor):
}, {
'url': 'http://www.tagesschau.de/multimedia/video/video-102303~_bab-sendung-211.html',
'only_matching': True,
}, {
'url': 'http://www.tagesschau.de/100sekunden/index.html',
'only_matching': True,
}]

@classmethod
Expand Down Expand Up @@ -256,7 +259,8 @@ def _extract_formats(self, download_text, media_kind):
return formats

def _real_extract(self, url):
video_id = self._match_id(url)
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id') or mobj.group('path')
display_id = video_id.lstrip('-')

webpage = self._download_webpage(url, display_id)
Expand Down

0 comments on commit 651ad35

Please sign in to comment.