使用主题组件将视频上传到YouTube和Vimeo

I’m on this step

It’s asking me what scopes to select for OAuth. Out of the 34 available, which ones need to be selected?

Screenshot of the Update selected scopes screen

You should only need upload related permissions. These are the only ones required for the plugin, you can add anything you want though better not to unless you really need them.

1 个赞

Thanks @ti0 !

Google is now asking us to do the following

  1. Answer: How will the scopes be used? Explain to Google why you need these scopes, how you will use them, and why more limited scopes aren’t sufficient.

  2. Demo video: how will the scopes will be used? A YouTube video link is required when selecting sensitive or restricted scopes. Your YouTube video should demonstrate the OAuth grant process by users and explain, in detail, how you’ll use sensitive and restricted scopes within the app’s functionality for each OAuth client belonging to the project. Learn more The video should clearly show the app’s details such as the app name, OAuth client ID, and so on.

Could we create a template answer that is then added to this documentation?

I’ll try my best with #1 and definitely need help with #2.

  1. Users of our app will be able to upload videos directly to their Youtube account via our online forum at hub.youthpowercoalition.org. We need to be able to view their YouTube account and manage their YouTube videos in order to upload the video. Users choose their desired privacy level.

What do you think?

This sounds a bit dangerous because you don’t actually need to be able to view their account. The permissions give the app the ability to list their existing videos and add new ones.
I think just mentioning the first line is sufficient, and additionally you can put:

The permissions will give users the ability to upload and embed videos directly within our private instance of the open source forum software called Discourse (htttps://discourse.org). The app uses plugins to enable different functionality, the open source plugin for uploading videos is listed here: Video Upload to YouTube and Vimeo using Theme Component

I think this should be sufficient for #1.
For #2 you can make a quick demo of the upload process or use this one :

1 个赞

The language and video link you provided worked well, @ti0, thank you!

Here’s the next message I got from the Google Cloud Trust & Safety Team regarding consent.

We reviewed your project and found that your privacy policy Privacy - Youth Power Hub doesn’t meet our requirements for the Google API Service: User Data Policy. If you want to continue with the verification process, please make sure the privacy policy linked to your project follows these requirements:

Privacy Policy Requirements

  • The URL in your project points to a privacy policy on a publicly accessible domain.
  • The privacy policy is hosted and accessible in the domain of your website.
  • The privacy policy is accessible from the app’s home page.
  • Users can view the privacy policy.
  • The privacy policy clearly describes the way your application accesses, uses, stores, or shares Google user data.
  • The privacy policy is linked to the OAuth Consent Screen on the Google API Console.
  • You only use Google user data in the ways described in your published privacy policy.

Limited Use Requirements

If your app uses restricted scopes, we’ll check that your privacy policy follows our Limited Use requirements.

You can find more information in the OAuth Application Verification FAQ.

Is there recommended language for the privacy policy?

1 个赞

您好!
我正在尝试上传 YouTube 视频,但遇到了此 JavaScript 错误:

Uncaught {error: 'idpiframe_initialization_failed', details: 'Cookies are not enabled in current environment.'}

但据我所知,Cookie 应该是启用的……

您是否禁用了第三方 Cookie?您的地址栏中是否有此项? image.png

1 个赞

抓得好。我相信谷歌默认会停用第三方 Cookie,但我也可能弄错……

我现在遇到了另一个错误:

POST https://www.googleapis.com/upload/youtube/v3/videos?part=snippet%2Cstatus&uploadType=resumable 401
Unauthorized

访问权限是正确的:

我在通过 Discourse 界面上传视频的过程中采取了以下步骤:

你拿到令牌了吗?你必须先用谷歌进行身份验证并获取令牌,看起来你没有。

1 个赞

您是指客户端 ID 吗?

我在主题组件设置中已将其设置好:


编辑:Vimeo 上传也无法正常工作。

这很奇怪,因为上次尝试使用您的主题组件时,YouTube 和 Vimeo 都没问题。:confused:

错误消息:

POST https://api.vimeo.com/me/videos 401 (Unauthorized)

1 个赞

我们使用 Vimeo 来制作 Pinterest 视频 :movie_camera: :movie_camera: :movie_camera:

最近有人成功安装并使用了这个主题组件吗?

是的,我用它配合 Vimeo。:slightly_smiling_face:

您碰巧看到我的截图有什么问题吗?我有点沮丧,因为我以前能弄懂这个主题组件的工作方式,但现在却不行了。:face_with_raised_eyebrow:

1 个赞

您好,

我没有尝试设置 YouTube 版本,但使用 Vimeo 时,我遵循了 OP 的视频。

在生成访问令牌页面上,选择 Authenticated (you)(我认为这可能是您的问题),在 Scopes 中选择 Public (required)、PrivateUpload

然后点击 Generate,并将密钥复制到 Discourse 设置中的 vimeo api access token

2 个赞

您好,

我正在尝试实现 YouTube 上传。我遵循了所有建议的流程,但仍然无法正常工作,一直卡在身份验证环节。

或者,是否有任何替代插件可以上传任何文件到社区?

1 个赞

“上传任何文件到社区”,严格来说,你只需要将设置 authorized extensions 改为任何扩展名即可。
但是你会被 max attachment size 限制,虽然你可以增加它,但 Discourse 本身并不是一个文件托管服务,而且我看到有些人尽管设置正确,但在处理非常大的文件时遇到了麻烦。

但我猜你真正想要的是一种简单的方式让你的用户在 Discourse 中展示他们自己的视频。

据我所知,除了这个插件之外,没有其他插件或主题组件了,如果你因为任何原因无法设置它,那么你的用户只能依赖外部的、与 Discourse 兼容的解决方案(在这种意义上,媒体可以在 Discourse 帖子中进行 oneboxed),例如上传到 Youtube、Vimeo 或任何其他专业或云服务。

3 个赞

聊天中是否有可能支持上传?

不是我这边的问题,如果有人想添加该支持,欢迎贡献一个 PR。

2 个赞

你好 @Canapin
你解决YouTube这个问题了吗?
我遇到了完全相同的问题……
谢谢!

1 个赞