diff --git a/main.go b/main.go index d3c706d..e71ad54 100644 --- a/main.go +++ b/main.go @@ -57,7 +57,7 @@ func main() { cmd.Flags().StringVar(&syncStatus, "status", "", "Specify which queue to pull from. Overrides --update") cmd.Flags().StringVar(&channelID, "channelID", "", "If specified, only this channel will be synced.") cmd.Flags().Int64Var(&syncFrom, "after", time.Unix(0, 0).Unix(), "Specify from when to pull jobs [Unix time](Default: 0)") - cmd.Flags().Int64Var(&syncUntil, "before", time.Now().Unix(), "Specify until when to pull jobs [Unix time](Default: current Unix time)") + cmd.Flags().Int64Var(&syncUntil, "before", time.Now().AddDate(1, 0, 0).Unix(), "Specify until when to pull jobs [Unix time](Default: current Unix time)") cmd.Flags().IntVar(&concurrentJobs, "concurrent-jobs", 1, "how many jobs to process concurrently") cmd.Flags().IntVar(&videosLimit, "videos-limit", 1000, "how many videos to process per channel") cmd.Flags().IntVar(&maxVideoSize, "max-size", 2048, "Maximum video size to process (in MB)") diff --git a/sdk/api.go b/sdk/api.go index 1223b0f..9d00522 100644 --- a/sdk/api.go +++ b/sdk/api.go @@ -14,7 +14,7 @@ import ( ) const ( - MaxReasonLength = 500 + MaxReasonLength = 490 ) type APIConfig struct { diff --git a/sources/youtubeVideo.go b/sources/youtubeVideo.go index 278c729..96011ca 100644 --- a/sources/youtubeVideo.go +++ b/sources/youtubeVideo.go @@ -142,6 +142,10 @@ func (v *YoutubeVideo) download() error { return errors.Err("no compatible format available for this video") } maxRetryAttempts := 5 + if videoInfo.Duration.Hours() > 2 { + return errors.Err("video is too long to process") + } + for i := 0; i < len(formats) && i < maxRetryAttempts; i++ { formatIndex := i if i == maxRetryAttempts-1 { diff --git a/ytsync.go b/ytsync.go index 462b467..64a5445 100644 --- a/ytsync.go +++ b/ytsync.go @@ -564,6 +564,7 @@ func (s *Sync) startWorker(workerNum int) { "Unable to extract signature tokens", "Client.Timeout exceeded while awaiting headers)", "the video is too big to sync, skipping for now", + "video is too long to process", } if util.SubstringInSlice(err.Error(), errorsNoRetry) { log.Println("This error should not be retried at all") @@ -760,6 +761,7 @@ func (s *Sync) processVideo(v video) (err error) { "Error extracting sts from embedded url response", "Unable to extract signature tokens", "the video is too big to sync, skipping for now", + "video is too long to process", } if ok && !sv.Published && util.SubstringInSlice(sv.FailureReason, neverRetryFailures) { log.Println(v.ID() + " can't ever be published")