2020-01-19 04:11:53 +02:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
models "../models"
|
2020-02-25 00:56:19 +02:00
|
|
|
config "../models/config"
|
2020-02-25 01:01:10 +02:00
|
|
|
"fmt"
|
2020-01-19 04:11:53 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// GetUserUploads - Get all uploads by user
|
2020-02-25 20:12:01 +02:00
|
|
|
func GetUserUploads(username string) ([]models.Upload, error) {
|
2020-02-25 21:01:43 +02:00
|
|
|
jsMethod := fmt.Sprintf("bootstrapIteratingVideos(%d)", config.Config.Limit)
|
|
|
|
actionOutput, err := executeClientAction(`https://www.tiktok.com/@`+username, jsMethod)
|
2020-02-25 20:12:01 +02:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return models.ParseUploads(actionOutput), nil
|
2020-01-19 04:11:53 +02:00
|
|
|
}
|
2020-02-25 00:56:19 +02:00
|
|
|
|
|
|
|
func GetUserUploadsJson(username string) string {
|
2020-02-25 01:01:10 +02:00
|
|
|
jsMethod := fmt.Sprintf("bootstrapIteratingVideos(%d)", config.Config.Limit)
|
2020-02-25 00:56:19 +02:00
|
|
|
return executeClientAction(`https://www.tiktok.com/@`+username, jsMethod)
|
2020-02-25 01:01:10 +02:00
|
|
|
}
|