Skip to content

Commit

Permalink
fix livestreams failing for wrong reason
Browse files Browse the repository at this point in the history
  • Loading branch information
nikooo777 committed Aug 24, 2021
1 parent a224fe4 commit 6944e17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sources/youtubeVideo.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ func (v *YoutubeVideo) download() error {
defer func(start time.Time) {
timing.TimedComponent("download").Add(time.Since(start))
}(start)
if v.youtubeInfo.IsLive == true {
return errors.Err("video is a live stream and hasn't completed yet")
}

videoPath := v.getFullPath()

err := os.Mkdir(v.videoDir(), 0777)
Expand Down Expand Up @@ -783,6 +781,9 @@ func (v *YoutubeVideo) downloadAndPublish(daemon *jsonrpc.Client, params SyncPar
dur := time.Duration(v.youtubeInfo.Duration) * time.Second
minDuration := 7 * time.Second

if v.youtubeInfo.IsLive == true {
return nil, errors.Err("video is a live stream and hasn't completed yet")
}
if dur > v.maxVideoLength {
logUtils.SendErrorToSlack("%s is %s long and the limit is %s", v.id, dur.String(), v.maxVideoLength.String())
return nil, errors.Err("video is too long to process")
Expand All @@ -801,7 +802,6 @@ func (v *YoutubeVideo) downloadAndPublish(daemon *jsonrpc.Client, params SyncPar
break
}

//log.Debugln("Downloaded " + v.id)
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()

Expand Down

0 comments on commit 6944e17

Please sign in to comment.