mirror of
https://github.com/pikami/tiktok-dl.git
synced 2024-11-25 17:25:42 +00:00
28 lines
635 B
Go
28 lines
635 B
Go
package client
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
models "../models"
|
|
config "../models/config"
|
|
)
|
|
|
|
// GetMusicUploads - Get all uploads by given music
|
|
func GetMusicUploads(url string) ([]models.Upload, error) {
|
|
actionOutput, err := GetMusicUploadsJSON(url)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return models.ParseUploads(actionOutput), nil
|
|
}
|
|
|
|
// GetMusicUploadsJSON - Get music uploads scrape
|
|
func GetMusicUploadsJSON(url string) (string, error) {
|
|
jsMethod := fmt.Sprintf("bootstrapIteratingVideos(%d)", config.Config.Limit)
|
|
actionOutput, err := executeClientAction(url, jsMethod)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return actionOutput, nil
|
|
}
|