feat: improve Youttube support. Print transcript and/or comments. Don't send them to AI if pattern is not defined.
This commit is contained in:
parent
9b3943e1a3
commit
25377ebd48
11
cli/cli.go
11
cli/cli.go
@ -113,12 +113,14 @@ func Cli() (message string, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if currentFlags.YouTubeTranscript {
|
if !currentFlags.YouTubeComments || currentFlags.YouTubeTranscript {
|
||||||
var transcript string
|
var transcript string
|
||||||
if transcript, err = fabric.YouTube.GrabTranscript(videoId); err != nil {
|
if transcript, err = fabric.YouTube.GrabTranscript(videoId); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println(transcript)
|
||||||
|
|
||||||
if currentFlags.Message != "" {
|
if currentFlags.Message != "" {
|
||||||
currentFlags.Message = currentFlags.Message + "\n" + transcript
|
currentFlags.Message = currentFlags.Message + "\n" + transcript
|
||||||
} else {
|
} else {
|
||||||
@ -134,12 +136,19 @@ func Cli() (message string, err error) {
|
|||||||
|
|
||||||
commentsString := strings.Join(comments, "\n")
|
commentsString := strings.Join(comments, "\n")
|
||||||
|
|
||||||
|
fmt.Println(commentsString)
|
||||||
|
|
||||||
if currentFlags.Message != "" {
|
if currentFlags.Message != "" {
|
||||||
currentFlags.Message = currentFlags.Message + "\n" + commentsString
|
currentFlags.Message = currentFlags.Message + "\n" + commentsString
|
||||||
} else {
|
} else {
|
||||||
currentFlags.Message = commentsString
|
currentFlags.Message = commentsString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if currentFlags.Pattern == "" {
|
||||||
|
// if the pattern flag is not set, we wanted only to grab the transcript or comments
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var chatter *core.Chatter
|
var chatter *core.Chatter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user