0

I'm using playlistItems to add 30 videos to a specific playlist that I have created. I have a list of the YouTube video IDs that I'm looping through in order to do this and I'm appending the response of each request to another list.

In this case I have tried the same list of videos 5 times and each gives a different result. When I go to the specific playlist that the videos have been added to I'm often getting 29/30 songs added, sometimes 28/30 and sometimes 30/30 songs added. But, for all of these playlists I am receiving 30 success responses back with status code of 200.

e.g. For one of the playlists the following video was supposed to be added: https://www.youtube.com/watch?v=u7SISw5KLMs. This was the response that was logged (I logged status_code and text):

200
{
  "kind": "youtube#playlistItem",
  "etag": "NEdtLlzsi_ZLt-t-9Un_WS1iaVA",
  "id": "UExBZXJ5NzlmV3F3bW9CZVBBbmY2LU1mNUQySlB5ZjAtNS45NzUwQkI1M0UxNThBMkU0",
  "snippet": {
    "publishedAt": "2022-07-25T10:25:51Z",
    "channelId": "UCc9n0SsljkAdeaaW0_TPEWg",
    "title": "I'm A Believer -The Monkees - Lyrics",
    "description": "\"I'm A Believer\" is track #12 on the album More of the Monkees. It was written by Diamond, Neil. \n\nI thought love was only true in fairytales\nMeant for someone else but not for me\nLove was out to get me\nThat's the way it seemed\nDisappointment haunted all my dreams\n\nThen I saw her face, now I'm a believer\nNot a trace of doubt in my mind\nI'm in love, I'm a believer\nI couldn't leave her if I tried\n\nI thought love was more or less a givin' thing\nBut the more I gave the less I got\nWhat's the use in trying?\nAll you get is pain\nWhen I needed sunshine I got rain\n\nThen I saw her face, now I'm a believer\nNot a trace of doubt in my mind\nI'm in love, I'm a believer\nI couldn't leave her if I tried\n\nLove was out to get me\nNow that's the way it seemed\nDisappointment haunted all my dreams\n\nOh then I saw her face, now I'm a believer\nNot a trace of doubt in my mind\nI'm in love, I'm a believer\nI couldn't leave her if I tried\n\nYes I saw her face, now I'm a believer\nNot a trace of doubt in my mind\nSaid I'm a believer, yeah, yeah, yeah, yeah, yeah\n(I'm a believer)\nSaid I'm a believer, yeah\n(I'm a believer)\nSaid I'm a believer, yeah\n(I'm a believer)",
    "thumbnails": {
      "default": {
        "url": "https://i.ytimg.com/vi/u7SISw5KLMs/default.jpg",
        "width": 120,
        "height": 90
      },
      "medium": {
        "url": "https://i.ytimg.com/vi/u7SISw5KLMs/mqdefault.jpg",
        "width": 320,
        "height": 180
      },
      "high": {
        "url": "https://i.ytimg.com/vi/u7SISw5KLMs/hqdefault.jpg",
        "width": 480,
        "height": 360
      },
      "standard": {
        "url": "https://i.ytimg.com/vi/u7SISw5KLMs/sddefault.jpg",
        "width": 640,
        "height": 480
      }
    },
    "channelTitle": "MFMM-Test-YT-Option 2",
    "playlistId": "PLAery79fWqwmoBePAnf6-Mf5D2JPyf0-5",
    "position": 23,
    "resourceId": {
      "kind": "youtube#video",
      "videoId": "u7SISw5KLMs"
    },
    "videoOwnerChannelTitle": "Aidan",
    "videoOwnerChannelId": "UCs7C_WDq7YKz_-ITQlXBvqQ"
  }
}

But this video is not found on the playlist. Does anyone know if there is some kind of issue with playlistItems or something I could potentially look into?

Thanks!

Kingsley
  • 1
  • 1
  • May you share us the playlist that should contain the 30 videos ? Otherwise you may be interested in the single request solution that I proposed [here](https://stackoverflow.com/a/71970181/7123660). – Benjamin Loison Jul 25 '22 at 13:33
  • My bad the playlist id is [PLAery79fWqwmoBePAnf6-Mf5D2JPyf0-5](https://www.youtube.com/playlist?list=PLAery79fWqwmoBePAnf6-Mf5D2JPyf0-5) but the playlist doesn't exist anymore or is private. – Benjamin Loison Jul 25 '22 at 14:50
  • I have changed the playlist from private to unlisted so it should be able to be accessed now. – Kingsley Jul 26 '22 at 07:17
  • So it doesn't seem related to hidden unavailable videos as [this playlist](https://www.youtube.com/playlist?list=PL8wZFyWE1ZaKi3kZVcgwGjlO6tWcFo09d). I would then just recommend you to build your playlist another way as I suggested as YouTube APIs are sometimes not working correctly. – Benjamin Loison Jul 26 '22 at 07:21

0 Answers0