diff --git a/pubapi/streams.go b/pubapi/streams.go new file mode 100644 index 0000000..56044e6 --- /dev/null +++ b/pubapi/streams.go @@ -0,0 +1,61 @@ +// Response schemas for API endpoint /streams/:videoId + +package pubapi + +type Streams struct { + VideoFields + AudioStreams []Stream `json:"audioStreams"` + VideoStreams []Stream `json:"videoStreams"` + Dash string `json:"dash"` + Hls string `json:"hls"` + LbryId string `json:"lbryId"` + Likes uint64 `json:"likes"` + Dislikes uint32 `json:"dislikes"` + Related []Related `json:"relatedStreams"` + Thumbnail string `json:"thumbnailUrl"` + DateTime string `json:"uploadDate"` + Channel string `json:"uploader"` + ChannelSubs uint64 `json:"uploaderSubscriberCount"` + Desc string `json:"description"` + Tags []string `json:"tags"` + Category string `json:"category"` + License string `json:"license"` + Visibility string `json:"visibility"` + Live bool `json:"livestream"` + // TODO: subtitles chapters previewFrames metaInfo(?) proxyUrl(useless?) +} + +type Related struct { + VideoFields + ShortDesc string `json:"shortDescription"` + Thumbnail string `json:"thumbnail"` + Channel string `json:"uploaderName"` + ApproxDate string `json:"uploadedDate"` + Timestamp uint64 `json:"uploaded"` // can be -1 + Shorts bool `json:"isShort"` + Url string `json:"url"` + // TODO: is always type == "stream"? do we need it? +} + +type VideoFields struct { + Title string `json:"title"` + ChannelUrl string `json:"uploaderUrl"` + Avatar string `json:"uploaderAvatar"` + Verified bool `json:"uploaderVerified"` + Views uint64 `json:"views"` + Duration uint16 `json:"duration"` // can be -1 +} + +type Stream struct { + Bitrate uint16 `json:"bitrate"` + Codec string `json:"codec"` + Format string `json:"format"` + Fps uint8 `json:"fps"` + Mime string `json:"mimeType"` + Quality string `json:"quality"` + Width uint16 `json:"width"` + Height uint16 `json:"height"` + Url string `json:"url"` + VideoOnly bool `json:"videoOnly"` + // TODO: indexStart,End initStart,End +}