从YouTube获取图像 - 无法预测的403
我成功地从YouTube数据API获取了频道。
稍后,当我在我的反应组件中使用图像URL(频道配置文件的图像的图像)时,请使用一个名为“图像:
image={{src: source.content.image}}
我只获取一些图像:
我目前正在使用.medium选项
image: item.snippet.thumbnails.medium?.url.toString() || ""
最初获取时, 。 .DEFAULT带来同样的问题。
在某些日子里,我只在显示这些图像时只能得到几个403。在其他情况下,几乎每个图像URL都会导致403。 我也有这样的印象,即某些特定图像的显示可能性更高。例如上面搜索词“确定”的两个图像。 这是他们的URL: https://yt3.ggpht.com/ytc/ akedoltje9ob0hbwulnst_ebcgmuq9buu36epv8ko-hvbw = s240-ck-ck-c0x00fffffffffff no-rj https://yt3.ggpht.com/ytc/ akedoltpfapx-ckvivzqzwt2hcnamdmr3kgokmomm3erva = s240-ck-ck-c0x00ffffffffffffffff no-rj
I'm successfully fetching channels from the Youtube Data API.
Later, when I use the image urls (of the channel profile images) in my React components, using a prop named image:
image={{src: source.content.image}}
I'm only getting some of the images:
The ones that don't show give me:
I'm currently using the .medium option
image: item.snippet.thumbnails.medium?.url.toString() || ""
when I fetch them initially.
.default brings the same issue.
On some days I only get a few 403s when displayling those images. On others almost every image url results in a 403.
I'm also under the impression, that some particular images have a higher chance of being shown. Such as the two images above for the search term "ok".
Here are their urls:
https://yt3.ggpht.com/ytc/AKedOLTJe9ob0HBWUlnST_EbCGMUq9buu36epv8KO-HVBw=s240-c-k-c0x00ffffff-no-rj
https://yt3.ggpht.com/ytc/AKedOLTPFApx-CKviVzQzWT2HCNAMDMr3KGOkmOMM3eRVA=s240-c-k-c0x00ffffff-no-rj
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论