2020-01-19 02:11:53 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
models "./models"
|
2020-01-21 21:46:30 +00:00
|
|
|
workflows "./workflows"
|
2020-01-19 02:11:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
models.GetConfig()
|
2020-01-19 15:54:16 +00:00
|
|
|
url := models.Config.URL
|
2020-01-19 02:11:53 +00:00
|
|
|
|
2020-01-19 15:54:16 +00:00
|
|
|
// Single video
|
2020-01-21 21:46:30 +00:00
|
|
|
if workflows.CanUseDownloadSingleVideo(url) {
|
|
|
|
workflows.DownloadSingleVideo(url)
|
2020-01-19 15:54:16 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tiktok user
|
2020-01-21 21:46:30 +00:00
|
|
|
if workflows.CanUseDownloadUser(url) {
|
|
|
|
workflows.DownloadUser(models.GetUsername())
|
2020-01-19 15:54:16 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2020-01-21 21:46:30 +00:00
|
|
|
panic("Could not recognise URL format")
|
2020-01-19 02:11:53 +00:00
|
|
|
}
|