aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/drtv.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-02-02 21:11:25 +0600
committerSergey M․ <dstftw@gmail.com>2015-02-02 21:11:25 +0600
commit78271e33197e56452dc60f075bd326cb908e8e7f (patch)
tree83f82fd48e09f2d2c060694f07eb0dcda649f267 /youtube_dl/extractor/drtv.py
parent92bf0bcdf847682cee9f66a5cef4c96c19a100d9 (diff)
[drtv] Extract material id (Closes #4814)
Diffstat (limited to 'youtube_dl/extractor/drtv.py')
-rw-r--r--youtube_dl/extractor/drtv.py10
1 files 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']