为什么 Youtube API 的日程视频不起作用? [英] Why is Youtube API's schedule video not working?

查看:24
本文介绍了为什么 Youtube API 的日程视频不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用这里的确切示例:https://developers.google.com/youtube/v3/docs/videos/插入

I am using the exact example from here: https://developers.google.com/youtube/v3/docs/videos/insert

为了实现调度,这是我添加到参数中的内容:

To achieve scheduling this is what I have added to arguments:

privacyStatus='private', 
publishAt='2018-12-21T02:01:07.000Z'

(请验证 publishAt 具有正确的 ISO 8601 格式)

(please verify publishAt has correct ISO 8601 format )

我获得了成功(200),但上传的视频只是私人的,不是预定的.

I am getting success(200) but the uploaded video is only private, not scheduled.

推荐答案

发现问题,因为我从示例中复制了代码,我忘记更新 initialize_upload 函数以包含 publishAtstatus 字典中的 code>.

Found the issue, since I copied the code from example I forgot to update the initialize_upload function to include publishAt in the status dictionary.

def initialize_upload(youtube, options):
    tags = None
    if options.keywords:
        tags = options.keywords.split(',')

    body=dict(
        snippet=dict(
            title=options.title,
            description=options.description,
            tags=tags,
            categoryId=options.category
        ),
        status=dict(
            privacyStatus=options.privacyStatus,
            publishAt=options.publishAt
        )
    )

这篇关于为什么 Youtube API 的日程视频不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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