Skip to content

Conversation

@viniciusrtf
Copy link
Contributor

Add support for -containsSyntheticMedia via CLI or via JSON (with -metaJSON flag).
In the backend will add the flag to status.containsSyntheticMedia.

notifySubscribers := flag.Bool("notify", true, "notify channel subscribers of new video. Specify '-notify:=false' to disable.")
debug := flag.Bool("debug", false, "turn on verbose log output")
sendFileName := flag.Bool("sendFilename", true, "send original file name to YouTube")
containsSyntheticMedia := flag.Bool("containsSyntheticMedia", false, "video contains synthetic media")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer not to add any more flags that relate to video metadata, and instead leave those kinds of things in the metadata JSON file only. At some point in the future I may overhaul the cli and include every option as a flag. For now, please remove this flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed :-)
Please check.

SendFileName: *sendFileName,
PlaylistIDs: playlistIDs,
RecordingDate: recordingDate,
ContainsSyntheticMedia: *containsSyntheticMedia,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove (see earlier comment about flags).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed :-)
Please check.

Comment on lines 215 to 236
func TestContainsSyntheticMedia(t *testing.T) {
url, err := url.Parse(testServer.URL)
if err != nil {
log.Fatal(err)
}

transport := &mockTransport{url: url}
limitTransport, err := limiter.NewLimitTransport(transport, limiter.LimitRange{}, fileSize, 0)
if err != nil {
t.Fatal(err)
}
config.ContainsSyntheticMedia = true
ctx := context.Background()
videoReader := &mockReader{fileSize: fileSize}
defer videoReader.Close()

err = yt.Run(ctx, limitTransport, config, videoReader)
if err != nil {
log.Fatal(err)
}
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate you making the effort to create a test, however this test doesn't really achieve anything useful. Please remove it. (I don't think it's really necessary to have tests for all the video properties)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're totally right, sorry about this brain cramp, removed :)

files.go Outdated
NotifySubscribers bool
SendFileName bool
RecordingDate Date
ContainsSyntheticMedia bool
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove (see earlier comment about flags).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed :)
Please check.

http.go Outdated
PublicStatsViewable bool `json:"publicStatsViewable,omitempty"`
PublishAt Date `json:"publishAt,omitempty"`
MadeForKids bool `json:"madeForKids,omitempty"`
ContainsSyntheticMedia *bool `json:"containsSyntheticMedia,omitempty"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this to not be a pointer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Please check :)

files.go Outdated
Comment on lines 154 to 157
if config.ContainsSyntheticMedia {
video.Status.ContainsSyntheticMedia = true
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove (see earlier comment about flags).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, please check :)

files.go Outdated
if videoMeta.PublicStatsViewable {
video.Status.PublicStatsViewable = videoMeta.PublicStatsViewable
}
if videoMeta.ContainsSyntheticMedia != nil {
Copy link
Owner

@porjo porjo Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be a pointer. Instead use if videoMeta.ContainsSyntheticMedia {. Also, please update the example metadata JSON in the README to include this option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to match MadeForKids logic. Also added example to README.md. Please check :)

Copy link
Owner

@porjo porjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@porjo porjo merged commit 301e563 into porjo:master Aug 14, 2025
2 checks passed
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.

2 participants