mirror of
https://github.com/pikami/tiktok-dl.git
synced 2024-11-29 03:05:42 +00:00
17 lines
342 B
Go
17 lines
342 B
Go
package utils
|
|
|
|
import (
|
|
res "../resources"
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
// GetHashtagFromURL - Get's tag name from passed url
|
|
func GetHashtagFromURL(str string) string {
|
|
if match := strings.Contains(str, "/tag/"); match {
|
|
return strings.Split(str, "/tag/")[1]
|
|
}
|
|
|
|
panic(fmt.Sprintf(res.ErrorCouldNotRecogniseURL, str))
|
|
}
|