David Doughty February 2016

YouTube API textDisplay is blank for all comments

We have a site that has been using the YouTube API to load comments for videos for several months without issue. This weekend we noticed that the comment text has disappeared for all comments, across all videos! Author info, publishdAt, etc are all coming through just fine, but snippet.textDisplay is blank for every comment. If I view the video on YouTube.com, the comments are fine.

Sample API URL: https://www.googleapis.com/youtube/v3/commentThreads?videoId=1nFywcC37i0&key=PRIVATE_KEY&part=snippet,replies

Partial JSON return:

{
 "kind": "youtube#commentThreadListResponse",
 "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/HnKLJJvaX5o82p7SOXqZoax63Pk\"",
 "nextPageToken": "Cg0QvLX3nrHpygIgACgBEhQIAxDQibyJ2oDKAhiwy_Dp193CAhgCIBEo_dG1q83Pj81Z",
 "pageInfo": {
  "totalResults": 17,
  "resultsPerPage": 20
 },
 "items": [
  {
   "kind": "youtube#commentThread",
   "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/Fme5IvQu6tqWHp4YOLrYer7CIV0\"",
   "id": "z12mcbxpbsvvvjpep22qufvxxsqiith5g04",
   "snippet": {
    "videoId": "1nFywcC37i0",
    "topLevelComment": {
     "kind": "youtube#comment",
     "etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/ldVLSDtTKPhMl-FtaJHj6FzFBxs\"",
     "id": "z12mcbxpbsvvvjpep22qufvxxsqiith5g04",
     "snippet": {
      "authorDisplayName": "Tea Culture",
      "authorProfileImageUrl": "https://lh3.googleusercontent.com/-gnq7syMNFPM/AAAAAAAAAAI/AAAAAAAABcY/GOY--FZpe0w/photo.jpg?sz=50",
      "authorChannelUrl": "http://www.youtube.com/channel/UCLTjm6qRUveEL2-q0UcFjWQ",
      "authorChannelId": {
       "value": "UCLTjm6qRUveEL2-q0UcFjWQ"
      },
      "videoId": "1nFywcC37i0",
      "textDisplay": "",
      "authorGoogleplusProfileUrl": "https://plus.google.com/113856310904021846289",
      "canRate": false,
      "viewerRating": "none",
      "likeCount": 1,
      "publishedAt": "        

Answers


David Doughty February 2016

It does appear to be a recent bug; I'll keep an eye on the report at http://code.google.com/p/gdata-issues/issues/detail?id=7969, and implement the workaround to use textFormat as plainText for now.


Jesse Sivonen February 2016

For a workaround if you need to have textFormat html, you can receive the comment by requesting comments list. Set filter id to id of topLevelComment found in commentThreads list response.

https://www.googleapis.com/youtube/v3/comments?id=TOP_LEVEL_COMMENT_ID&key=PRIVATE_KEY&part=snippet

Post Status

Asked in February 2016
Viewed 2,503 times
Voted 10
Answered 2 times

Search




Leave an answer