1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-01-18 23:03:05 +01:00

Rename twitter _extract_status -> _extract_post

Start of API consistency for a function to return the post data (json format) for a given platform
This commit is contained in:
Patrick Robertson 2025-01-16 13:06:12 +01:00
parent f702fce311
commit 235df4126a

View file

@ -1352,7 +1352,7 @@ class TwitterIE(TwitterBaseIE):
return status
def _extract_status(self, twid):
def _extract_post(self, twid):
if self._selected_api not in ('graphql', 'legacy', 'syndication'):
raise ExtractorError(f'{self._selected_api!r} is not a valid API selection', expected=True)
@ -1380,7 +1380,7 @@ class TwitterIE(TwitterBaseIE):
def _real_extract(self, url):
twid, selected_index = self._match_valid_url(url).group('id', 'index')
status = self._extract_status(twid)
status = self._extract_post(twid)
title = description = traverse_obj(
status, (('full_text', 'text'), {lambda x: x.replace('\n', ' ')}), get_all=False) or ''