Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ Video title, description etc can specified via the command line flags or via a J
"title": "Il mio titolo in italiano",
"description": "La mia descrizione in italiano"
}
}
},
"containsSyntheticMedia": false
}
```
- all fields are optional
Expand Down
6 changes: 4 additions & 2 deletions files.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func LoadVideoMeta(config Config) (*VideoMeta, *youtube.Video, error) {
// Force send some boolean values.
// Without this, defaults on the Youtube side are used which can have unexpected results.
// See: https://github.com/porjo/youtubeuploader/issues/132
video.Status.ForceSendFields = []string{"SelfDeclaredMadeForKids"}
video.Status.ForceSendFields = []string{"SelfDeclaredMadeForKids", "ContainsSyntheticMedia"}

// attempt to load from meta JSON, otherwise use values specified from command line flags
if config.MetaJSON != "" {
Expand Down Expand Up @@ -132,13 +132,15 @@ func LoadVideoMeta(config Config) (*VideoMeta, *youtube.Video, error) {
if videoMeta.PublicStatsViewable {
video.Status.PublicStatsViewable = videoMeta.PublicStatsViewable
}
if videoMeta.ContainsSyntheticMedia {
video.Status.ContainsSyntheticMedia = true
}
if !videoMeta.PublishAt.IsZero() {
if video.Status.PrivacyStatus != "private" {
fmt.Printf("publishAt can only be used when privacyStatus is 'private'. Ignoring publishAt...\n")
} else {
if videoMeta.PublishAt.Before(time.Now()) {
fmt.Printf("publishAt (%s) was in the past!? Publishing now instead...\n", videoMeta.PublishAt)
video.Status.PublishAt = time.Now().UTC().Format(ytDateLayout)
} else {
video.Status.PublishAt = videoMeta.PublishAt.UTC().Format(ytDateLayout)
}
Expand Down
13 changes: 7 additions & 6 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ type VideoMeta struct {
Tags []string `json:"tags,omitempty"`

// status
PrivacyStatus string `json:"privacyStatus,omitempty"`
Embeddable bool `json:"embeddable,omitempty"`
License string `json:"license,omitempty"`
PublicStatsViewable bool `json:"publicStatsViewable,omitempty"`
PublishAt Date `json:"publishAt,omitempty"`
MadeForKids bool `json:"madeForKids,omitempty"`
PrivacyStatus string `json:"privacyStatus,omitempty"`
Embeddable bool `json:"embeddable,omitempty"`
License string `json:"license,omitempty"`
PublicStatsViewable bool `json:"publicStatsViewable,omitempty"`
PublishAt Date `json:"publishAt,omitempty"`
MadeForKids bool `json:"madeForKids,omitempty"`
ContainsSyntheticMedia bool `json:"containsSyntheticMedia,omitempty"`

// recording details
RecordingDate Date `json:"recordingDate,omitempty"`
Expand Down
Loading