mirror of
https://github.com/pikami/tiktok-dl.git
synced 2026-01-29 22:52:56 +00:00
Download videos by hashtag; get json data without video downloading; limit option
This commit is contained in:
16
utils/getHashtag.go
Normal file
16
utils/getHashtag.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user