mirror of https://github.com/pikami/tiktok-dl.git
33 lines
578 B
Go
33 lines
578 B
Go
package main
|
|
|
|
import (
|
|
models "./models"
|
|
workflows "./workflows"
|
|
)
|
|
|
|
func main() {
|
|
models.GetConfig()
|
|
url := models.Config.URL
|
|
batchFilePath := models.Config.BatchFilePath
|
|
|
|
// Batch file
|
|
if workflows.CanUseDownloadBatchFile(batchFilePath) {
|
|
workflows.DownloadBatchFile(batchFilePath)
|
|
return
|
|
}
|
|
|
|
// Single video
|
|
if workflows.CanUseDownloadSingleVideo(url) {
|
|
workflows.DownloadSingleVideo(url)
|
|
return
|
|
}
|
|
|
|
// Tiktok user
|
|
if workflows.CanUseDownloadUser(url) {
|
|
workflows.DownloadUser(models.GetUsername())
|
|
return
|
|
}
|
|
|
|
panic("Could not recognise URL format")
|
|
}
|