mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user