Changes between Initial Version and Version 1 of XmlRpcSearchSubtitles


Ignore:
Timestamp:
Sep 26, 2008, 9:11:21 PM (16 years ago)
Author:
guest
Comment:

Created this page [Majky]

Legend:

Unmodified
Added
Removed
Modified
  • XmlRpcSearchSubtitles

    v1 v1  
     1[[PageOutline(3-4, Sections)]]
     2
     3== !SearchSubtitles ==
     4
     5
     6=== Intro ===
     7
     8  search for subtitle files matching your videos using either video file hashes or IMDb IDs.
     9
     10
     11=== Description ===
     12
     13  '''struct !SearchSubtitles(string $token, array(struct('sublanguageid' => string $sublanguageid, 'moviehash' => string $moviehash, 'moviebytesize' => int $moviesize, 'imdbid' => string $imdbid ), struct(...)))'''
     14
     15  This function can be used to search for subtitle files.
     16  There are two ways to call it:
     17 
     18    1. using video file hashes (more at once allowed):
     19      Search the database using video file hashes to get exact matches for your video files.
     20   
     21    2. using IMDb IDs:
     22      If method 1 returns no subtitle files, you can use this method to search for subtitle files matching given ''imdbid''.
     23
     24      You'll most probably have to synchronize the subtitles yourself or try more to find a match. If you find one, please, contribute by uploading them using [wiki:XmlRpcUploadSubtitles UploadSubtitles] method.
     25     
     26      When this method is used you don't have to specify ''moviehash'' and ''moviebytesize''.
     27     
     28      Some fields (IDSubMovieFile, !MovieHash, !MovieByteSize, MovieTimeMS) are missing in output when using this method.
     29     
     30  If ''sublanguageid'' is empty or contains the string 'all' - search is performed for all languages.
     31 
     32  Also remember you can not combine ''imdbid'' and ''moviehash'' searches in one call.
     33
     34
     35=== Parameters ===
     36
     37  First parameter is the session ''token'', second is the list of video files using this structure:
     38{{{
     39  array(  <--- array/list of video files
     40    struct(   <--- information about one video file
     41      (string) [sublanguageid],
     42      (string) [moviehash],
     43      (double) [moviebytesize],
     44      (string) [imdbid]
     45    ), struct( ), ...
     46  }
     47}}}
     48
     49  ''token'' (required)::
     50    token string identifying user's session, taken from [wiki:XmlRpcLogIn LogIn] result structure.
     51  ''sublanguageid''::
     52    list of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo'),
     53    see [wiki:XmlRpcGetSubLanguages GetSubLanguages] function for a list of available languages
     54  ''moviehash''::
     55    video file hash as calculated by one of the implementation functions as seen on [wiki:HashSourceCodes Hash Source Codes] page
     56  ''moviebytesize''::
     57    size of video file in bytes
     58  ''imdbid'' (optional)::
     59    [http://www.imdb.com IMDb] ID of movie this video is part of, belongs to.
     60
     61
     62=== Return Values ===
     63
     64  Output is returned in this structure:
     65{{{
     66  struct(
     67    array(
     68      struct( subfile ), struct( subfile ), ...
     69    ) [data],
     70    (double) [seconds]
     71  )
     72}}}
     73
     74  and contains these elements:
     75    ''data''::
     76      array of found subtitle file matches, when no matches are found ''data'' is empty.
     77      ''subfile''::
     78        structure that holds the subtitle file information, see [wiki:XmlRpcStruSubFile subtitle file structure]
     79    ''seconds''::
     80      time taken to execute this command on server
     81
     82
     83=== Implementations ===
     84
     85  There are currently no available sample implementations.
     86
     87
     88=== Changelog ===
     89
     90  Version 1: created this function
     91 
     92  Version 2: added search by IMDb ID
     93
     94
     95=== Examples ===
     96
     97
     98==== Input ====
     99
     100{{{
     101#!xml
     102<methodCall>
     103 <methodName>SearchSubtitles</methodName>
     104 <params>
     105  <param>
     106   <value><string>5fdgt2e9qriblpbojnq0j46op1</string></value>
     107  </param>
     108  <param>
     109   <value>
     110    <array>
     111     <data>
     112      <value>
     113       <struct>
     114        <member>
     115         <name>sublanguageid</name>
     116         <value><string>cze,eng,ger,slo</string>
     117         </value>
     118        </member>
     119        <member>
     120         <name>moviehash</name>
     121         <value><string>7d9cd5def91c9432</string></value>
     122        </member>
     123        <member>
     124         <name>moviebytesize</name>
     125         <value><double>735934464</double></value>
     126        </member>
     127       </struct>
     128      </value>
     129     </data>
     130    </array>
     131   </value>
     132  </param>
     133 </params>
     134</methodCall>
     135}}}
     136
     137 
     138==== Output ====
     139
     140{{{
     141#!xml
     142<methodResponse>
     143 <params>
     144  <param>
     145   <value>
     146    <struct>
     147     <member>
     148      <name>data</name>
     149      <value>
     150       <array>
     151        <data>
     152         <value>
     153          <struct>
     154           <member>
     155            <name>IDSubMovieFile</name>
     156            <value><string>144635</string></value>
     157           </member>
     158           <member>
     159            <name>MovieHash</name>
     160            <value><string>7d9cd5def91c9432</string></value>
     161           </member>
     162           <member>
     163            <name>MovieByteSize</name>
     164            <value><string>735934464</string></value>
     165           </member>
     166           <member>
     167            <name>MovieTimeMS</name>
     168            <value><string>6631000</string></value>
     169           </member>
     170           <member>
     171            <name>IDSubtitleFile</name>
     172            <value><string>1951854837</string></value>
     173           </member>
     174           <member>
     175            <name>SubFileName</name>
     176            <value><string>nedivx-27dresses.en.HI.srt</string></value>
     177           </member>
     178           <member>
     179            <name>SubActualCD</name>
     180            <value><string>1</string></value>
     181           </member>
     182           <member>
     183            <name>SubSize</name>
     184            <value><string>149346</string></value>
     185           </member>
     186           <member>
     187            <name>SubHash</name>
     188            <value><string>d7fb67a524f86b83245a927d7b2d0b75</string></value>
     189           </member>
     190           <member>
     191            <name>IDSubtitle</name>
     192            <value><string>3272414</string></value>
     193           </member>
     194           <member>
     195            <name>UserID</name>
     196            <value><string>451347</string></value>
     197           </member>
     198           <member>
     199            <name>SubLanguageID</name>
     200            <value><string>eng</string></value>
     201           </member>
     202           <member>
     203            <name>SubFormat</name>
     204            <value><string>srt</string></value>
     205           </member>
     206           <member>
     207            <name>SubSumCD</name>
     208            <value><string>1</string></value>
     209           </member>
     210           <member>
     211            <name>SubAuthorComment</name>
     212            <value><string>Extracted from DVD. Hearing Impaired.</string></value>
     213           </member>
     214           <member>
     215            <name>SubAddDate</name>
     216            <value><string>2008-04-15 01:51:02</string></value>
     217           </member>
     218           <member>
     219            <name>SubBad</name>
     220            <value><string>0</string></value>
     221           </member>
     222           <member>
     223            <name>SubRating</name>
     224            <value><string>10.0</string></value>
     225           </member>
     226           <member>
     227            <name>SubDownloadsCnt</name>
     228            <value><string>1013</string></value>
     229           </member>
     230           <member>
     231            <name>MovieReleaseName</name>
     232            <value><string>27.Dresses.DVDRip.XviD-NeDiVx (Hearing Impaired)</string></value>
     233           </member>
     234           <member>
     235            <name>IDMovie</name>
     236            <value><string>30833</string></value>
     237           </member>
     238           <member>
     239            <name>IDMovieImdb</name>
     240            <value><string>988595</string></value>
     241           </member>
     242           <member>
     243            <name>MovieName</name>
     244            <value><string>27 Dresses</string></value>
     245           </member>
     246           <member>
     247            <name>MovieNameEng</name>
     248            <value><string/></value>
     249           </member>
     250           <member>
     251            <name>MovieYear</name>
     252            <value><string>2008</string></value>
     253           </member>
     254           <member>
     255            <name>MovieImdbRating</name>
     256            <value><string>6.2</string></value>
     257           </member>
     258           <member>
     259            <name>UserNickName</name>
     260            <value><string>LeapinLar</string></value>
     261           </member>
     262           <member>
     263            <name>ISO639</name>
     264            <value><string>en</string></value>
     265           </member>
     266           <member>
     267            <name>LanguageName</name>
     268            <value><string>English</string></value>
     269           </member>
     270           <member>
     271            <name>SubDownloadLink</name>
     272            <value><string>http://www.opensubtitles.org/en/download/file/1951854837.gz</string></value>
     273           </member>
     274           <member>
     275            <name>ZipDownloadLink</name>
     276            <value><string>http://www.opensubtitles.org/en/download/sub/3272414</string></value>
     277           </member>
     278          </struct>
     279         </value>
     280         
     281         ... more subtitle file structures go here (if any) ...
     282         
     283        </data>
     284       </array>
     285      </value>
     286     </member>
     287     <member>
     288      <name>seconds</name>
     289      <value><double>0.02</double></value>
     290     </member>
     291    </struct>
     292   </value>
     293  </param>
     294 </params>
     295</methodResponse>
     296}}}
     297
     298
     299=== Notes ===
     300
     301  * results are always grouped by !MovieHash, !MovieByteSize, SubLanguageID, IDSubMovieFile and sorted by seencount descending, maximum number of results is 250.
     302  * field '!MovieFrames' isn't being sent from the server. Make this field optional or just remove it.
     303
     304
     305=== See also ===
     306
     307  * [wiki:XmlRpcDownloadSubtitles DownloadSubtitles]
     308  * [wiki:XmlRpcUploadSubtitles UploadSubtitles]
     309 
     310
     311=== Comments ===
     312
     313        add your comments, hints and suggestion here if you like ...
     314
     315
     316[Prev] [wiki:XmlRpcIntro Home] [Next]