Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
chgerber
youtubedl
Commits
589809d5
Commit
589809d5
authored
Sep 16, 2019
by
Christof Gerber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Priorize auto captions before manual subtitles
parent
c4ec3a01
Pipeline
#42302
failed with stages
in 6 minutes and 8 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
youtubedl.go
youtubedl.go
+4
-4
No files found.
youtubedl.go
View file @
589809d5
...
...
@@ -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
(
fals
e
,
videoID
,
language
)
// priorize
auto caption before trying to download manual youtube subtitle
subs
,
err
=
GetSubtitle
(
tru
e
,
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
(
tru
e
,
videoID
,
language
)
// download
manual subtitle if present
subs
,
err
=
GetSubtitle
(
fals
e
,
videoID
,
language
)
if
err
!=
nil
{
return
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment