X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fdrtv.py;h=93b3c9f36094724cd751cb340f9f925f2d04554c;hb=e65566a9cc13d13bef3dc70eebfc9bda2e302b78;hp=cdccfd376b80ee5ebc61c25ab4cd00e12dcfc458;hpb=3a0879c8c801d27087396613d80f83c112a328f9;p=youtube-dl diff --git a/youtube_dl/extractor/drtv.py b/youtube_dl/extractor/drtv.py index cdccfd376..93b3c9f36 100644 --- a/youtube_dl/extractor/drtv.py +++ b/youtube_dl/extractor/drtv.py @@ -1,14 +1,12 @@ from __future__ import unicode_literals -import re - from .subtitles import SubtitlesInfoExtractor from .common import ExtractorError from ..utils import parse_iso8601 class DRTVIE(SubtitlesInfoExtractor): - _VALID_URL = r'http://(?:www\.)?dr\.dk/tv/se/[^/]+/(?P[\da-z-]+)' + _VALID_URL = r'http://(?:www\.)?dr\.dk/tv/se/(?:[^/]+/)+(?P[\da-z-]+)(?:[/#?]|$)' _TEST = { 'url': 'http://www.dr.dk/tv/se/partiets-mand/partiets-mand-7-8', @@ -25,8 +23,7 @@ class DRTVIE(SubtitlesInfoExtractor): } def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') + video_id = self._match_id(url) programcard = self._download_json( 'http://www.dr.dk/mu/programcard/expanded/%s' % video_id, video_id, 'Downloading video JSON') @@ -35,7 +32,7 @@ class DRTVIE(SubtitlesInfoExtractor): title = data['Title'] description = data['Description'] - timestamp = parse_iso8601(data['CreatedTime'][:-5]) + timestamp = parse_iso8601(data['CreatedTime']) thumbnail = None duration = None