def _call_api(self, ep, video_id, data=None, note='Downloading API JSON'):
# Ref: https://ssl.pstatic.net/static/wevweb/2_3_2_11101725/public/static/js/2488.a09b41ff.chunk.js
def _call_api(self, ep, video_id, data=None, note='Downloading API JSON'):
# Ref: https://ssl.pstatic.net/static/wevweb/2_3_2_11101725/public/static/js/2488.a09b41ff.chunk.js
self.raise_login_required(
'Session token has expired. Log in again or refresh cookies in browser')
elif isinstance(e.cause, HTTPError) and e.cause.status == 403:
self.raise_login_required(
'Session token has expired. Log in again or refresh cookies in browser')
elif isinstance(e.cause, HTTPError) and e.cause.status == 403:
- raise ExtractorError('Your account does not have access to this content', expected=True)
+ if 'Authorization' in self._API_HEADERS:
+ raise ExtractorError('Your account does not have access to this content', expected=True)
+ self.raise_login_required()
- return self._call_api(f'/post/v1.0/post-{video_id}?fieldSet=postV1', video_id)
+ path = '' if 'Authorization' in self._API_HEADERS else '/preview'
+ return self._call_api(f'/post/v1.0/post-{video_id}{path}?fieldSet=postV1', video_id)
def _get_community_id(self, channel):
return str(self._call_api(
def _get_community_id(self, channel):
return str(self._call_api(