8.5 KiB
8.5 KiB
peertube.VideoPasswordsApi
All URIs are relative to https://peertube2.cpy.re
| Method | HTTP request | Description |
|---|---|---|
| api_v1_videos_id_passwords_get | GET /api/v1/videos/{id}/passwords | List video passwords |
| api_v1_videos_id_passwords_put | PUT /api/v1/videos/{id}/passwords | Update video passwords |
| api_v1_videos_id_passwords_video_password_id_delete | DELETE /api/v1/videos/{id}/passwords/{videoPasswordId} | Delete a video password |
api_v1_videos_id_passwords_get
VideoPasswordList api_v1_videos_id_passwords_get(id, start=start, count=count, sort=sort)
List video passwords
PeerTube >= 6.0
Example
- OAuth Authentication (OAuth2):
import peertube
from peertube.models.video_password_list import VideoPasswordList
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.VideoPasswordsApi(api_client)
id = peertube.ApiV1VideosOwnershipIdAcceptPostIdParameter() # ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid
start = 56 # int | Offset used to paginate results (optional)
count = 15 # int | Number of items to return (optional) (default to 15)
sort = '-createdAt' # str | Sort column (optional)
try:
# List video passwords
api_response = api_instance.api_v1_videos_id_passwords_get(id, start=start, count=count, sort=sort)
print("The response of VideoPasswordsApi->api_v1_videos_id_passwords_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VideoPasswordsApi->api_v1_videos_id_passwords_get: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid | |
| start | int | Offset used to paginate results | [optional] |
| count | int | Number of items to return | [optional] [default to 15] |
| sort | str | Sort column | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | successful operation | - |
| 400 | video is not password protected | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
api_v1_videos_id_passwords_put
api_v1_videos_id_passwords_put(id, api_v1_videos_id_passwords_put_request=api_v1_videos_id_passwords_put_request)
Update video passwords
PeerTube >= 6.0
Example
- OAuth Authentication (OAuth2):
import peertube
from peertube.models.api_v1_videos_id_passwords_put_request import ApiV1VideosIdPasswordsPutRequest
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.VideoPasswordsApi(api_client)
id = peertube.ApiV1VideosOwnershipIdAcceptPostIdParameter() # ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid
api_v1_videos_id_passwords_put_request = peertube.ApiV1VideosIdPasswordsPutRequest() # ApiV1VideosIdPasswordsPutRequest | (optional)
try:
# Update video passwords
api_instance.api_v1_videos_id_passwords_put(id, api_v1_videos_id_passwords_put_request=api_v1_videos_id_passwords_put_request)
except Exception as e:
print("Exception when calling VideoPasswordsApi->api_v1_videos_id_passwords_put: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid | |
| api_v1_videos_id_passwords_put_request | ApiV1VideosIdPasswordsPutRequest | [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 | video is not password protected | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
api_v1_videos_id_passwords_video_password_id_delete
api_v1_videos_id_passwords_video_password_id_delete(id, video_password_id)
Delete a video password
PeerTube >= 6.0
Example
- OAuth Authentication (OAuth2):
import peertube
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.VideoPasswordsApi(api_client)
id = peertube.ApiV1VideosOwnershipIdAcceptPostIdParameter() # ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid
video_password_id = 56 # int | The video password id
try:
# Delete a video password
api_instance.api_v1_videos_id_passwords_video_password_id_delete(id, video_password_id)
except Exception as e:
print("Exception when calling VideoPasswordsApi->api_v1_videos_id_passwords_video_password_id_delete: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid | |
| video_password_id | int | The video password id |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | successful operation | - |
| 400 | video is not password protected | - |
| 403 | cannot delete the last password of the protected video | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]