aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-05-10 18:37:52 +0600
committerSergey M․ <dstftw@gmail.com>2015-05-10 18:37:52 +0600
commit370b39e8ece9f475d489eda721130eec9a9f15e9 (patch)
tree818978a7194ceb95c4026625501ed0dcde582ba3 /youtube_dl/extractor
parent3da80389189620408a654c52c36cdd2f5e2c4940 (diff)
[voicerepublic] Fix fallback branch formats extraction
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/voicerepublic.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/youtube_dl/extractor/voicerepublic.py b/youtube_dl/extractor/voicerepublic.py
index 1106c655b..254383d6c 100644
--- a/youtube_dl/extractor/voicerepublic.py
+++ b/youtube_dl/extractor/voicerepublic.py
@@ -47,12 +47,10 @@ class VoiceRepublicIE(InfoExtractor):
raise ExtractorError(
'Audio is still queued for processing', expected=True)
- data = self._parse_json(
- self._search_regex(
- r'(?s)return ({.+?});\s*\n', webpage,
- 'data', default=None),
- display_id, fatal=False)
-
+ config = self._search_regex(
+ r'(?s)return ({.+?});\s*\n', webpage,
+ 'data', default=None)
+ data = self._parse_json(config, display_id, fatal=False) if config else None
if data:
title = data['title']
description = data.get('teaser')
@@ -74,12 +72,14 @@ class VoiceRepublicIE(InfoExtractor):
[r"id='jc-(\d+)'", r"data-shareable-id='(\d+)'"],
webpage, 'talk id', default=None) or display_id
duration = None
+ player = self._search_regex(
+ r"class='vr-player jp-jplayer'([^>]+)>", webpage, 'player')
formats = [{
'url': compat_urlparse.urljoin(url, talk_url),
'format_id': format_id,
'ext': determine_ext(talk_url) or format_id,
'vcodec': 'none',
- } for format_id, talk_url in re.findall(r"data-([^=]+)='([^']+)'", webpage)]
+ } for format_id, talk_url in re.findall(r"data-([^=]+)='([^']+)'", player)]
self._sort_formats(formats)
thumbnail = self._og_search_thumbnail(webpage)