Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f17110ab7f | ||
|
|
768743a200 |
No files matched your search
+1
-1
@@ -132,7 +132,6 @@ func (s *Sync) FullCycle() (e error) {
|
||||
log.Println("Got interrupt signal, shutting down (if publishing, will shut down after current publish)")
|
||||
s.grp.Stop()
|
||||
time.Sleep(5 * time.Second)
|
||||
debug.PrintStack() // so we can figure out what's not stopping
|
||||
}()
|
||||
err := s.setStatusSyncing()
|
||||
if err != nil {
|
||||
@@ -756,6 +755,7 @@ func (s *Sync) startWorker(workerNum int) {
|
||||
"Missing inputs",
|
||||
}
|
||||
errorsNoRetry := []string{
|
||||
"Requested format is not available",
|
||||
"non 200 status code received",
|
||||
"This video contains content from",
|
||||
"dont know which claim to update",
|
||||
|
||||
+14
-10
@@ -339,7 +339,7 @@ func (v *YoutubeVideo) download() error {
|
||||
return errors.Err(err)
|
||||
}
|
||||
ticker := time.NewTicker(400 * time.Millisecond)
|
||||
done := make(chan bool)
|
||||
done := make(chan bool, 1)
|
||||
v.progressBarWg.Add(1)
|
||||
go func() {
|
||||
defer v.progressBarWg.Done()
|
||||
@@ -374,14 +374,17 @@ func (v *YoutubeVideo) download() error {
|
||||
|
||||
videoSize := 0
|
||||
audioSize := 0
|
||||
for _, f := range metadata.Formats {
|
||||
if f.FormatID == videoFormat {
|
||||
videoSize = f.Filesize
|
||||
}
|
||||
if f.FormatID == audioFormat {
|
||||
audioSize = f.Filesize
|
||||
if metadata != nil {
|
||||
for _, f := range metadata.Formats {
|
||||
if f.FormatID == videoFormat {
|
||||
videoSize = f.Filesize
|
||||
}
|
||||
if f.FormatID == audioFormat {
|
||||
audioSize = f.Filesize
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.Debugf("(%s) - videoSize: %d (%s), audiosize: %d (%s)", v.id, videoSize, videoFormat, audioSize, audioFormat)
|
||||
bar := v.progressBars.AddBar(int64(videoSize+audioSize),
|
||||
mpb.PrependDecorators(
|
||||
@@ -402,12 +405,13 @@ func (v *YoutubeVideo) download() error {
|
||||
),
|
||||
mpb.BarRemoveOnComplete(),
|
||||
)
|
||||
|
||||
defer func() {
|
||||
bar.Completed()
|
||||
bar.Abort(true)
|
||||
}()
|
||||
for {
|
||||
select {
|
||||
case <-done:
|
||||
bar.Completed()
|
||||
bar.Abort(true)
|
||||
return
|
||||
case <-ticker.C:
|
||||
size, err := logUtils.DirSize(v.videoDir())
|
||||
|
||||
Reference in new issue
Block a user