17 KiB
peertube.LiveVideosApi
All URIs are relative to https://peertube2.cpy.re
| Method | HTTP request | Description |
|---|---|---|
| add_live | POST /api/v1/videos/live | Create a live |
| api_v1_videos_id_live_session_get | GET /api/v1/videos/{id}/live-session | Get live session of a replay |
| api_v1_videos_live_id_sessions_get | GET /api/v1/videos/live/{id}/sessions | List live sessions |
| get_live_id | GET /api/v1/videos/live/{id} | Get information about a live |
| update_live_id | PUT /api/v1/videos/live/{id} | Update information about a live |
add_live
VideoUploadResponse add_live(channel_id, name, save_replay=save_replay, replay_settings=replay_settings, permanent_live=permanent_live, latency_mode=latency_mode, thumbnailfile=thumbnailfile, previewfile=previewfile, privacy=privacy, category=category, licence=licence, language=language, description=description, support=support, nsfw=nsfw, tags=tags, comments_enabled=comments_enabled, download_enabled=download_enabled)
Create a live
Example
- OAuth Authentication (OAuth2):
import peertube
from peertube.models.live_video_latency_mode import LiveVideoLatencyMode
from peertube.models.live_video_replay_settings import LiveVideoReplaySettings
from peertube.models.video_privacy_set import VideoPrivacySet
from peertube.models.video_upload_response import VideoUploadResponse
from peertube.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://peertube2.cpy.re
# See configuration.py for a list of all supported configuration parameters.
configuration = peertube.Configuration(
host = "https://peertube2.cpy.re"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with peertube.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = peertube.LiveVideosApi(api_client)
channel_id = 56 # int | Channel id that will contain this live video
name = 'name_example' # str | Live video/replay name
save_replay = True # bool | (optional)
replay_settings = peertube.LiveVideoReplaySettings() # LiveVideoReplaySettings | (optional)
permanent_live = True # bool | User can stream multiple times in a permanent live (optional)
latency_mode = peertube.LiveVideoLatencyMode() # LiveVideoLatencyMode | (optional)
thumbnailfile = None # bytearray | Live video/replay thumbnail file (optional)
previewfile = None # bytearray | Live video/replay preview file (optional)
privacy = peertube.VideoPrivacySet() # VideoPrivacySet | (optional)
category = 56 # int | category id of the video (see [/videos/categories](#operation/getCategories)) (optional)
licence = 56 # int | licence id of the video (see [/videos/licences](#operation/getLicences)) (optional)
language = 'language_example' # str | language id of the video (see [/videos/languages](#operation/getLanguages)) (optional)
description = 'description_example' # str | Live video/replay description (optional)
support = 'support_example' # str | A text tell the audience how to support the creator (optional)
nsfw = True # bool | Whether or not this live video/replay contains sensitive content (optional)
tags = ['tags_example'] # List[str] | Live video/replay tags (maximum 5 tags each between 2 and 30 characters) (optional)
comments_enabled = True # bool | Enable or disable comments for this live video/replay (optional)
download_enabled = True # bool | Enable or disable downloading for the replay of this live video (optional)
try:
# Create a live
api_response = api_instance.add_live(channel_id, name, save_replay=save_replay, replay_settings=replay_settings, permanent_live=permanent_live, latency_mode=latency_mode, thumbnailfile=thumbnailfile, previewfile=previewfile, privacy=privacy, category=category, licence=licence, language=language, description=description, support=support, nsfw=nsfw, tags=tags, comments_enabled=comments_enabled, download_enabled=download_enabled)
print("The response of LiveVideosApi->add_live:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LiveVideosApi->add_live: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| channel_id | int | Channel id that will contain this live video | |
| name | str | Live video/replay name | |
| save_replay | bool | [optional] | |
| replay_settings | LiveVideoReplaySettings | [optional] | |
| permanent_live | bool | User can stream multiple times in a permanent live | [optional] |
| latency_mode | LiveVideoLatencyMode | [optional] | |
| thumbnailfile | bytearray | Live video/replay thumbnail file | [optional] |
| previewfile | bytearray | Live video/replay preview file | [optional] |
| privacy | VideoPrivacySet | [optional] | |
| category | int | category id of the video (see /videos/categories) | [optional] |
| licence | int | licence id of the video (see /videos/licences) | [optional] |
| language | str | language id of the video (see /videos/languages) | [optional] |
| description | str | Live video/replay description | [optional] |
| support | str | A text tell the audience how to support the creator | [optional] |
| nsfw | bool | Whether or not this live video/replay contains sensitive content | [optional] |
| tags | List[str] | Live video/replay tags (maximum 5 tags each between 2 and 30 characters) | [optional] |
| comments_enabled | bool | Enable or disable comments for this live video/replay | [optional] |
| download_enabled | bool | Enable or disable downloading for the replay of this live video | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | successful operation | - |
| 400 | Disambiguate via `type`: - default type for a validation error - `live_conflicting_permanent_and_save_replay` for conflicting parameters set | - |
| 403 | Disambiguate via `type`: - `live_not_enabled` for a disabled live feature - `live_not_allowing_replay` for a disabled replay feature - `max_instance_lives_limit_reached` for the absolute concurrent live limit - `max_user_lives_limit_reached` for the user concurrent live limit | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
api_v1_videos_id_live_session_get
LiveVideoSessionResponse api_v1_videos_id_live_session_get(id, x_peertube_video_password=x_peertube_video_password)
Get live session of a replay
If the video is a replay of a live, you can find the associated live session using this endpoint
Example
- OAuth Authentication (OAuth2):
import peertube
from peertube.models.live_video_session_response import LiveVideoSessionResponse
from peertube.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://peertube2.cpy.re
# See configuration.py for a list of all supported configuration parameters.
configuration = peertube.Configuration(
host = "https://peertube2.cpy.re"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with peertube.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = peertube.LiveVideosApi(api_client)
id = peertube.ApiV1VideosOwnershipIdAcceptPostIdParameter() # ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid
x_peertube_video_password = 'x_peertube_video_password_example' # str | Required on password protected video (optional)
try:
# Get live session of a replay
api_response = api_instance.api_v1_videos_id_live_session_get(id, x_peertube_video_password=x_peertube_video_password)
print("The response of LiveVideosApi->api_v1_videos_id_live_session_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LiveVideosApi->api_v1_videos_id_live_session_get: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid | |
| x_peertube_video_password | str | Required on password protected video | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | successful operation | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
api_v1_videos_live_id_sessions_get
ApiV1VideosLiveIdSessionsGet200Response api_v1_videos_live_id_sessions_get(id)
List live sessions
List all sessions created in a particular live
Example
- OAuth Authentication (OAuth2):
import peertube
from peertube.models.api_v1_videos_live_id_sessions_get200_response import ApiV1VideosLiveIdSessionsGet200Response
from peertube.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://peertube2.cpy.re
# See configuration.py for a list of all supported configuration parameters.
configuration = peertube.Configuration(
host = "https://peertube2.cpy.re"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with peertube.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = peertube.LiveVideosApi(api_client)
id = peertube.ApiV1VideosOwnershipIdAcceptPostIdParameter() # ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid
try:
# List live sessions
api_response = api_instance.api_v1_videos_live_id_sessions_get(id)
print("The response of LiveVideosApi->api_v1_videos_live_id_sessions_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LiveVideosApi->api_v1_videos_live_id_sessions_get: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid |
Return type
ApiV1VideosLiveIdSessionsGet200Response
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | successful operation | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_live_id
LiveVideoResponse get_live_id(id)
Get information about a live
Example
- OAuth Authentication (OAuth2):
import peertube
from peertube.models.live_video_response import LiveVideoResponse
from peertube.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://peertube2.cpy.re
# See configuration.py for a list of all supported configuration parameters.
configuration = peertube.Configuration(
host = "https://peertube2.cpy.re"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with peertube.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = peertube.LiveVideosApi(api_client)
id = peertube.ApiV1VideosOwnershipIdAcceptPostIdParameter() # ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid
try:
# Get information about a live
api_response = api_instance.get_live_id(id)
print("The response of LiveVideosApi->get_live_id:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LiveVideosApi->get_live_id: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | successful operation | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_live_id
update_live_id(id, live_video_update=live_video_update)
Update information about a live
Example
- OAuth Authentication (OAuth2):
import peertube
from peertube.models.live_video_update import LiveVideoUpdate
from peertube.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://peertube2.cpy.re
# See configuration.py for a list of all supported configuration parameters.
configuration = peertube.Configuration(
host = "https://peertube2.cpy.re"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with peertube.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = peertube.LiveVideosApi(api_client)
id = peertube.ApiV1VideosOwnershipIdAcceptPostIdParameter() # ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid
live_video_update = peertube.LiveVideoUpdate() # LiveVideoUpdate | (optional)
try:
# Update information about a live
api_instance.update_live_id(id, live_video_update=live_video_update)
except Exception as e:
print("Exception when calling LiveVideosApi->update_live_id: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid | |
| live_video_update | LiveVideoUpdate | [optional] |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | successful operation | - |
| 400 | bad parameters or trying to update a live that has already started | - |
| 403 | trying to save replay of the live but saving replay is not enabled on the instance | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]