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 ...@@ -397,14 +397,14 @@ func loadYouTubeAnnotationsVideo(videoID string, language string, collection *mo
var subs annotation.Caption var subs annotation.Caption
err := errors.New("") err := errors.New("")
// priorize manual subtitle before downloading automatic youtube caption (autogenerated) // priorize auto caption before trying to download manual youtube subtitle
subs, err = GetSubtitle(false, videoID, language) subs, err = GetSubtitle(true, videoID, language)
if err != nil { if err != nil {
_, ok := err.(ErrYoutubeDLLangNotSupported) _, ok := err.(ErrYoutubeDLLangNotSupported)
if ok { if ok {
log.WithFields(log.Fields{"videoID": videoID, "language": language}).Trace("No manual subtitle found") log.WithFields(log.Fields{"videoID": videoID, "language": language}).Trace("No manual subtitle found")
// download automatic caption // download manual subtitle if present
subs, err = GetSubtitle(true, videoID, language) subs, err = GetSubtitle(false, videoID, language)
if err != nil { if err != nil {
return err 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