subtitle_controller = client.subtitle
SubtitleController
- Delete Subtitle
- Download Remote Subtitles
- Get Fallback Font
- Get Fallback Font List
- Get Remote Subtitles
- Get Subtitle
- Get Subtitle Playlist
- Get Subtitle With Ticks
- Search Remote Subtitles
- Upload Subtitle
Deletes an external subtitle file.
def delete_subtitle(self,
item_id,
index)
Parameter | Type | Tags | Description |
---|---|---|---|
item_id |
uuid|string |
Template, Required | The item id. |
index |
int |
Template, Required | The index of the subtitle file. |
void
item_id = '0000130e-0000-0000-0000-000000000000'
index = 44
result = subtitle_controller.delete_subtitle(item_id, index)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
404 | Item not found. | ProblemDetailsException |
Downloads a remote subtitle.
def download_remote_subtitles(self,
item_id,
subtitle_id)
Parameter | Type | Tags | Description |
---|---|---|---|
item_id |
uuid|string |
Template, Required | The item id. |
subtitle_id |
string |
Template, Required | The subtitle id. |
void
item_id = '0000130e-0000-0000-0000-000000000000'
subtitle_id = 'subtitleId4'
result = subtitle_controller.download_remote_subtitles(item_id, subtitle_id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Gets a fallback font file.
def get_fallback_font(self,
name)
Parameter | Type | Tags | Description |
---|---|---|---|
name |
string |
Template, Required | The name of the fallback font file to get. |
mixed
name = 'name0'
result = subtitle_controller.get_fallback_font(name)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Gets a list of available fallback font files.
def get_fallback_font_list(self)
result = subtitle_controller.get_fallback_font_list()
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Gets the remote subtitles.
def get_remote_subtitles(self,
id)
Parameter | Type | Tags | Description |
---|---|---|---|
id |
string |
Template, Required | The item id. |
binary
id = 'id0'
result = subtitle_controller.get_remote_subtitles(id)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Gets subtitles in a specified format.
def get_subtitle(self,
route_item_id,
route_media_source_id,
route_index,
route_format,
item_id=None,
media_source_id=None,
index=None,
format=None,
end_position_ticks=None,
copy_timestamps=False,
add_vtt_time_map=False,
start_position_ticks=0)
Parameter | Type | Tags | Description |
---|---|---|---|
route_item_id |
uuid|string |
Template, Required | The (route) item id. |
route_media_source_id |
string |
Template, Required | The (route) media source id. |
route_index |
int |
Template, Required | The (route) subtitle stream index. |
route_format |
string |
Template, Required | The (route) format of the returned subtitle. |
item_id |
uuid|string |
Query, Optional | The item id. |
media_source_id |
string |
Query, Optional | The media source id. |
index |
int |
Query, Optional | The subtitle stream index. |
format |
string |
Query, Optional | The format of the returned subtitle. |
end_position_ticks |
long|int |
Query, Optional | Optional. The end position of the subtitle in ticks. |
copy_timestamps |
bool |
Query, Optional | Optional. Whether to copy the timestamps. Default: False |
add_vtt_time_map |
bool |
Query, Optional | Optional. Whether to add a VTT time map. Default: False |
start_position_ticks |
long|int |
Query, Optional | The start position of the subtitle in ticks. Default: 0 |
binary
route_item_id = '000014a8-0000-0000-0000-000000000000'
route_media_source_id = 'routeMediaSourceId6'
route_index = 32
route_format = 'routeFormat0'
copy_timestamps = False
add_vtt_time_map = False
start_position_ticks = 0
result = subtitle_controller.get_subtitle(route_item_id, route_media_source_id, route_index, route_format, None, None, None, None, None, copy_timestamps, add_vtt_time_map, start_position_ticks)
Gets an HLS subtitle playlist.
def get_subtitle_playlist(self,
item_id,
index,
media_source_id,
segment_length)
Parameter | Type | Tags | Description |
---|---|---|---|
item_id |
uuid|string |
Template, Required | The item id. |
index |
int |
Template, Required | The subtitle stream index. |
media_source_id |
string |
Template, Required | The media source id. |
segment_length |
int |
Query, Required | The subtitle segment length. |
mixed
item_id = '0000130e-0000-0000-0000-000000000000'
index = 44
media_source_id = 'mediaSourceId4'
segment_length = 204
result = subtitle_controller.get_subtitle_playlist(item_id, index, media_source_id, segment_length)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Gets subtitles in a specified format.
def get_subtitle_with_ticks(self,
route_item_id,
route_media_source_id,
route_index,
route_start_position_ticks,
route_format,
item_id=None,
media_source_id=None,
index=None,
start_position_ticks=None,
format=None,
end_position_ticks=None,
copy_timestamps=False,
add_vtt_time_map=False)
Parameter | Type | Tags | Description |
---|---|---|---|
route_item_id |
uuid|string |
Template, Required | The (route) item id. |
route_media_source_id |
string |
Template, Required | The (route) media source id. |
route_index |
int |
Template, Required | The (route) subtitle stream index. |
route_start_position_ticks |
long|int |
Template, Required | The (route) start position of the subtitle in ticks. |
route_format |
string |
Template, Required | The (route) format of the returned subtitle. |
item_id |
uuid|string |
Query, Optional | The item id. |
media_source_id |
string |
Query, Optional | The media source id. |
index |
int |
Query, Optional | The subtitle stream index. |
start_position_ticks |
long|int |
Query, Optional | The start position of the subtitle in ticks. |
format |
string |
Query, Optional | The format of the returned subtitle. |
end_position_ticks |
long|int |
Query, Optional | Optional. The end position of the subtitle in ticks. |
copy_timestamps |
bool |
Query, Optional | Optional. Whether to copy the timestamps. Default: False |
add_vtt_time_map |
bool |
Query, Optional | Optional. Whether to add a VTT time map. Default: False |
binary
route_item_id = '000014a8-0000-0000-0000-000000000000'
route_media_source_id = 'routeMediaSourceId6'
route_index = 32
route_start_position_ticks = 84
route_format = 'routeFormat0'
copy_timestamps = False
add_vtt_time_map = False
result = subtitle_controller.get_subtitle_with_ticks(route_item_id, route_media_source_id, route_index, route_start_position_ticks, route_format, None, None, None, None, None, None, copy_timestamps, add_vtt_time_map)
Search remote subtitles.
def search_remote_subtitles(self,
item_id,
language,
is_perfect_match=None)
Parameter | Type | Tags | Description |
---|---|---|---|
item_id |
uuid|string |
Template, Required | The item id. |
language |
string |
Template, Required | The language of the subtitles. |
is_perfect_match |
bool |
Query, Optional | Optional. Only show subtitles which are a perfect match. |
item_id = '0000130e-0000-0000-0000-000000000000'
language = 'language2'
result = subtitle_controller.search_remote_subtitles(item_id, language)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |
Upload an external subtitle file.
def upload_subtitle(self,
item_id,
body)
Parameter | Type | Tags | Description |
---|---|---|---|
item_id |
uuid|string |
Template, Required | The item the subtitle belongs to. |
body |
UploadSubtitleDto |
Body, Required | The request body. |
void
item_id = '0000130e-0000-0000-0000-000000000000'
body = UploadSubtitleDto()
body.language = 'Language4'
body.format = 'Format6'
body.is_forced = False
body.data = 'Data0'
result = subtitle_controller.upload_subtitle(item_id, body)
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | Unauthorized | APIException |
403 | Forbidden | APIException |