openapi: 3.0.0
info:
title: PeerTube
- version: 1.4.1
+ version: 2.1.0-rc.1
contact:
name: PeerTube Community
url: 'https://joinpeertube.org'
description: >
Operations dealing with comments to a video. Comments are organized in
threads.
+ - name: Video Playlist
+ description: >
+ Operations dealing with playlists of videos. Playlists are bound to users
+ and/or channels.
- name: Video Channel
description: >
Operations dealing with creation, modification and video listing of a
http -b GET https://peertube2.cpy.re/api/v1/accounts/{name}/videos
- lang: Ruby
source: |
- require 'uri'
require 'net/http'
+ require 'json'
- url = URI("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
+ uri = URI.parse("https://peertube2.cpy.re/api/v1/accounts/{name}/videos")
- http = Net::HTTP.new(url.host, url.port)
+ http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- request = Net::HTTP::Post.new(url)
- request["content-type"] = 'application/json'
- response = http.request(request)
- puts response.read_body
+ response = http.get(uri.request_uri)
+
+ puts JSON.parse(response.read_body)
- lang: Python
source: |
- import http.client
-
- conn = http.client.HTTPSConnection("https://peertube2.cpy.re/api/v1")
-
- headers = {
- 'content-type': "application/json"
- }
-
- conn.request("POST", "/accounts/{name}/videos", None, headers)
+ import requests
- res = conn.getresponse()
- data = res.read()
+ r = requests.get("https://peertube2.cpy.re/api/v1//accounts/{name}/videos")
+ json = r.json()
- print(data.decode("utf-8"))
+ print(json)
/accounts:
get:
tags:
format: binary
encoding:
captionfile:
- contentType: text/vtt, application/x-subrip
+ contentType: text/vtt, application/x-subrip, text/plain
responses:
'204':
$ref: '#/paths/~1users~1me/put/responses/204'
application/json:
schema:
$ref: '#/components/schemas/VideoListResponse'
+ /video-playlists:
+ get:
+ summary: Get list of video playlists
+ tags:
+ - Video Playlist
+ parameters:
+ - $ref: '#/components/parameters/start'
+ - $ref: '#/components/parameters/count'
+ - $ref: '#/components/parameters/sort'
+ responses:
+ '200':
+ description: successful operation
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/VideoPlaylist'
'/accounts/{name}/video-channels':
get:
summary: Get video channels of an account by its name
- $ref: '#/components/parameters/idOrUUID'
- $ref: '#/components/parameters/start'
- $ref: '#/components/parameters/count'
- - $ref: '#/components/parameters/sort'
+ - $ref: '#/components/parameters/commentsSort'
responses:
'200':
description: successful operation
- -views
- -likes
- -match
+ commentsSort:
+ name: sort
+ in: query
+ required: false
+ description: Sort comments by criteria
+ schema:
+ type: string
+ enum:
+ - -createdAt
+ - -totalReplies
blacklistsSort:
name: sort
in: query
type: number
uuid:
type: string
+ VideoPlaylist:
+ properties:
+ id:
+ type: number
+ createdAt:
+ type: string
+ updatedAt:
+ type: string
+ description:
+ type: string
+ uuid:
+ type: string
+ displayName:
+ type: string
+ isLocal:
+ type: boolean
+ videoLength:
+ type: number
+ thumbnailPath:
+ type: string
+ privacy:
+ type: object
+ properties:
+ id:
+ type: number
+ label:
+ type: string
+ type:
+ type: object
+ properties:
+ id:
+ type: number
+ label:
+ type: string
+ ownerAccount:
+ type: object
+ properties:
+ id:
+ type: number
+ name:
+ type: string
+ displayName:
+ type: string
+ url:
+ type: string
+ host:
+ type: string
VideoComment:
properties:
id:
type: string
updatedAt:
type: string
+ totalRepliesFromVideoAuthor:
+ type: number
totalReplies:
type: number
account: