从 YouTube Clip 中提取详细信息的方法

发布于 2025-01-15 14:11:46 字数 722 浏览 2 评论 0原文

我一直在寻找一种方法,当只知道 python 脚本中的剪辑 URL 时,从 YouTube 剪辑中提取详细信息。我特别需要原始频道名称。

YouTube API 似乎不包含任何这样做的方法,只是从已知的视频 ID 中提取详细信息。

例如,此剪辑:https://www.youtube.com/clip/UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW,与身份证UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW 来自此视频https://youtu.be/z-e2bDx7tUA,ID 为 z-e2bDx7tUA

z-e2bDx7tUA可以通过 API 进行搜索,但 UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW 则不能。

即使有更迂回的方法,例如获取剪辑 ID,然后获取视频 ID,然后能够在 API 中使用它,也是可行的。但我还没有找到有效的方法,包括网络抓取。

任何帮助将不胜感激。

I've been looking for a method to extract details from a YouTube clip when only knowing the clip URL within a python script. I specifically need the original channel name.

The YouTube API does not seem to include any method to do so, only to extract details from a known video ID.

For example, this clip: https://www.youtube.com/clip/UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW, with the ID UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW is from this video https://youtu.be/z-e2bDx7tUA, with the ID z-e2bDx7tUA.

z-e2bDx7tUA is searchable with the API, but UgkxnEqNDtOHMOOoS5TyJFr2QOjdKbaTOTlW is not.

Even if there's a more roundabout method, such as getting the clip ID, then getting the video ID and then being able to use that within the API would work. But I've not found an efficient way of doing so, including web scraping.

Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人│生佛魔见 2025-01-22 14:11:46

YouTube Data API v3 再次不提供一项基本功能。

我建议您使用我的开源< /a> YouTube 操作 API。事实上,通过使用 https://yt.lemnoslife.com/videos?part=id& ;clipId=CLIP_ID 您将在 item['videoId'] 中获得与剪辑关联的视频 ID。

例如 CLIP_ID UgkxfiAGoXJYA02_JdIzA3k3pvqpLNm90DBx提取自 videoId 9bZkp7q19f0

One more time YouTube Data API v3 doesn't provide a basic feature.

I recommend you to use my open-source YouTube operational API. Indeed by using https://yt.lemnoslife.com/videos?part=id&clipId=CLIP_ID you'll get in item['videoId'] the video id associated with the clip.

For example the CLIP_ID UgkxfiAGoXJYA02_JdIzA3k3pvqpLNm90DBx is extracted from the videoId 9bZkp7q19f0.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文