mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
61 lines
1.3 KiB
Protocol Buffer
61 lines
1.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package youtube;
|
|
|
|
option go_package = "./proto;youtube";
|
|
|
|
service Youtube {
|
|
rpc Search(SearchRequest) returns (SearchResponse) {}
|
|
rpc Embed(EmbedRequest) returns (EmbedResponse) {}
|
|
}
|
|
|
|
// Embed a YouTube video
|
|
message EmbedRequest {
|
|
// provide the youtube url e.g https://www.youtube.com/watch?v=GWRWZu7XsJ0
|
|
string url = 1;
|
|
}
|
|
|
|
message EmbedResponse {
|
|
// the full url
|
|
string long_url = 1;
|
|
// the short url
|
|
string short_url = 2;
|
|
// the embeddable link e.g https://www.youtube.com/watch?v=GWRWZu7XsJ0
|
|
string embed_url = 3;
|
|
// the script code
|
|
string html_script = 4;
|
|
}
|
|
|
|
message SearchResult {
|
|
// id of the result
|
|
string id = 1;
|
|
// kind of result; "video", "channel", "playlist"
|
|
string kind = 2;
|
|
// title of the result
|
|
string title = 3;
|
|
// the result description
|
|
string description = 4;
|
|
// the channel id
|
|
string channel_id = 5;
|
|
// the channel title
|
|
string channel_title = 6;
|
|
// published at time
|
|
string published_at = 7;
|
|
// if live broadcast then indicates activity.
|
|
// none, upcoming, live, completed
|
|
string broadcasting = 8;
|
|
// the associated url
|
|
string url = 9;
|
|
}
|
|
|
|
// Search for videos on YouTube
|
|
message SearchRequest {
|
|
// Query to search for
|
|
string query = 1;
|
|
}
|
|
|
|
message SearchResponse {
|
|
// List of results for the query
|
|
repeated SearchResult results = 1;
|
|
}
|