Changes between Version 22 and Version 23 of XMLRPC
- Timestamp:
- Dec 15, 2008, 9:44:20 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
XMLRPC
v22 v23 83 83 84 84 == !SearchSubtitles == 85 '''array !SearchSubtitles( $token, array(array('sublanguageid' => $sublanguageid, 'moviehash' => $moviehash, 'moviebytesize' => $moviesize, ''imdbid => $imdbid'' ),array(...)))''' 86 87 This function returns information about found subtitles. It is designed making multiple search at once. Note - result is always grupped by !MovieHash, !MovieByteSize, !SubLanguageID, !IDSubMovieFile, sorted by seencount descending, max results is 250. When nothing is found, 'data' is empty. If sublanguageid is empty, or have value 'all' - it search in every sublanguage. Also, imdbid parameter is '''optional''', when used, it is not needed define moviehash and moviebytesize, so you can search subtitle database with imdbid only. Also remember you can not combine imdbid and moviehash searching in one request. Some data (!IDSubMovieFile, !MovieHash, !MovieByteSize, !MovieTimeMS) are missing in output when searching by imdbid. 88 89 Example output: 90 {{{ 91 [data] => Array 85 '''array !SearchSubtitles( $token, array(array('sublanguageid' => $sublanguageid, 'moviehash' => $moviehash, 'moviebytesize' => $moviesize, ''imdbid => $imdbid'', ''query'' => 'movie name' ),array(...)))''' 86 87 Returns information about found subtitles. It is designed making multiple search at once. When nothing is found, 'data' is empty. If sublanguageid is empty, or have value 'all' - it search in every sublanguage, you can set it to multiple languages (e.g. eng,dut,cze). 88 89 If you define moviehash and moviebytesize, then imdbid and query in same array are ignored. If you define imdbid, then moviehash, moviebytesize and query is ignored. If you define query, then moviehash, moviebytesize and imdbid is ignored. Pseudocode: 90 {{{ 91 if(defined($moviehash) and defined($moviebytesize)) { 92 // search by $moviehash and $moviebytesize 93 } elseif (defined($imdbid)) { 94 // search by $imdbid 95 } elseif (defined($query)) { 96 // fulltext search by $query 97 } else { 98 // empty result 99 } 100 }}} 101 * Some data (IDSubMovieFile, !MovieHash, !MovieByteSize, MovieTimeMS) are set to 0, when searching by imdbid or query 102 * Max results is set to 500 found items 103 * For perfect matches use moviehash/moviebytesize searching, for movie matches use imdbid searching, if you can not use any of them, use fulltext search 104 * If used this method in movie player and subtitles are found using imdbid or query, should be nice to implement [wiki:DevReadFirst#Yourmovieplayershouldsupportautomaticuploading Automatic Uploading], so we get back movie hash of matching movie 105 106 Example output: 107 {{{ 108 [data] => Array 92 109 ( 93 110 [0] => Array 94 111 ( 95 [IDSubMovieFile] => 739112 [IDSubMovieFile] => 82181 96 113 [MovieHash] => 09a2c497663259cb 97 114 [MovieByteSize] => 733589504 98 [MovieTimeMS] => 0 99 [MovieFrames] => 0 100 [IDSubtitleFile] => 963 101 [SubFileName] => Night Watch (Nochnoj Dozor) (2004) [1 of 2].srt 115 [MovieTimeMS] => 3165000 116 [IDSubtitleFile] => 1951690121 117 [SubFileName] => Night.Watch.2004.CD1.DVDRiP.XViD-FiCO.srt 102 118 [SubActualCD] => 1 103 [SubSize] => 30677104 [SubHash] => 6c2bdbb308760205146cb2807dfc32f6105 [IDSubtitle] => 771106 [UserID] => 3 7047107 [SubLanguageID] => eng119 [SubSize] => 27287 120 [SubHash] => fe106fe2368799bdc73271bb24ac6df7 121 [IDSubtitle] => 3144301 122 [UserID] => 367123 123 [SubLanguageID] => dut 108 124 [SubFormat] => srt 109 [SubSumCD] => 2125 [SubSumCD] => 1 110 126 [SubAuthorComment] => 111 [SubAddDate] => 200 5-05-23 07:47:04127 [SubAddDate] => 2007-08-31 22:18:20 112 128 [SubBad] => 0 113 129 [SubRating] => 0.0 114 [SubDownloadsCnt] => 315115 [MovieReleaseName] => AxxO130 [SubDownloadsCnt] => 252 131 [MovieReleaseName] => Night Watch 116 132 [IDMovie] => 516 117 133 [IDMovieImdb] => 403358 … … 119 135 [MovieNameEng] => Night Watch 120 136 [MovieYear] => 2004 121 [MovieImdbRating] => 6.3 122 [UserNickName] => onefox 123 [ISO639] => en 124 [LanguageName] => English 125 [SubDownloadLink] => http://www.opensubtitles.org/download/file/963.gz 126 [ZipDownloadLink] => http://www.opensubtitles.org/en/download/sub/771 127 ) 137 [MovieImdbRating] => 0.0 138 [UserNickName] => gyoom 139 [ISO639] => nl 140 [LanguageName] => Dutch 141 [SubComments] => 0 142 [SubDownloadLink] => http://www.opensubtitles.org/en/download/file/1951690121.gz 143 [ZipDownloadLink] => http://www.opensubtitles.org/en/download/sub/3144301 144 ) 145 128 146 [1] => Array 129 147 ( 130 [IDSubMovieFile] => 740 131 [MovieHash] => 1dab7c63893d0d81 132 [MovieByteSize] => 733919232 133 [MovieTimeMS] => 0 134 [MovieFrames] => 0 135 [IDSubtitleFile] => 964 136 [SubFileName] => Night Watch (Nochnoj Dozor) (2004) [2 of 2].srt 137 [SubActualCD] => 2 138 [SubSize] => 39074 139 [SubHash] => 021d7bf5480f97d8e0a28f0b0f03b28d 140 [IDSubtitle] => 771 141 [UserID] => 37047 142 [SubLanguageID] => eng 148 [IDSubMovieFile] => 82182 149 [MovieHash] => 09a2c497663259cb 150 [MovieByteSize] => 733589504 151 [MovieTimeMS] => 3165000 152 [IDSubtitleFile] => 1951690122 153 [SubFileName] => Night.Watch.2004.CD1.DVDRiP.XViD-FiCO.srt 154 [SubActualCD] => 1 155 [SubSize] => 27287 156 [SubHash] => fe106fe2368799bdc73271bb24ac6df7 157 [IDSubtitle] => 3144302 158 [UserID] => 367123 159 [SubLanguageID] => dut 143 160 [SubFormat] => srt 144 161 [SubSumCD] => 2 145 162 [SubAuthorComment] => 146 [SubAddDate] => 200 5-05-23 07:47:04163 [SubAddDate] => 2007-08-31 22:23:39 147 164 [SubBad] => 0 148 165 [SubRating] => 0.0 149 [SubDownloadsCnt] => 315150 [MovieReleaseName] => Diamond166 [SubDownloadsCnt] => 89 167 [MovieReleaseName] => Night Watch 151 168 [IDMovie] => 516 152 169 [IDMovieImdb] => 403358 … … 154 171 [MovieNameEng] => Night Watch 155 172 [MovieYear] => 2004 156 [MovieImdbRating] => 6.3 157 [UserNickName] => onefox 158 [ISO639] => en 159 [LanguageName] => English 160 [SubDownloadLink] => http://www.opensubtitles.org/download/file/964.gz 161 [ZipDownloadLink] => http://www.opensubtitles.org/en/download/sub/771 173 [MovieImdbRating] => 0.0 174 [UserNickName] => gyoom 175 [ISO639] => nl 176 [LanguageName] => Dutch 177 [SubComments] => 0 178 [SubDownloadLink] => http://www.opensubtitles.org/en/download/file/1951690122.gz 179 [ZipDownloadLink] => http://www.opensubtitles.org/en/download/sub/3144302 162 180 ) 163 181 ) … … 166 184 167 185 '''Fields explanation:''' 168 All field are self-explained. Note: it returns array with two keys. In first key is array of arrays of found subtitles, in second key is number of seconds as usual. 169 170 '''NOTE''' The field '!MovieFrames' isn't being send from the server. Make this field optional or just remove it. 186 All field are self-explained. 171 187 172 188 ----