add flag to remove unpublished videos
refactor code add workaround for SDK bug add code to remove unpublished videos fix alt downloader to only produce mp4 add missing height and width add tags sorting add a few channel wide tags
This commit is contained in:
parent
3389a8be93
commit
cfe8ff0879
9 changed files with 109 additions and 36 deletions
sdk
29
sdk/api.go
29
sdk/api.go
|
@ -11,6 +11,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/lbryio/lbry.go/extras/api"
|
||||
"github.com/lbryio/lbry.go/extras/errors"
|
||||
"github.com/lbryio/lbry.go/extras/null"
|
||||
|
||||
|
@ -167,6 +168,34 @@ const (
|
|||
VideoStatusFailed = "failed"
|
||||
)
|
||||
|
||||
func (a *APIConfig) DeleteVideos(videos []string) error {
|
||||
endpoint := a.ApiURL + "/yt/video_status"
|
||||
videoIDs := strings.Join(videos, ",")
|
||||
vals := url.Values{
|
||||
"video_id": {videoIDs},
|
||||
"auth_token": {a.ApiToken},
|
||||
}
|
||||
res, _ := http.PostForm(endpoint, vals)
|
||||
defer res.Body.Close()
|
||||
body, _ := ioutil.ReadAll(res.Body)
|
||||
response := api.Response{}
|
||||
err := json.Unmarshal(body, response)
|
||||
if err != nil {
|
||||
return errors.Err(err)
|
||||
}
|
||||
if response.Error != nil {
|
||||
return errors.Err(response.Error)
|
||||
}
|
||||
str, ok := response.Data.(string)
|
||||
if !ok {
|
||||
return errors.Err("%x", response.Data)
|
||||
}
|
||||
if str != "ok" {
|
||||
return errors.Err(str)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *APIConfig) MarkVideoStatus(channelID string, videoID string, status string, claimID string, claimName string, failureReason string, size *int64, metadataVersion uint) error {
|
||||
endpoint := a.ApiURL + "/yt/video_status"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue