从 YouTube Clip 中提取详细信息的方法
我一直在寻找一种方法,当只知道 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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 thevideoId
9bZkp7q19f0
.