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

Error when private video added to playlist #74

Closed
Fabian42 opened this issue Apr 26, 2020 · 6 comments
Closed

Error when private video added to playlist #74

Fabian42 opened this issue Apr 26, 2020 · 6 comments
Labels

Comments

@Fabian42
Copy link
Contributor

When a newly uploaded private video gets added to one of the playlists on the right, the script tries to add it to the playlist on the left and fails. The debug sheet shows this error:

Couldn't update playlist with video (UuZv1vdNoxM), ERROR: Message: [API call to youtube.playlistItems.insert failed with error: Video not found.] Details: {"message":"Video not found.","code":404,"errors":[{"domain":"youtube.playlistItem","reason":"videoNotFound","message":"Video not found."}]}

This might be related to the fact that "made for kids" videos now cannot be added to playlists (usually?), so it probably fails on all private videos, because it can't check if it has that property set or not. But that's just a guess.

I don't know what the best solution would be here, because just skipping all private videos would make the script not add any videos ever that were uploaded with a schedule.

@victorjzsun
Copy link
Collaborator

When looking for new videos, the functions getVideosIds and getVideosIdsWithLessQueries (get videos from channel IDs) can't find unlisted or private videos. Videos that are uploaded with a schedule have a published date, and thus will be added to the playlist when the script is run after the published date.

The function getPlaylistVideoIds is slightly different. It can still find both unlisted and private videos that have been added to a playlist. Trying to add an unlisted video to the target playlist is fine, but adding a private video isn't, which is probably why your script crashed.

Luckily, we can check if a video obtained from a playlist is private. Within the getPlaylistVideoIds function, we can check the title and description of the video before adding it to the queue of videos to add. Below is the output of the PlaylistItems.list API call for a private video:
image

I haven't considered the "made for kids" impact on this script, will look into it more.

@Fabian42
Copy link
Contributor Author

What would be your proposed solution? Because if a private (scheduled) video gets added to a playlist, the script skips it and it gets later set to public, the script wouldn't realise that it should then add it, right? As far as I know, the script has no memory of which videos it already handled, except for the timestamp per row. And the video was uploaded earlier, just not published. Is there also a published date field that can be accessed by the script?

@victorjzsun
Copy link
Collaborator

victorjzsun commented Apr 28, 2020

I understand your concern, and I've tested it thoroughly myself. The script only looks for published dates, not uploaded dates, so that case is already covered. All scheduled videos will be added correctly.

@victorjzsun
Copy link
Collaborator

I made the change for this issue as mentioned in #87 , but unable to test since I don’t know any playlists with private videos, @Fabian42 do you have any examples ? If it does indeed work, we can close the issue

@Fabian42
Copy link
Contributor Author

Fabian42 commented Jan 25, 2021 via email

@victorjzsun
Copy link
Collaborator

Sorry for the delay, but I just tried it and it seems to work.
image
I'll close the issue then, but feel free to reopen if something comes up

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

No branches or pull requests

2 participants