tiktok-dl/workflows/startWorkflowByParameter.go

31 lines
526 B
Go
Raw Normal View History

package workflows
import (
models "../models"
"fmt"
)
// StartWorkflowByParameter - Start needed workflow by given parameter
func StartWorkflowByParameter(url string) {
// Music
if CanUseDownloadMusic(url) {
DownloadMusic(url)
return
}
// Single video
if CanUseDownloadSingleVideo(url) {
DownloadSingleVideo(url)
return
}
// Tiktok user
if CanUseDownloadUser(url) {
2020-01-27 18:46:10 +00:00
DownloadUser(models.GetUsernameFromString(url))
return
}
panic(fmt.Sprintf("Could not recognise URL format of string %s", url))
}