Fix props getter

This commit is contained in:
ringus1 2024-01-31 16:54:26 +01:00
parent 94f85add47
commit 8e01382707

View File

@ -501,7 +501,7 @@ def _extract_from_url(self, url, video_id):
raise ExtractorError('Account is locked.', expected=True) raise ExtractorError('Account is locked.', expected=True)
if props := get_first(sjs_data, ( if props := get_first(sjs_data, (
'require', ..., ..., ..., '__bbox', 'require', ..., ..., ..., 'rootView', 'props', 'require', ..., ..., ..., '__bbox', 'require', ..., ..., ..., 'rootView',
lambda _, v: v['title'].startswith('This content isn\'t available'))): lambda _, v: v['title'].startswith('This content isn\'t available'))):
raise ExtractorError( raise ExtractorError(
f'Content unavailable. Facebook said: {props.get("body") or props["title"]}', expected=True) f'Content unavailable. Facebook said: {props.get("body") or props["title"]}', expected=True)