[REQUEST] Sublight Subtitles Plugin, anyone interested in developing this?

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
macofaco Offline
Sublight Admin
Posts: 27
Joined: Jan 2009
Reputation: 4
Post: #16
Dan Dare, thank you.

Today I published algorithm example in C# (How to calculate Sublight video hash?).

It is really simple but if you have any questions please ask.

Regards,
macofaco
find quote
Dan Dare Offline
http://www.xbmc4xbox.org
Posts: 1,039
Joined: Sep 2004
Reputation: 146
Post: #17
@macofaco
Your code sample is good enough for now. I managed to write a quick sample the other day and logged in and got a token, I'll try the hashing and a few searches and let you know if any questions. Thanks again.
find quote
Dan Dare Offline
http://www.xbmc4xbox.org
Posts: 1,039
Joined: Sep 2004
Reputation: 146
Post: #18
I must be quite bad at programming in Python, it took me almost a day to calculate the videoHash and especially the control byte :-) Still struggling with SOAPpy, hopefully we'll get there this week...
find quote
rwparris2 Offline
Team-XBMC Python Developer
Posts: 1,333
Joined: Jan 2008
Reputation: 2
Location: US
Post: #19
Dan Dare Wrote:I see rwparris already shown his interest, but I might be as well.

Dan Dare Wrote:Still struggling with SOAPpy, hopefully we'll get there this week...
SOAPpy had me banging my head against the wall after about an hour of playing with it, so I decided to stop for a bit. Then I got accidentally my harddrive, and lost all my 'started' plugins (about 11 I think) and forgot about this one.

Thanks for picking it up Smile

Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
find quote
Dan Dare Offline
http://www.xbmc4xbox.org
Posts: 1,039
Joined: Sep 2004
Reputation: 146
Post: #20
Sheesh! Shocked that's quite a bit of work lost, sorry to hear that...

Lucky me I uploaded it last night on Google Code, even if unfinished Nerd

I managed to get SOAPpy to login anonymously and get a guid token, and performed a search, it's just that I don't get any results (yet), may be because I'm not passing all required nodes or something like that, I'll try again some more - I found this online soap client where I tried a couple of runs and compare that with the debug output from SOAPpy to figure out what I'm doing wrong.

Sure thing, my pleasure.
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,372
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #21
Fantastic that you're looking into this. OpenSubtitles is unusable atm. I can't get any subs from it with Sublight nor with SubDownloader or any XBMC script.

The Sublight db is returning results most of the time. But the db obviously should grow to be a full alternative for the OpenSubtitles database. Uploading subtitles to the SubLight db requires users to be the 'author' of a sub-file, or at least have permission from the author to upload them. I don't create subs or know anyone who does, otherwise I would be uploading them.

