From 78271e33197e56452dc60f075bd326cb908e8e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Mon, 2 Feb 2015 21:11:25 +0600 Subject: [PATCH] [drtv] Extract material id (Closes #4814) --- youtube_dl/extractor/drtv.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/drtv.py b/youtube_dl/extractor/drtv.py index 8d113a5e8..d5df18d7c 100644 --- a/youtube_dl/extractor/drtv.py +++ b/youtube_dl/extractor/drtv.py @@ -25,9 +25,15 @@ class DRTVIE(SubtitlesInfoExtractor): def _real_extract(self, url): 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') + webpage = self._download_webpage(url, video_id) + + video_id = self._search_regex( + r'data-(?:material-identifier|episode-slug)="([^"]+)"', + webpage, 'video id') + programcard = self._download_json( + 'http://www.dr.dk/mu/programcard/expanded/%s' % video_id, + video_id, 'Downloading video JSON') data = programcard['Data'][0] title = data['Title']