Why is Youtube API's schedule video not working?

╄→гoц情女王★ 提交于 2019-12-11 15:36:28

问题


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'

(please verify publishAt has correct ISO 8601 format )

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


回答1:


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
        )
    )


来源:https://stackoverflow.com/questions/53873979/why-is-youtube-apis-schedule-video-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!