mirror of
https://github.com/pikami/tiktok-dl.git
synced 2024-11-28 18:55:42 +00:00
28 lines
550 B
Go
28 lines
550 B
Go
package workflows
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
client "../client"
|
|
log "../utils/log"
|
|
)
|
|
|
|
// CanUseDownloadShareLink - Check's if DownloadShareLink can be used
|
|
func CanUseDownloadShareLink(url string) bool {
|
|
match, _ := regexp.MatchString("vm.tiktok.com\\/.+", url)
|
|
return match
|
|
}
|
|
|
|
// DownloadShareLink - Download item by share link
|
|
func DownloadShareLink(url string) {
|
|
log.Logf("Resolving share link: %s\n", url)
|
|
|
|
finalURL, err := client.GetRedirectUrl(url)
|
|
if err != nil {
|
|
OnWorkflowFail(err, url)
|
|
return
|
|
}
|
|
|
|
StartWorkflowByParameter(finalURL)
|
|
}
|