YouTube 私人/不公开视频(按频道 ID) [英] YouTube Private/Unlisted Videos By Channel ID

查看:71
本文介绍了YouTube 私人/不公开视频(按频道 ID)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过指定频道 ID 来获取特定频道的视频列表.我使用了搜索,但它仅适用于公共视频.我需要通过 HTTP 请求或 SDK(C# 中的 NuGet 包)获取此列表(尤其是未列出的视频).请注意,这些未列出的视频可能不在播放列表中,因此我需要一个仅基于频道 ID 的通用解决方案(如果存在).此外,我正在以拥有/发布这些不公开视频的用户身份进行身份验证(如果这会有所作为).

I am trying to get the list of the videos for a specific channel by specifying the channel ID. I used the search but it worked only for public videos. I need to get this list (especially of unlisted videos) either by HTTP requests, or the SDK (NuGet package in C#) preferably. Please note that these unlisted videos may not be in a playlist, so I need a generic solution solely based on channel ID if it exists. Also, I am authenticating as a user who owns/posted those unlisted videos, if that'll make any difference.

推荐答案

请注意,未经适当授权,不能列出非公开视频元数据.

Please note that without proper authorization, one cannot list non-public video meta-data.

列出给定频道的视频元数据,您可以使用PlaylistItems.list 使用参数 playlistId 设置为该频道上传播放列表的 ID.

For to list a given channel's video meta-data, you may employ the PlaylistItems.list API endpoint queried with the parameter playlistId set to the ID of that channel's uploads playlist.

通过调用 Channels 可以很容易地获得后一个 ID.list 端点使用参数 id 设置为您频道的 ID,或者通过传递参数 minemine=true.

然后可以在端点的 JSON 响应中找到上传播放列表 ID 作为属性值 items[0].contentDetails.relatedPlaylists.uploads.请注意,对于给定的频道,您只需获取一次上传播放列表 ID,然后根据需要多次使用.

The uploads playlist ID is then to be found within the endpoint's JSON response as value of the property items[0].contentDetails.relatedPlaylists.uploads. Note that for a given channel, you need to obtain the uploads playlist ID only once, then use it as many times as you wish.

通常,频道 ID 与其对应的上传播放列表 ID 通过 s/^UC([0-9a-zA-Z_-]{22})$/UU\1/ 相关联.

Usually, a channel ID and its corresponding uploads playlist ID are related by s/^UC([0-9a-zA-Z_-]{22})$/UU\1/.

这篇关于YouTube 私人/不公开视频(按频道 ID)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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