diff --git a/youtube-dl b/youtube-dl index 3a9fb1d4a6..fd5e09c3b7 100755 Binary files a/youtube-dl and b/youtube-dl differ diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 2a86c505bc..4fcff77ff7 100644 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -636,13 +636,16 @@ def _real_extract(self, url): self._downloader.trouble(u'ERROR: unable to extract media URL') return flashvars = urllib.unquote(mobj.group(1)) - mobj = re.search(r'"hqURL":"(.+?)"', flashvars) + if 'hqURL' in flashvars: max_quality = 'hqURL' + elif 'sdURL' in flashvars: max_quality = 'sdURL' + else: max_quality = 'ldURL' + mobj = re.search(r'"' + max_quality + r'":"(.+?)"', flashvars) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract media URL') return - hqURL = mobj.group(1).replace('\\/', '/') + video_url = mobj.group(1).replace('\\/', '/') - # TODO: support ldurl and sdurl qualities + # TODO: support choosing qualities mobj = re.search(r'', webpage) if mobj is None: @@ -658,7 +661,7 @@ def _real_extract(self, url): return [{ 'id': video_id.decode('utf-8'), - 'url': hqURL.decode('utf-8'), + 'url': video_url.decode('utf-8'), 'uploader': video_uploader.decode('utf-8'), 'upload_date': u'NA', 'title': video_title,