mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-23 04:30:10 +09:00
[nebula] Fix stale session issues
When Nebula isn't accessed for a while, the Zype access token stored on the Nebula backend expires. It is then no longer returned by the user endpoint. The Nebula frontend has the same issue and keeps polling for the Zype token in this case. This isn't implemented in this extractor yet, but at least a specific error message now prints some helpful advice.
This commit is contained in:
parent
9fdfd6d3ba
commit
a0f69f9526
@ -141,7 +141,8 @@ class NebulaIE(InfoExtractor):
|
|||||||
# option #4: nebula token via --videopassword
|
# option #4: nebula token via --videopassword
|
||||||
if not nebula_token:
|
if not nebula_token:
|
||||||
nebula_token = self._downloader.params.get('videopassword')
|
nebula_token = self._downloader.params.get('videopassword')
|
||||||
if nebula_token: self.to_screen('Authenticating to Nebula with token from --videopassword')
|
if nebula_token:
|
||||||
|
self.to_screen('Authenticating to Nebula with token from --videopassword')
|
||||||
|
|
||||||
if not nebula_token:
|
if not nebula_token:
|
||||||
raise ExtractorError('Nebula requires an account with an active subscription. '
|
raise ExtractorError('Nebula requires an account with an active subscription. '
|
||||||
@ -228,6 +229,8 @@ class NebulaIE(InfoExtractor):
|
|||||||
user_object = self._call_nebula_api('/auth/user/', video_id, nebula_token, note='Retrieving Zype access token')
|
user_object = self._call_nebula_api('/auth/user/', video_id, nebula_token, note='Retrieving Zype access token')
|
||||||
access_token = try_get(user_object, lambda x: x['zype_auth_info']['access_token'], compat_str)
|
access_token = try_get(user_object, lambda x: x['zype_auth_info']['access_token'], compat_str)
|
||||||
if not access_token:
|
if not access_token:
|
||||||
|
if try_get(user_object, lambda x: x['is_subscribed'], bool):
|
||||||
|
raise ExtractorError('Unable to extract Zype access token from Nebula API authentication endpoint, please try loading an arbitrary video in a browser with this account to ''prime'' it for video downloading')
|
||||||
raise ExtractorError('Unable to extract Zype access token from Nebula API authentication endpoint')
|
raise ExtractorError('Unable to extract Zype access token from Nebula API authentication endpoint')
|
||||||
return access_token
|
return access_token
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user