Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-12-10 11:19:12 +00:00
parent f55142f3fd
commit d792a8407f
21 changed files with 957 additions and 912 deletions

View File

@@ -16,6 +16,14 @@ type YoutubeService struct {
client *client.Client
}
// Embed a YouTube video
func (t *YoutubeService) Embed(request *EmbedRequest) (*EmbedResponse, error) {
rsp := &EmbedResponse{}
return rsp, t.client.Call("youtube", "Embed", request, rsp)
}
// Search for videos on YouTube
func (t *YoutubeService) Search(request *SearchRequest) (*SearchResponse, error) {
@@ -24,6 +32,20 @@ func (t *YoutubeService) Search(request *SearchRequest) (*SearchResponse, error)
}
type EmbedRequest struct {
// provide the youtube url e.g https://www.youtube.com/watch?v=GWRWZu7XsJ0
Url string `json:"url"`
}
type EmbedResponse struct {
// the embeddable link e.g https://www.youtube.com/watch?v=GWRWZu7XsJ0
Link string `json:"link"`
// the script code
Script string `json:"script"`
// the short link
ShortUrl string `json:"short_url"`
}
type SearchRequest struct {
// Query to search for
Query string `json:"query"`