如何获取上次上传到 YouTube 的视频的 ID? [英] How to get ID of last uploaded video to YouTube?

查看:29
本文介绍了如何获取上次上传到 YouTube 的视频的 ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以根据频道名称获取最后上传到特定 YouTube 频道的视频的 ID,最终是频道 ID?

Is it possible to get the ID of the last uploaded video to the specific YouTube channel, based on channel name, eventually channel ID?

我需要获取上一个视频的缩略图:

I need get a thumbnail from last video:

http://img.youtube.com/vi/<VIDEO-ID>/maxresdefault.jpg

推荐答案

为了获得此视频 ID,您可以使用 YouTube 数据 API

In order to get this video id you can use the YouTube Data API

您可以向以下地址发出 curl 请求:https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=1

You can make a curl request to: https://www.googleapis.com/youtube/v3/search?key={your_key_here}&channelId={channel_id_here}&part=snippet,id&order=date&maxResults=1

这将返回一个带有最新 YouTube 视频的视频 ID 的 JSON.

This would return a JSON with a video id for the latest youtube video.

这篇关于如何获取上次上传到 YouTube 的视频的 ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