One more exception handling

This commit is contained in:
ringus1 2024-01-11 17:01:20 +01:00
parent 6be151fed7
commit f1ed988c5f

View File

@ -449,8 +449,11 @@ def _extract_from_url(self, url, video_id):
raise ExtractorError('Failed to login with provided data.', expected=True)
if props := get_first(sjs_data, ('require', ..., ..., ..., '__bbox', 'require', ..., ..., ..., 'rootView', 'props'), expected_type=dict, default={}):
if props.get('title') == 'This content isn\'t available at the moment':
raise ExtractorError('Content removed. Facebook said: "%s"' % props.get('body', ''), expected=True)
if props.get('title') in (
'This content isn\'t available at the moment',
'This content isn\'t available right now'
):
raise ExtractorError('Content removed or not accessible. Facebook said: "%s"' % props.get('body', ''), expected=True)
def extract_metadata(webpage):
post_data = [self._parse_json(j, video_id, fatal=False) for j in re.findall(