问题
I want to update my Youtube video snippet.description
from the API exposed through Google Apps Script. The snippet contains formatting so I am trying to use HTML. I expect to see the updated snippet on my Youtube video. But I get the following error instead.
API call to youtube.videos.update failed with error: The request metadata specifies an invalid video description. (line 88, file "Youtube")
How can I format my video description?
Youtube.gsfunction updateVideo( data ) {
var videoId = 'foo';
var title = 'bar';
var description = '<p>baz</p><p>bat</p>';
var resource = {
id: videoId,
snippet: {
title: title,
description: description,
categoryId: '22'
}
};
YouTube.Videos.update(resource, 'id,snippet'); // this is line 88
}
回答1:
You can't use HTML so you have to use string symbols for newline \n
and tab \t
, etc.
var description = 'baz\n\nbat';
I don't know how to add other HTML features like links, etc. Maybe someone else can improve upon this answer by adding that information if they know how to do it.
来源:https://stackoverflow.com/questions/59039711/how-to-update-html-of-youtube-video-snippet-description-from-the-api-exposed-thr