peertube_python_api/docs/VideoChaptersApi.md
2024-01-14 12:30:33 +02:00

157 lines
5.1 KiB
Markdown

# peertube.VideoChaptersApi
All URIs are relative to *https://peertube2.cpy.re*
Method | HTTP request | Description
------------- | ------------- | -------------
[**get_video_chapters**](VideoChaptersApi.md#get_video_chapters) | **GET** /api/v1/videos/{id}/chapters | Get chapters of a video
[**replace_video_chapters**](VideoChaptersApi.md#replace_video_chapters) | **PUT** /api/v1/videos/{id}/chapters | Replace video chapters
# **get_video_chapters**
> VideoChapters get_video_chapters(id, x_peertube_video_password=x_peertube_video_password)
Get chapters of a video
**PeerTube** >= 6.0
### Example
```python
import peertube
from peertube.models.video_chapters import VideoChapters
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"
)
# 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.VideoChaptersApi(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 chapters of a video
api_response = api_instance.get_video_chapters(id, x_peertube_video_password=x_peertube_video_password)
print("The response of VideoChaptersApi->get_video_chapters:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VideoChaptersApi->get_video_chapters: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**ApiV1VideosOwnershipIdAcceptPostIdParameter**](.md)| The object id, uuid or short uuid |
**x_peertube_video_password** | **str**| Required on password protected video | [optional]
### Return type
[**VideoChapters**](VideoChapters.md)
### Authorization
No authorization required
### 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]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **replace_video_chapters**
> replace_video_chapters(id, replace_video_chapters_request=replace_video_chapters_request)
Replace video chapters
**PeerTube** >= 6.0
### Example
* OAuth Authentication (OAuth2):
```python
import peertube
from peertube.models.replace_video_chapters_request import ReplaceVideoChaptersRequest
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.VideoChaptersApi(api_client)
id = peertube.ApiV1VideosOwnershipIdAcceptPostIdParameter() # ApiV1VideosOwnershipIdAcceptPostIdParameter | The object id, uuid or short uuid
replace_video_chapters_request = peertube.ReplaceVideoChaptersRequest() # ReplaceVideoChaptersRequest | (optional)
try:
# Replace video chapters
api_instance.replace_video_chapters(id, replace_video_chapters_request=replace_video_chapters_request)
except Exception as e:
print("Exception when calling VideoChaptersApi->replace_video_chapters: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | [**ApiV1VideosOwnershipIdAcceptPostIdParameter**](.md)| The object id, uuid or short uuid |
**replace_video_chapters_request** | [**ReplaceVideoChaptersRequest**](ReplaceVideoChaptersRequest.md)| | [optional]
### Return type
void (empty response body)
### Authorization
[OAuth2](../README.md#OAuth2)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | successful operation | - |
**404** | video not found | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)