| 1 | [[PageOutline(3-4, Sections)]] |
| 2 | |
| 3 | == !DownloadSubtitles == |
| 4 | |
| 5 | |
| 6 | === Intro === |
| 7 | |
| 8 | download given subtitle files |
| 9 | |
| 10 | |
| 11 | ---- |
| 12 | === Description === |
| 13 | |
| 14 | '''struct !DownloadSubtitles(string $token, array($IDSubtitleFile, $IDSubtitleFile,...) $data)''' |
| 15 | |
| 16 | This function can be used to download multiple subtitle files at once. |
| 17 | |
| 18 | |
| 19 | ---- |
| 20 | === Parameters === |
| 21 | |
| 22 | First parameter is the session ''token'', second is the array/list of subtitle file IDs using this structure: |
| 23 | {{{ |
| 24 | array( <--- array of subtitle file IDs |
| 25 | (int), (int), ... |
| 26 | ) |
| 27 | }}} |
| 28 | |
| 29 | ''token (required)'':: |
| 30 | token string identifying user's session, taken from [XmlRpcLogIn LogIn] output structure. |
| 31 | ''data (required)'':: |
| 32 | array of subtitle file IDs |
| 33 | |
| 34 | |
| 35 | ---- |
| 36 | === Return Values === |
| 37 | |
| 38 | Output is returned in this structure: |
| 39 | {{{ |
| 40 | struct( |
| 41 | array( |
| 42 | struct( subcontents ), struct( subcontents ), ... |
| 43 | ) [data], |
| 44 | (double) [seconds] |
| 45 | ) |
| 46 | }}} |
| 47 | |
| 48 | and contains these elements: |
| 49 | ''status'':: |
| 50 | function result code, see [XmlRpcStatusCode list of status codes] |
| 51 | ''data'':: |
| 52 | array of subtitle file contents |
| 53 | ''subcontents'':: |
| 54 | subtitle file contents, a ''struct'' with 2 members: ''idsubtitlefile'' and ''data'' (base64 encoded and gzipped subtitle file contents) |
| 55 | |
| 56 | {{{struct( |
| 57 | (int) [idsubtitlefile], |
| 58 | (string) [data] |
| 59 | ) |
| 60 | }}} |
| 61 | |
| 62 | ''seconds'':: |
| 63 | time taken to execute this command on server |
| 64 | |
| 65 | |
| 66 | ---- |
| 67 | === Implementations === |
| 68 | |
| 69 | There are currently no available sample implementations. |
| 70 | |
| 71 | |
| 72 | ---- |
| 73 | === Changelog === |
| 74 | |
| 75 | Version 1: created this function |
| 76 | |
| 77 | |
| 78 | ---- |
| 79 | === Examples === |
| 80 | |
| 81 | |
| 82 | ==== Input ==== |
| 83 | |
| 84 | {{{ |
| 85 | #!xml |
| 86 | <methodCall> |
| 87 | <methodName>DownloadSubtitles</methodName> |
| 88 | <params> |
| 89 | <param> |
| 90 | <value><string>0t6bf5qt1l32ol67frupr47fg7</string></value> |
| 91 | </param> |
| 92 | <param> |
| 93 | <value> |
| 94 | <array> |
| 95 | <data> |
| 96 | <value><int>1951894257</int></value> |
| 97 | <value><int>1951853345</int></value> |
| 98 | ... more subtitle file IDs if needed go here ... |
| 99 | </data> |
| 100 | </array> |
| 101 | </value> |
| 102 | </param> |
| 103 | </params> |
| 104 | </methodCall> |
| 105 | }}} |
| 106 | |
| 107 | |
| 108 | ==== Output ==== |
| 109 | |
| 110 | {{{ |
| 111 | #!xml |
| 112 | <methodResponse> |
| 113 | <params> |
| 114 | <param> |
| 115 | <value> |
| 116 | <struct> |
| 117 | <member> |
| 118 | <name>status</name> |
| 119 | <value><string>200 OK</string></value> |
| 120 | </member> |
| 121 | <member> |
| 122 | <name>data</name> |
| 123 | <value> |
| 124 | <array> |
| 125 | <data> |
| 126 | <value> |
| 127 | <struct> |
| 128 | <member> |
| 129 | <name>idsubtitlefile</name> |
| 130 | <value><int>1951894257</int></value> |
| 131 | </member> |
| 132 | <member> |
| 133 | <name>data</name> |
| 134 | <value><string>H4sIAA ... base64-encoded and gzipped subtitle file contents ... BAA==</string></value> |
| 135 | </member> |
| 136 | </struct> |
| 137 | </value> |
| 138 | ... more subtitle file content structures go here if any ... |
| 139 | </data> |
| 140 | </array> |
| 141 | </value> |
| 142 | </member> |
| 143 | <member> |
| 144 | <name>seconds</name> |
| 145 | <value> |
| 146 | <double>0.38</double> |
| 147 | </value> |
| 148 | </member> |
| 149 | </struct> |
| 150 | </value> |
| 151 | </param> |
| 152 | </params> |
| 153 | </methodResponse> |
| 154 | |
| 155 | }}} |
| 156 | |
| 157 | |
| 158 | ---- |
| 159 | === Notes === |
| 160 | |
| 161 | * you need to base64-decode and gunzip ''subcontents''-->''data'' to get the subtitle file contents. |
| 162 | |
| 163 | |
| 164 | ---- |
| 165 | === See also === |
| 166 | |
| 167 | * [wiki:XmlRpcSearchSubtitles SearchSubtitles] |
| 168 | * [wiki:XmlRpcUploadSubtitles UploadSubtitles] |
| 169 | |
| 170 | |
| 171 | ---- |
| 172 | === Comments === |
| 173 | |
| 174 | add your comments, hints and suggestions here if you like ... |
| 175 | |
| 176 | |
| 177 | |
| 178 | [Prev] [wiki:XmlRpcIntro Home] [Next] |