Update yt_dlp/extractor/twitter.py

This commit is contained in:
pukkandan 2023-07-22 09:23:02 +05:30 committed by GitHub
parent eaa442d976
commit 538c6750cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1229,11 +1229,12 @@ def _extract_status(self, twid):
raise
self.report_warning(
f'{e.orig_msg}. Falling back to syndication endpoint; some metadata may be missing', twid)
status = self._download_json(
'https://cdn.syndication.twimg.com/tweet-result', twid, 'Downloading syndication JSON',
headers={'User-Agent': 'Googlebot'}, query={'id': twid})
status['extended_entities'] = {'media': status.get('mediaDetails')}
return status
status = self._download_json(
'https://cdn.syndication.twimg.com/tweet-result', twid, 'Downloading syndication JSON',
headers={'User-Agent': 'Googlebot'}, query={'id': twid})
status['extended_entities'] = {'media': status.get('mediaDetails')}
return status
def _real_extract(self, url):
twid, selected_index = self._match_valid_url(url).group('id', 'index')