Commit 589809d5 authored by Christof Gerber's avatar Christof Gerber

Priorize auto captions before manual subtitles

parent c4ec3a01
Pipeline #42302 failed with stages
in 6 minutes and 8 seconds
......@@ -397,14 +397,14 @@ func loadYouTubeAnnotationsVideo(videoID string, language string, collection *mo
var subs annotation.Caption
err := errors.New("")
// priorize manual subtitle before downloading automatic youtube caption (autogenerated)
subs, err = GetSubtitle(false, videoID, language)
// priorize auto caption before trying to download manual youtube subtitle
subs, err = GetSubtitle(true, videoID, language)
if err != nil {
_, ok := err.(ErrYoutubeDLLangNotSupported)
if ok {
log.WithFields(log.Fields{"videoID": videoID, "language": language}).Trace("No manual subtitle found")
// download automatic caption
subs, err = GetSubtitle(true, videoID, language)
// download manual subtitle if present
subs, err = GetSubtitle(false, videoID, language)
if err != nil {
return err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment