Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change PlaylistItemsListRequest models #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smapira
Copy link

@smapira smapira commented Jan 20, 2019

Thanks for your work! I am not sure, have got the below error when use PlaylistItemsListRequest. Might be, thumbnails models will be nil using privete video etc...

When:
Using youtubekit v0.3.0

Gienv:

let request = PlaylistItemsListRequest(part: [.id, .snippet, .contentDetails],
                                                  filter: .playlistID("xxxxxxxxxxxxxxxxx"),
                                                  maxResults: 20)

// Send a request.
ApiSession.shared.send(request) { result in
    switch result {
    case .success(let response):
        print(response)
    case .failed(let error):
        print(error)
    }
}

Then
Got an error:

keyNotFound(CodingKeys(stringValue: "contentDetails", intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "items", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0)], debugDescription: "No value associated with key CodingKeys(stringValue: "contentDetails", intValue: nil) ("contentDetails").", underlyingError: nil))

@smapira smapira changed the title Change PlaylistItemsListRequest models #42 Change PlaylistItemsListRequest models Jan 20, 2019
@QaiserAbbas
Copy link

hello,
I am not getting any playlists item.

    let request = PlaylistItemsListRequest(part: [.id, .snippet, .contentDetails, .status], filter: .id(playListID), maxResults: 20)

    // Send a request
    YoutubeAPI.shared.send(request) { result in
        switch result {
        case .success(let response):
            print(response.items)
        case .failed(let error):
            print(error)
        }
    }

Any help?

@rinov
Copy link
Owner

rinov commented Sep 22, 2022

@QaiserAbbas .id() is playlist item ID, so you should use .playlistID().
https://developers.google.com/youtube/v3/docs/playlistItems/list?hl=en

@rinov
Copy link
Owner

rinov commented Sep 22, 2022

thumbnails models will be nil using privete video etc...

@smapira i see. I tested on my private playlist and it'll return 404. Are you use limited access playlist?
Anyway, id and publishedAt are returned correctly. Can you give me an example playlist id?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants