Version 5 (modified by os, 12 years ago) (diff) |
---|
Testing OS API without programming
Steps:
- Go to http://www.opensubtitles.org/addons/xml-rpc/debugger/
- Fill: Address: api.opensubtitles.org, Port: 80, Path: /xml-rpc
- Check Execute method
- Method Name: "LogIn", put in Payload this:
<param> <value><string></string></value> </param> <param> <value><string></string></value> </param> <param> <value><string></string></value> </param> <param> <value><string>OS Test User Agent</string></value> </param>
- press execute button
- In response you will get something like:
<member> <name>token</name> <value><string>oujbupj6fek9mc433qipaka1r2</string></value>
take string (token) like "oujbupj6fek9mc433qipaka1r2" in our case, and:
- put into Method Name: SearchSubtitles, replace token with your, put in payload:
<params> <param> <value><string>oujbupj6fek9mc433qipaka1r2</string></value> </param> <param> <value> <array> <data> <value> <struct> <member> <name>sublanguageid</name> <value><string>cze,eng,ger,slo</string> </value> </member> <member> <name>moviehash</name> <value><string>7d9cd5def91c9432</string></value> </member> <member> <name>moviebytesize</name> <value><double>735934464</double></value> </member> </struct> </value> </data> </array> </value> </param> </params>
and you should get response like:
<methodResponse> <params> <param> <value><struct> <member> <name>status</name> <value><string>200 OK</string></value> </member> <member><name>data</name> <value><array> <data> <value><struct> <member> <name>MatchedBy</name> <value><string>moviehash</string></value> </member> <member><name>IDSubMovieFile</name> <value><string>143481</string></value> </member> <member><name>MovieHash</name> <value><string>7d9cd5def91c9432</string></value> ...
remember:
- you must use valid useragent (test user agent is valid one for test purposes only)
- your session must be valid (so don't call SearchSubtitles() after 30 minutes after LogIn(), session might be expired)