gpt4 book ai didi

twitter - 如何从 API 获得更大的 Twitter 视频大小?

转载 作者:行者123 更新时间:2023-12-02 04:31:57 24 4
gpt4 key购买 nike

当通过 Twitter API 进行搜索时,我只能获得小视频的 URL,例如:

u'video_info': {u'aspect_ratio': [1, 1],
u'duration_millis': 98615,
u'variants': [{u'bitrate': 320000,
u'content_type': u'video/mp4',
u'url': u'https://video.twimg.com/ext_tw_video/944064088308510720/pu/vid/240x240/Dbol1j
YzSdt5A9Pi.mp4'},
{u'content_type': u'application/x-mpegURL',
u'url': u'https://video.twimg.com/ext_tw_video/944064088308510720/pu/pl/6iSBw8vIHgtISD_
1.m3u8'}]}}]}

视频只有 240x240

如何获得更大的版本以调整大小?

最佳答案

我想您正在寻找 the Media Size Objects

All Tweets with native media (photos, video, and GIFs) will include a set of ‘thumb’, ‘small’, ‘medium’, and ‘large’ sizes with height and width pixel sizes.

再看整体Media Objects :

The entities section will contain a media array containing a single media object if any media object has been ‘attached’ to the Tweet. If no native media has been attached, there will be no media array in the entities. The has:media Operator will match if this array is populated.

理想情况下,您的代码应该检查存在哪些媒体尺寸并使用最适合您网站的那个,因为您不能依赖所有尺寸一直存在。

关于twitter - 如何从 API 获得更大的 Twitter 视频大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47959937/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com