[[PageOutline(3-4, Sections)]]
== !DownloadSubtitles ==
=== Intro ===
download given subtitle files
----
=== Description ===
'''struct !DownloadSubtitles(string $token, array($IDSubtitleFile, $IDSubtitleFile,...) $data)'''
This function can be used to download multiple subtitle files at once.
----
=== Parameters ===
First parameter is the session ''token'', second is the array/list of subtitle file IDs using this structure:
{{{
array( <--- array of subtitle file IDs
(int), (int), ...
)
}}}
''token (required)''::
token string identifying user's session, taken from [XmlRpcLogIn LogIn] output structure.
''data (required)''::
array of subtitle file IDs
----
=== Return Values ===
Output is returned in this structure:
{{{
struct(
array(
struct( subcontents ), struct( subcontents ), ...
) [data],
(double) [seconds]
)
}}}
and contains these elements:
''status''::
function result code, see [XmlRpcStatusCode list of status codes]
''data''::
array of subtitle file contents
''subcontents''::
subtitle file contents, a ''struct'' with 2 members: ''idsubtitlefile'' and ''data'' (base64 encoded and gzipped subtitle file contents)
''seconds''::
time taken to execute this command on server
Subtitle file contents ''subcontents'' structure:
{{{
struct(
(int) [idsubtitlefile],
(string) [data]
)
}}}
----
=== Implementations ===
There are currently no available sample implementations.
----
=== Changelog ===
Version 1: created this function
----
=== Examples ===
==== Input ====
{{{
#!xml
DownloadSubtitles
0t6bf5qt1l32ol67frupr47fg7
1951894257
1951853345
... more subtitle file IDs if needed go here ...
}}}
==== Output ====
{{{
#!xml
status
200 OK
data
idsubtitlefile
1951894257
data
H4sIAA ... base64-encoded and gzipped subtitle file contents ... BAA==
... more subtitle file content structures go here if any ...
seconds
0.38
}}}
----
=== Notes ===
* you need to base64-decode and gunzip ''subcontents''-->''data'' to get the subtitle file contents.
----
=== See also ===
* [wiki:XmlRpcSearchSubtitles SearchSubtitles]
* [wiki:XmlRpcUploadSubtitles UploadSubtitles]
----
=== Comments ===
add your comments, hints and suggestions here if you like ...
[Prev] [wiki:XmlRpcIntro Home] [Next]