porjo/youtubeuploader

madeForKids does not work

gan-of-culture opened this issue · 17 comments

If I upload a video with madeForKids set to false the videos will be uploaded but the "made for kids" setting is just not set for the video and has to be selected manually.

Which can also lead to a channel strike if your content does violate the Children's Online Privacy Protection Act, COPPA and/or other laws.

porjo commented

I just tested uploading two identical videos - first one with this set to false, and second one set to true - it looks good to me i.e. when I view each video within Youtube studio I see the correct setting:

Video1
Video2

fyi, the default setting is false (not made for kids), so you should not need to set it explicitly.

Can you share your metadata files that you used for the upload? I'll try it the without setting it specifically to false.

porjo commented

My meta.json file contained:

{ "madeForKids": false }

And I just switched that to true for the second video.

I just updated to the newest version and it still doesn't work if I have { "madeForKids": false } in my metadata file. I'll do a run without the madeForKids and the debug flag next.

porjo commented

when you say it doesn't work, how are you verifying that? If it continues to be a problem, please provide more detail e.g. screenshots etc.

Also note that Youtube have their own process they run on videos to determine if they are made for kids or not. But if anything, that would go the other way - video starts as made for kids, and gets changed to not made for kids after upload.

If I use youtubeuploader to upload a video, then the made for kids option is not set. Meaning neither the "is made for kids" nor the "is not made for kids" option is set. As soon as I go into YT Studio and edit the video I get a red message asking me to select one of the two options.

I'll soon update the issue with a screenshot and the info from my last comment.

here is a screenshot on how it looks:
image

here is my metadata file:

{
 "title": "some title",
 "description": "some description,
 "privacyStatus": "public",
 "embeddable": true,
 "playlistTitles": [
  "myPlaylist"
 ]
}

and this also doesn't work:

{
 "title": "some title",
 "description": "some description,
 "privacyStatus": "public",
 "madeForKids": false,
 "embeddable": true,
 "playlistTitles": [
  "myPlaylist"
 ]
}

But I followed https://support.google.com/youtube/answer/9527654 and maybe this will fix my issue by setting all videos to MadeForKids = false by default.

porjo commented

I've never had to set this on my channel, so assuming it defaults to 'not made for kids'. I see this in channel settings:

What is yours set to?

default was the third option for me. I set it to the second option just like in your screenshot.

porjo commented

ok, thanks for the confirmation. That explains the issue then.

aldoyh commented

Well, that option is not available anymore in the defaults settings of channel.

Screenshot 2023-06-29 at 08 50 28

Neither the json functionality as noted above.

you have to check the "Channel" tab. The screenshot shows the wrong section.

aldoyh commented

Yes true, my apologies for that:

Screenshot 2023-06-29 at 21 16 31

However, it's still not working from the -metaJSON

porjo commented

I've tested this again now (just to see if anything's changed). I used meta json file containing this:

{ "madeForKids": true }

My upload command was: ./youtubeuploader -filename test.mp4 -metaJSON meta.json

It worked as expected - the video uploaded successfully and when I view the video in Youtube Studio, I see this:
image

I also tried leaving the -metaJSON flag off (default NOT made for kids) and that also worked as expected - Youtube indicates not made for kids has been automatically selected.

porjo commented

I'm going to close this now. If it continues to be a problem for anyone, please let me know.

Geseti commented

Though I appreciate the suggested solution above to set the default to No in the YT studio settings, this was bugging me as I have my own script in python which works. I had decided to see if there were any existing uploaders around which lead me here.

Not done anything in Go before so haven't submitted a pull request, but on playing around I think I've found the route cause of this issue.
I'm using the current version which at time of writing is 23.05

  1. In files.go this will be ignored when madeForKids is set to false in a -metaJSON
    image
    In my own playing around I added an else to the above if - Note this did not fix it on its own

  2. Still puzzled as to why 1. didn't fix it... I continued digging around and wondered if it was the fault of the one of the google libraries as I couldn't see an easy way to debug out what JSON exactly was being set to the API.
    In this case google.golang.org/api/youtube/v3
    Which lead me to this issue of someone trying to do a similar thing:
    googleapis/google-api-go-client#554
    Link summary - False is ignored by the marshaled JSON when omitempty is present...
    Which it is for all of these fields (https://pkg.go.dev/google.golang.org/api/youtube/v3#VideoStatus)
    So as per the issue suggestion of using ForceSendFields I hardcoded the following line in files.go just before the return: video.Status.ForceSendFields = []string{"SelfDeclaredMadeForKids"}
    This then worked as expected for my upload "madeForKids": false in my metaJSON and my YT channel having no default setting applied.

Simplest solution that comes to mind would be that for each field present in the metaJSON to add the field string to the list of ForceSendFields, or at least any with a value of false.

P.S. I Like the CLI, main reason I started looking around was because I was getting frustrated with OAuth and this handles it well.

porjo commented

@Geseti thanks that is very helpful. I've included the suggested fix in PR #179 which will be in a future release is included in 23.06