| 1 | = Introduction to OSDb = |
| 2 | |
| 3 | [[PageOutline(2, Sections)]] |
| 4 | |
| 5 | We decided use [http://www.xmlrpc.com/ XMLRPC] |
| 6 | (see [http://www.xmlrpc.com/spec spec] and [http://www.xmlrpc.com/directory/1568/implementations implementations]) |
| 7 | as default API for [http://www.opensubtitles.org opensubtitles.org]. |
| 8 | |
| 9 | Our API supports many methods so there should be no problems to code some nice client applications. |
| 10 | |
| 11 | [http://en.wikipedia.org/wiki/XML-RPC Wikipedia]: |
| 12 | XML-RPC is a very simple protocol, defining only a handful of data types and commands |
| 13 | and the entire description can be printed on two pages of paper. |
| 14 | This is in stark contrast to most RPC systems, where the standards documents |
| 15 | often run into the hundreds of pages and require considerable software support in order to be used. |
| 16 | |
| 17 | |
| 18 | = Instructions = |
| 19 | * [wiki:DevReadFirst Read this first] |
| 20 | * All development testing should be pointed to: http://dev.opensubtitles.org/xml-rpc (currently offline, so use main server) |
| 21 | * Main/Production server XMLRPC URL: http://www.opensubtitles.org/xml-rpc |
| 22 | * Before developing let us know and we will assign/agree on useragent code for your application. |
| 23 | * For languages codes, check [http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes ISO639], use '''pb/pob''' for Portuguese (Brazil) - [http://www.opensubtitles.org/addons/export_languages.php Download OS languages table dump] |
| 24 | * For gzip compression use function which adds no header to output, for PHP it's: [http://www.php.net/manual/en/function.gzcompress.php gzcompress]. For decompression use [http://www.php.net/gzuncompress gzdecompress]. |
| 25 | |
| 26 | |
| 27 | = XMLRPC methods = |
| 28 | |
| 29 | == Session handling == |
| 30 | * [wiki:XmlRpcLogIn LogIn] - login user and start session |
| 31 | '''struct !LogIn( string $username, string $password, string $language, string $useragent )''' |
| 32 | * [wiki:XmlRpcLogOut LogOut] - logout user |
| 33 | * [wiki:XmlRpcNoOperation NoOperation] - keep-alive user's session, verify token/session validity |
| 34 | |
| 35 | |
| 36 | == Search and download == |
| 37 | * [wiki:XmlRpcSearchSubtitles SearchSubtitles] - search for subtitles using video hashes or IMDb ID |
| 38 | * [wiki:XmlRpcSearchToMail SearchToMail] - search for subtitles, send result to e-mail address |
| 39 | * [wiki:XmlRpcDownloadSubtitles DownloadSubtitles] - download given subtitle files |
| 40 | |
| 41 | |
| 42 | == Upload == |
| 43 | * [wiki:XmlRpcTryUploadSubtitles TryUploadSubtitles] - check subtitles before uploading |
| 44 | * [wiki:XmlRpcUploadSubtitles UploadSubtitles] - upload given subtitle |
| 45 | |
| 46 | |
| 47 | == Movies == |
| 48 | * [wiki:XmlRpcSearchMoviesOnIMDB SearchMoviesOnIMDB] - |
| 49 | * [wiki:XmlRpcGetIMDBMovieDetails GetIMDBMovieDetails] - get movie details fro given IMDb ID |
| 50 | * [wiki:XmlRpcInsertMovie InsertMovie] - insert a new movie |
| 51 | |
| 52 | |
| 53 | == Reporting and rating == |
| 54 | * [wiki:XmlRpcServerInfo ServerInfo] - get basic server information and statistics |
| 55 | * [wiki:XmlRpcReportMovieHash ReportMovieHash] - report wrong |
| 56 | * [wiki:XmlRpcSubtitlesVote SubtitlesVote] - rate subtitles |
| 57 | |
| 58 | |
| 59 | == User interface == |
| 60 | * [wiki:XmlRpcGetSubLanguages GetSubLanguages] - get support subtitle languages |
| 61 | * [wiki:XmlRpcDetectLanguage DetectLanguage] - detect language for given text |
| 62 | * [wiki:XmlRpcGetAvailableTranslations GetAvailableTranslations] - get list of available translations for a client application |
| 63 | * [wiki:XmlRpcGetTranslation GetTranslation] - get given language translation file for a client application |
| 64 | * [wiki:XmlRpcAutoUpdate AutoUpdate] - check for latest version of a client application |
| 65 | |
| 66 | |
| 67 | == Checking == |
| 68 | * [wiki:XmlRpcCheckMovieHash CheckMovieHash] - |
| 69 | * [wiki:XmlRpcCheckSubHash CheckSubHash] - |
| 70 | |
| 71 | |
| 72 | = Credits = |
| 73 | * 2ge - writer of OSDb XML-RPC server-side implementation |
| 74 | * eduo - supplier of various example inputs/outputs |
| 75 | * all other contributors |