mirror of
https://github.com/danielmiessler/fabric.git
synced 2026-09-10 07:36:44 -04:00
style(youtube): remove unnecessary blank lines in GrabVisual function
This commit is contained in:
parent
f812188115
commit
631d02cc27
|
|
@ -939,7 +939,7 @@ func (o *YouTube) GrabVisual(videoId string, language string, additionalArgs str
|
|||
go func(idx int, f string) {
|
||||
defer wg.Done()
|
||||
defer func() { <-sem }()
|
||||
|
||||
|
||||
cmdOcr := exec.CommandContext(ctx, "tesseract", f, "-", "stdout")
|
||||
var stdoutBuf, stderrBuf bytes.Buffer
|
||||
cmdOcr.Stdout = &stdoutBuf
|
||||
|
|
@ -951,7 +951,7 @@ func (o *YouTube) GrabVisual(videoId string, language string, additionalArgs str
|
|||
errMut.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
text := strings.TrimSpace(stdoutBuf.String())
|
||||
if text != "" && len(text) > 10 {
|
||||
results[idx] = text
|
||||
|
|
@ -977,7 +977,7 @@ func (o *YouTube) GrabVisual(videoId string, language string, additionalArgs str
|
|||
sb.WriteString("\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ret := sb.String()
|
||||
if ret == "" {
|
||||
return "", errors.New("no clear text found in video visual frames")
|
||||
|
|
|
|||
Loading…
Reference in a new issue