mirror of
https://github.com/pikami/tiktok-dl.git
synced 2024-11-25 17:25:42 +00:00
31 lines
526 B
Go
31 lines
526 B
Go
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) {
|
|
DownloadUser(models.GetUsernameFromString(url))
|
|
return
|
|
}
|
|
|
|
panic(fmt.Sprintf("Could not recognise URL format of string %s", url))
|
|
}
|