[youtube] ask for cookies only if status is LOGIN_REQUIRED

This commit is contained in:
Mort Yao 2024-06-23 18:01:53 +02:00
parent 2c976407e5
commit 68965e0a96
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -211,7 +211,8 @@ class YouTube(VideoExtractor):
log.e('[Error] %s (%s)' % (playabilityStatus['reason'], subreason)) log.e('[Error] %s (%s)' % (playabilityStatus['reason'], subreason))
except: except:
log.e('[Error] %s' % playabilityStatus['reason']) log.e('[Error] %s' % playabilityStatus['reason'])
log.e('View the video from a browser and export the cookies, then use --cookies to load cookies.') if status == 'LOGIN_REQUIRED':
log.e('View the video from a browser and export the cookies, then use --cookies to load cookies.')
exit(1) exit(1)
stream_list = ytInitialPlayerResponse['streamingData']['formats'] stream_list = ytInitialPlayerResponse['streamingData']['formats']