Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
polemarxos
Posts: 4
Joined: Sat Dec 28, 2013 4:30 pm

vb .net search by query problem :(

Thu Feb 06, 2014 10:25 am

Hello.
I just made a vb .net app that can search for subtitles using movie hash but i have stucked on how to get subtitles by query.
i have tryied a lot of thing to get results using query (movie name) but without success.
To get subs with hash search im using this class:

Code: Select all

Imports CookComputing.XmlRpc Public Structure LoginRequest Public token As String Public status As String Public seconds As Double End Structure Public Structure LogoutRequest Public status As String Public seconds As Double End Structure Public Structure FileDet Public sublanguageid As String Public moviehash As String Public moviebytesize As Double End Structure Public Structure DataReturn Public IDSubMovieFile As String Public MovieHash As String Public MovieByteSize As String Public MovieTimeMS As String Public IDSubtitleFile As String Public SubFileName As String Public SubActualCD As String Public SubSize As String Public SubHash As String Public IDSubtitle As String Public UserID As String Public SubLanguageID As String Public SubFormat As String Public SubSumCD As String Public SubAuthorComment As String Public SubAddDate As String Public SubBad As String Public SubRating As String Public SubDownloadsCnt As String Public MovieReleaseName As String Public IDMovie As String Public IDMovieImdb As String Public MovieName As String Public MovieNameEng As String Public MovieYear As String Public MovieImdbRating As String Public UserNickName As String Public ISO639 As String Public LanguageName As String Public SubDownloadLink As String Public ZipDownloadLink As String End Structure Public Structure SubReturn Public data As DataReturn() Public seconds As Double End Structure Public Structure SubTitlefl Public idsubtitlefile As String Public data As String End Structure Public Structure Downsubs Public status As String Public data As SubTitlefl() Public seconds As Double End Structure Public Structure srchsubfilt End Structure Public Structure Getsublangstrct Public SubLanguageID As String Public LanguageName As String Public ISO639 As String End Structure Public Structure Getsublang Public data As Getsublangstrct() Public seconds As Double End Structure <XmlRpcUrl("http://api.opensubtitles.org/xml-rpc")> _ Public Interface Opensubhub Inherits IXmlRpcProxy <XmlRpcMethod("LogIn")> _ Function LogIn(usename As String, password As String, language As String, useragent As String) As LoginRequest <XmlRpcMethod("LogOut")> _ Function LogOut(token As String) As LogoutRequest <XmlRpcMethod("SearchSubtitles")> _ Function SearchSubtitles(token As String, detail As FileDet()) As SubReturn <XmlRpcMethod("GetSubLanguages")> _ Function GetSubLanguages(language As String) As Getsublang End Interface
and to get the results im using this

Code: Select all

Dim Client As New WebClient() If IsConnectedToInternet() Then Dim subhub As Opensubhub = DirectCast(XmlRpcProxyGen.Create(GetType(Opensubhub)), Opensubhub) hashsize = ComputeMovieHash(paths) hashcode = ToHexadecimal(hashsize) Dim info As New FileInfo(paths) Dim bytesize As Double = info.Length Dim inrequest As LoginRequest Dim outrequest As LogoutRequest Dim detail As FileDet() = New FileDet(0) {} Dim returndetails As SubReturn Try inrequest = subhub.LogIn("", "", "en", "OS Test User Agent") detail(0).sublanguageid = subsLang detail(0).moviehash = hashcode detail(0).moviebytesize = bytesize returndetails = subhub.SearchSubtitles(inrequest.token, detail) rest of the code...
What shall i do to get query results?

User avatar
oss
Site Admin
Posts: 5897
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: vb .net search by query problem :(

Sun Feb 09, 2014 2:08 pm

use:

Code: Select all

args => array( $token, array( array('query' => 'True Blood', 'season' => 3, 'episode' => 8, 'sublanguageid' => 'eng'), array('moviebytesize' => '101996635', 'sublanguageid'=>'', 'moviehash' => '14dc4f9563054a1c'), ) )
for example, if needed, I can send you xml request.

polemarxos
Posts: 4
Joined: Sat Dec 28, 2013 4:30 pm

Re: vb .net search by query problem :(

Sun Mar 02, 2014 8:20 pm

use:

Code: Select all

args => array( $token, array( array('query' => 'True Blood', 'season' => 3, 'episode' => 8, 'sublanguageid' => 'eng'), array('moviebytesize' => '101996635', 'sublanguageid'=>'', 'moviehash' => '14dc4f9563054a1c'), ) )
for example, if needed, I can send you xml request.
yeah i know.i have read it from api.but the point is that whatever i have tried it doesnt work cause i do something wrong and i cant figure out what :S

polemarxos
Posts: 4
Joined: Sat Dec 28, 2013 4:30 pm

Re: vb .net search by query problem :(

Sun Mar 02, 2014 9:05 pm

Nevermind.Problem fixed :D

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 3 guests