aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-07-25 11:55:49 +0200
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:28:36 +0100
commitf95f29fd25b2b33967e5f9463280118a5ce907a1 (patch)
tree614ae66e6c7962419c270b89e72d32a823d5eeb0
parent06f34701fe4f5170a77af8f60dccab578593e841 (diff)
Properly detect YouTube error messages to print them on screen (fixes issue #172)
-rwxr-xr-xyoutube-dl8
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube-dl b/youtube-dl
index 48c13b701..8cfa6dfd6 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -844,6 +844,14 @@ class YoutubeIE(InfoExtractor):
except (urllib2.URLError, httplib.HTTPException, socket.error), err:
self._downloader.trouble(u'ERROR: unable to download video info webpage: %s' % str(err))
return
+ if 'token' not in video_info:
+ if 'reason' in video_info:
+ self._downloader.trouble(u'ERROR: YouTube said: %s' % video_info['reason'][0])
+ else:
+ self._downloader.trouble(u'ERROR: "token" parameter not in video info for unknown reason')
+ return
+
+ # Start extracting information
self.report_information_extraction(video_id)
# uploader