Skip to content

add support for -containsSyntheticMedia - #210

Merged
porjo merged 4 commits into
porjo:masterfrom
viniciusrtf:isalteredcontent
Aug 14, 2025
Merged

porjo merged 4 commits into
porjo:masterfrom
viniciusrtf:isalteredcontent

Conversation

@viniciusrtf

Copy link
Copy Markdown
Contributor

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

Comment thread cmd/youtubeuploader/main.go Outdated
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
Copy Markdown
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
Copy Markdown
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 thread cmd/youtubeuploader/main.go Outdated
SendFileName: *sendFileName,
PlaylistIDs: playlistIDs,
RecordingDate: recordingDate,
ContainsSyntheticMedia: *containsSyntheticMedia,

Copy link
Copy Markdown
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
Copy Markdown
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 thread test/upload_test.go Outdated
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
Copy Markdown
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
Copy Markdown
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 :)

Comment thread files.go Outdated
NotifySubscribers bool
SendFileName bool
RecordingDate Date
ContainsSyntheticMedia bool

Copy link
Copy Markdown
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
Copy Markdown
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 thread 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
Copy Markdown
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
Copy Markdown
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 :)

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

Copy link
Copy Markdown
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
Copy Markdown
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 :)

Comment thread files.go Outdated
if videoMeta.PublicStatsViewable {
video.Status.PublicStatsViewable = videoMeta.PublicStatsViewable
}
if videoMeta.ContainsSyntheticMedia != nil {

@porjo porjo Aug 13, 2025 •

Copy link
Copy Markdown
Owner

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
Copy Markdown
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 :)

Comment thread files.go Resolved

@porjo porjo left a comment

Copy link
Copy Markdown
Owner

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
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

⌂ 换网址