The application is really very cool. It's working extremely well. The context-menu option is superb and allows me to explain how to download subs over the phone to my non-nerd friends. The only thing I'm still missing is 'TV season support', meaning... a way to let Sublight scan a directory for video files and automatically search for subtitles for every video file found and allowing to select the sub to download. Like Subdownloader does (which doesn't work anymore for me). A context-menu option for that would be fantastic!

I'm curious... how did you manage to make the app look so nice, office 2007 style, macofaco?

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
(This post was last modified: 2009-05-05 18:57 by Bram77.)
find quote
Dan Dare Offline
http://www.xbmc4xbox.org
Posts: 1,039
Joined: Sep 2004
Reputation: 146
Post: #22
Had a bit of time to look at it and played with the Sublight app as well, and I agree with Bram77 - high points for usability and design, very easy to use, downloading and trying the subtitles, and even the upload was very easy as well. The webservice is a nice way to integrate with XBMC, and even if it doesn't support all the other sources as the Sublight app does, the authors were kind enough to publish the sources for the C# plugins, we can inspire from the code to introduce additional sources in the plugin.

Thumbs up to macofaco! Big Grin
(This post was last modified: 2009-05-05 15:56 by Dan Dare.)
find quote
macofaco Offline
Sublight Admin
Posts: 27
Joined: Jan 2009
Reputation: 4
Post: #23
Thank you both.


@Bram77

Regarding office 2007 look - I improvized and developed my own Ribbon control (it is not perfect but looks good enough). For menus I used code from this link: http://www.codeproject.com/KB/menus/Offi...derer.aspx

"TV season support" feature is added to wish list but it's low priority at the moment. Did you try to use SublightCmd for this?


@Dan Dare

If you have any questions regarding web service just ask.

Plugins which are available for download from http://www.subtitles-on.net/ were all developed by me Smile


-----

Sublight client and server will be actively developed to bring new features (for example subtitle editing, subtitle deletion, improved SublightCmd, batch subtitle upload, .....)

I also hope to upgrade current server because it has very limited resources. When I upgrade to new server it should be lightning fast Smile
find quote
Dan Dare Offline
http://www.xbmc4xbox.org
Posts: 1,039
Joined: Sep 2004
Reputation: 146
Post: #24
@macofaco
No need to bother you (just yet :-), it's how SOAPpy module interprets the WSDL file, it seems it has has problems with certain types, different order of nodes and what's worse and probably causing my problems comes up with incorrect default values for nillable nodes... Later on I might try with creating the XML by hand and pushing that through httplib, I think it might works better, althought I will have to deal myself with parsing the results...

Thanks anyways, the webservice responed quickly enough and the app is very handy. Btw, nice app you got there, easy to search and preview the subtitles, I even uploaded a few subs I managed to get from OpenSubtitles from the web, through some kind of a miracle...
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,372
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #25
Thanks for the info, you did a really nice job there.
Do you have any intention to make Sublight a commercial product in the future? [url=http://forum.xbmc.org/member.php?action=profile&uid=43284][/url]

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
find quote
macofaco Offline
Sublight Admin
Posts: 27
Joined: Jan 2009
Reputation: 4
Post: #26
I would like to keep Sublight service as free and fair as possible. But if I don't receive enough donations to cover server/hosting costs I might consider some kind of "contribution program".

For example, user could contribute in different ways:
-translating Sublight or writing Sublight plugin
-publishing and linking subtitles
-small donation
-other contributions (for example implementing Sublight service in XBMC), etc.


Do you think this would be acceptable/fair?
find quote
Bram77 Offline
Skilled Python Coder
Posts: 1,372
Joined: Feb 2008
Reputation: 32
Location: Netherlands
Post: #27
Sure, of course it's your application so you can do whatever you like. But if you want a successful app I think keeping it free is the way to go! Last.FM is going to die because it's not free any more (in most of the world), which is like asking money for Wikipedia uage. Awfull! Maybe adding some advertisement on your site could help to?
It's nice to know it will be free of charge in the future so the people developing plugins for XBMC, or even write native support into XBMC, will do it for long term bennefits Smile.

I'll translate it to Dutch asap Smile
If I can find the time I might have a look at writing plugins for some Dutch subtitle sites (even though I only use English subs myself and only because my girlfriend has a hearingdisability).

[Image: widget]

Please add to my reputation if you find my posts usefull (+/- button below posts)
Ubuntu 12.10 minimal XBMC auto-install script :: XBMControl :: Xbmc XBOX Skins :: XBMControl for Android :: Owner of Sudo Systems
find quote
Dan Dare Offline
http://www.xbmc4xbox.org
Posts: 1,039
Joined: Sep 2004
Reputation: 146
Post: #28
I finally went the dyi-SOAP method, I struggled enough with all Python SOAP libraries I could find... Sad building the XML requests as strings and pushing them through httlib, one step closer... Remains to get the download ticket and actually download the subtitles, hopefully tomorrow... Wink
find quote
macofaco Offline
Sublight Admin
Posts: 27
Joined: Jan 2009
Reputation: 4
Post: #29
I am impressed you are doing this without asking any questions Smile

I will explain some things anyway. Procedure for downloading subtitle is this:
  • you must call method GetDownloadTicket with this parameters:
    [INDENT]session: received by LogIn5 or LogInAnonymous3 methods (note you should always use methods with highest number, for example LogIn5 instead of LogIn4. Methods with lower numbers are obsolete and will be removed in future). You should login only once per application start. On application exit you should call LogOut method (for security reasons, it is also nothing wrong if you don't)[/INDENT]
    [INDENT]plugin: if you are not using Sublight plugins and you are downloading subtitles from its native database leave this field empty[/INDENT]
    [INDENT]id: subtitle id you are about to download[/INDENT]
  • GetDownloadTicket returns to you:
    [INDENT]boolean result: true on success, false otherwise[/INDENT]
    [INDENT]que: this is important for future use. It tells you how many seconds you have to wait until you can continue with download. Method currently returns always 0 which means you can continue to download immediately[/INDENT]
    [INDENT]error: if method returns false you receive here detailed description about error[/INDENT]
  • now you can call method DownloadByID3:
    [INDENT]sessionID: same as GetDownloadTicket session parameter[/INDENT]
    [INDENT]subtitleID: subtitle id you want to download[/INDENT]
    [INDENT]codePage: in which ANSI codepage you want to receive subtitle. If you use -1 default encoding will be used (UTF-8). For more details check http://msdn.microsoft.com/goglobal/bb896001(en-us).aspx (column ANSI codepage)[/INDENT]
    [INDENT]removeFormatting: should <i>...</i> tags be removed from subtitle or not (default is false which returns you original subtitle)[/INDENT]
    [INDENT]ticket: result you received from GetDownloadTicket method[/INDENT]
  • DownloadByID3 returns to you:
    [INDENT]boolean result: true on success, false otherwise[/INDENT]
    [INDENT]data: Base 64 encoded ZIP file (I hope you know how to unzip this)[/INDENT]
    [INDENT]error: if method returns false you receive here detailed description about error[/INDENT]
find quote
Dan Dare Offline
http://www.xbmc4xbox.org
Posts: 1,039
Joined: Sep 2004
Reputation: 146
Post: #30
@macofaco
That shows how not used I am to working with service providers, we usually "hack" our way into website / resources with little or no information at hand, the information your provided is more then welcome. I've been using the online SOAP client that shows the request / response XMLs and then used Fiddler to peek at the HTTP communication between the Sublight client and the webservice. Again, thanks for your input, very useful.
find quote