aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/voicerepublic.py
diff options
context:
space:
mode:
authorDuncan <duncan@vtllf.org>2015-05-10 15:12:29 +1200
committerDuncan <duncan@vtllf.org>2015-05-10 15:50:06 +1200
commitf03a8a3c4ec4dc95164c12181ffc1ddcb7583ef6 (patch)
treebbb8f922b59765c46e00885410ba6627731147ac /youtube_dl/extractor/voicerepublic.py
parent03f760b1c0478c1f65cf6e978d7592be46873313 (diff)
[voicerepublic] Raise ExtractorError if audio is still being processed
Diffstat (limited to 'youtube_dl/extractor/voicerepublic.py')
-rw-r--r--youtube_dl/extractor/voicerepublic.py27
1 files changed, 12 insertions, 15 deletions
diff --git a/youtube_dl/extractor/voicerepublic.py b/youtube_dl/extractor/voicerepublic.py
index 960974e16..d3e35a815 100644
--- a/youtube_dl/extractor/voicerepublic.py
+++ b/youtube_dl/extractor/voicerepublic.py
@@ -2,10 +2,8 @@
from __future__ import unicode_literals
from .common import InfoExtractor
-
-from ..compat import (
- compat_urllib_request,
-)
+from ..compat import compat_urllib_request
+from ..utils import ExtractorError
class VoiceRepublicIE(InfoExtractor):
@@ -31,17 +29,16 @@ class VoiceRepublicIE(InfoExtractor):
thumbnail = self._og_search_thumbnail(webpage)
video_id = self._search_regex(r'/(\d+)\.png', thumbnail, 'id')
- if '<div class=\'vr-player jp-jplayer\'' in webpage:
- formats = [{
- 'url': 'https://voicerepublic.com/vrmedia/{}-clean.{}'.format(video_id, ext),
- 'ext': ext,
- 'format_id': ext,
- 'vcodec': 'none',
- } for ext in ['m4a', 'mp3', 'ogg']]
- self._sort_formats(formats)
- else:
- # Audio is still queued for processing
- formats = []
+ if '<a>Queued for processing, please stand by...</a>' in webpage:
+ raise ExtractorError('Audio is still queued for processing')
+
+ formats = [{
+ 'url': 'https://voicerepublic.com/vrmedia/{}-clean.{}'.format(video_id, ext),
+ 'ext': ext,
+ 'format_id': ext,
+ 'vcodec': 'none',
+ } for ext in ['m4a', 'mp3', 'ogg']]
+ self._sort_formats(formats)
return {
'id': video_id,