From 259df8d2579418417bf5f9f666b1f41a63b04856 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Thu, 12 Mar 2020 04:08:50 +0100 Subject: [PATCH] restrict length amount on small youtubers --- manager/manager.go | 3 +++ sdk/api.go | 1 + 2 files changed, 4 insertions(+) diff --git a/manager/manager.go b/manager/manager.go index bdb7230..a337424 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -168,6 +168,9 @@ func (s *SyncManager) Start() error { } for i, c := range channels { log.Infof("There are %d channels in the \"%s\" queue", len(channels)-i, q) + if c.TotalSubscribers < 1000 { + s.maxVideoLength = 1.0 + } syncs = append(syncs, Sync{ APIConfig: s.apiConfig, YoutubeChannelID: c.ChannelId, diff --git a/sdk/api.go b/sdk/api.go index 18d89b7..fe188da 100644 --- a/sdk/api.go +++ b/sdk/api.go @@ -56,6 +56,7 @@ type Fee struct { type YoutubeChannel struct { ChannelId string `json:"channel_id"` TotalVideos uint `json:"total_videos"` + TotalSubscribers uint `json:"total_subscribers"` DesiredChannelName string `json:"desired_channel_name"` Fee *Fee `json:"fee"` ChannelClaimID string `json:"channel_claim_id"`