mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 05:25:02 +03:00
[youtube] show subreason if possible
This commit is contained in:
parent
2aaf38ce23
commit
2c976407e5
@ -206,7 +206,13 @@ class YouTube(VideoExtractor):
|
||||
logging.debug('status: %s' % status)
|
||||
if status != 'OK':
|
||||
# If cookies are loaded, status should be OK
|
||||
log.wtf('[Failed] %s (use --cookies to load cookies)' % playabilityStatus['reason'])
|
||||
try:
|
||||
subreason = playabilityStatus['errorScreen']['playerErrorMessageRenderer']['subreason']['runs'][0]['text']
|
||||
log.e('[Error] %s (%s)' % (playabilityStatus['reason'], subreason))
|
||||
except:
|
||||
log.e('[Error] %s' % playabilityStatus['reason'])
|
||||
log.e('View the video from a browser and export the cookies, then use --cookies to load cookies.')
|
||||
exit(1)
|
||||
|
||||
stream_list = ytInitialPlayerResponse['streamingData']['formats']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user