问题
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