0

I'm using the youtube data api (v3-rev222-1.25.0) to list all videos from the 'uploads' playlist of an youtube channel. The result of this request is a list with duplicated entries (see below). Even worse, these entries also hide other uploaded videos. Bottom line is, the list doesn't show all videos uploaded for a channel.

The URL for the 'uploads' play list is: https://www.youtube.com/playlist?list=UU_G9FS-HSMW6Jm-R4mwf8ng

String nextPageToken = null;
do {
    PlaylistItemListResponse response = getService().playlistItems()
            .list("snippet,contentDetails")
            .setPlaylistId("UU_G9FS-HSMW6Jm-R4mwf8ng")
            .setMaxResults(25L)
            .setPageToken(nextPageToken)
            .execute();
    nextPageToken = response.getNextPageToken();
    for (PlaylistItem item: response.getItems())
        System.out.println(item.getSnippet().getPosition() + "\t" +
                item.getId() + "\t" +
                item.getContentDetails().getVideoId() + "\t" +
                item.getSnippet().getTitle());
} while(nextPageToken != null);

This code snipped outputs the following lines (excerpt). You can see, there are some duplicated entries with the same playlist id and with the same vidoe id but with a different position within the playlist 'uploads'. There are much more such duplicated entries.

...
1076    VVVfRzlGUy1IU01XNkptLVI0bXdmOG5nLl9TblRlQU84aHFN    _SnTeAO8hqM
...
1126    VVVfRzlGUy1IU01XNkptLVI0bXdmOG5nLl9TblRlQU84aHFN    _SnTeAO8hqM
...
1163    VVVfRzlGUy1IU01XNkptLVI0bXdmOG5nLl9TblRlQU84aHFN    _SnTeAO8hqM
...
1017    VVVfRzlGUy1IU01XNkptLVI0bXdmOG5nLjBRRlozUmI3blgw    0QFZ3Rb7nX0
...
1065    VVVfRzlGUy1IU01XNkptLVI0bXdmOG5nLjBRRlozUmI3blgw    0QFZ3Rb7nX0
...

Can anyone determine what the problem is?

  • You seem to have [latest version](https://developers.google.com/resources/api-libraries/documentation/youtube/v3/java/latest/), I don't know whether or not it interests you but I would give a shot to [this answer](https://stackoverflow.com/a/27872244/7123660) (involving working with URLs instead of the Java API). If it doesn't work tell me I have another harder workaround that should work. – Benjamin Loison Jan 18 '22 at 18:23
  • Thank you Benjamin for your suggestion. I tried the call via the URL with the same result. I also checked the 'uploads' playlist [directly on Youtube](https://www.youtube.com/playlist?list=UU_G9FS-HSMW6Jm-R4mwf8ng). There are multiple videos here too. So I think the problem is in the 'uploads' playlist itself :-/ – Andreas Göbel Jan 19 '22 at 07:49
  • Can you have a look to this possible solution ? https://stackoverflow.com/a/69121286/7123660 – Benjamin Loison Jan 19 '22 at 14:43
  • @AndreasGöbel I saw a ticket on Issue Tracker - [see the ticket details](https://issuetracker.google.com/issues/189615530) - as I understand this issue, it's from the API's side. – Marco Aurelio Fernandez Reyes Jan 19 '22 at 20:05
  • 1
    @Marco Aurelio Fernandez Reyes Yes, the problem in the ticket is the same I have. I stared the ticket... – Andreas Göbel Jan 20 '22 at 07:27
  • Be sure that YouTube won't ever solve the problems look at the date when all of the many issues were raised. If I were I would go for a workaround as I mentionned. If you have questions about it, don't hesitate to ask me. – Benjamin Loison Jan 20 '22 at 20:37

0 Answers0