SubtitleDownloader (6 Viewers)

seco

Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Re: SubtitleDownloader 2.6

    Hi Seco,

    It has come to my attention that this plugin is not really "API Friendly" for the sites providing those.
    It executes calls, that can be cached very easy since they provide data that never change. By caching it, you would improve the speed of the addon ánd decrease the strain you put on the subtitle site's so it is a win-win situation.

    For example, you are using Bierdopje's "FindShowByName" call to obtain the show id.
    This ID is "fixed" and never changes, so if you would cache this (e.g. in an sqlite database?) it would eliminate a lot of API calls and improving the general performance.

    I think the subtitle sites can appreciate this, just like the endusers.

    You are talking about "sites" but is your experience really based only on Bierdopje?

    In that case I can say that the API for Bierdopje is not very good in performance point of view if compared to other APIs. At this point I don't remember all the details but the Bierdopje API requires doing "extra" requests for simple searches SubtitleDownloader does. Also, the implementation for Bierdopje was not originally made by me but I did some optimizations for it. For these optimizations I had to compile my own version of Bierdopje C# API DLL since there were protected methods in original implementation that I could not use directly for optimization purposes.

    In general I think the Bierdopje API is too complex for SubtitleDownloader. Caching is not a solution but only a hack to work around the poor API. SubtitleDownloader is intented to be a light-weight library and a database is certainly not going to be part of it. Also if you check the version history of my DLL I have always made optimizations when possible since I don't have any reason to make SubtitleDownloader perform poorly by making extra requests.

    Of course you are always welcome to post your optimized implementation for any site.
     

    Sypher

    Portal Member
    June 13, 2008
    26
    2
    Home Country
    Netherlands Netherlands
    Re: SubtitleDownloader 2.6

    You are talking about "sites" but is your experience really based only on Bierdopje?
    Yes, that is true. But I would assume that others have a similar API, and that there are some calls executed while they could've been cached.

    In that case I can say that the API for Bierdopje is not very good in performance point of view if compared to other APIs.
    What's wrong with the performance? It works extremely fast.

    At this point I don't remember all the details but the Bierdopje API requires doing "extra" requests for simple searches SubtitleDownloader does.
    Such as? There only "extra" request is to obtain the show id, which should be a one-off thing. Even easier, if you know the TheTVDB somehow (mptvseries knows it) then you do not even have to do such calls because you can then work based of that id.

    In general I think the Bierdopje API is too complex for SubtitleDownloader.
    Its not that complex if you ask me. Never heard that complaint before..

    Caching is not a solution but only a hack to work around the poor API.
    It has nothing to do with the API itself, it is just a waste of both user and website's bandwidth.
    For instance, the "findshowbyname" call is a "search" function in the background, which can be fairly intensive query wise.
    I do not see any point in repeating such queries 24 times, if someone decides to watch a whole season of a show in 1 day, if the information is not changing :)

    Of course you are always welcome to post your optimized implementation for any site.
    I am not a C# so I can't help you with that, I'm just an interested third party who is an frequent user of both the site and the plugin (via Mptvseries)
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Re: SubtitleDownloader 2.6

    In my opinion any API is bad if it can be used "wrong". With Bierdopje the whole idea that I need to call a method like "FindShowByName" is wrong in the first place since I want to search by show name only and I'm not interested about IDs or other information FindShowByName requires or returns. By performance I was referring to extra requests like FindShowByName method.

    Like I said I'm not very familiar with the current implementation details since I didn't make the original implementation and it's been a long time since I took a look of it.

    Old API for S4U.se (s4u.se - Swedish Subtitles | XML Search - Help) is a good example of a straightforward and simple API and the new one is even better.
     

    superture

    MP Donator
  • Premium Supporter
  • January 5, 2008
    17
    0
    Home Country
    Sweden Sweden
    Re: SubtitleDownloader 2.6

    Feature request:

    The by far best site for tv subtitles is Addic7ed in my opinion. Is it possible to add that site?
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Re: SubtitleDownloader 2.6

    Feature request:

    The by far best site for tv subtitles is Addic7ed in my opinion. Is it possible to add that site?

    Hi,

    Like SilentException said in the SubCentral thread there is no API available and parsing the site might be difficult and hard to maintain. So at the moment there is no "official" support planned, of course anyone can try to provide an implementation.

    Good thing is that many of the officially supported sites also include subtitles from Addic7ed site.
     

    DuckTest

    Portal Member
    April 21, 2011
    11
    3
    Home Country
    Netherlands Netherlands
    Re: SubtitleDownloader 2.6

    Hi,

    I have a problem with bierdopje.com and unicode (utf-8) subtitles. It seams this is fixed with the new API of bierdopje.com (v1.6.4 - march 9), I tested it local with the c# resources.
    Downloads - bierdopjeapi - An C# wrapper of the Bierdopje API - Google Project Hosting
    Can this new API included in a new release of SubtitleDownloader?

    Where are the sources of SubtitleDownloader located? So I can compile my own version?
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Re: SubtitleDownloader 2.6

    Hi,

    I have a problem with bierdopje.com and unicode (utf-8) subtitles. It seams this is fixed with the new API of bierdopje.com (v1.6.4 - march 9), I tested it local with the c# resources.
    Downloads - bierdopjeapi - An C# wrapper of the Bierdopje API - Google Project Hosting
    Can this new API included in a new release of SubtitleDownloader?

    Where are the sources of SubtitleDownloader located? So I can compile my own version?

    Can you please give me the settings and information how to reproduce this problem. Thank you.
     

    DuckTest

    Portal Member
    April 21, 2011
    11
    3
    Home Country
    Netherlands Netherlands
    Re: SubtitleDownloader 2.6

    The problem is easy to reproduce:
    1) Download the subtitle of "The Hand That Rocks the Wheelchair" of Family Guy (S9E12) manual (dutch)
    2) Download it with MP-Tvseries

    When comparing the two files: check line 3.
    Manual:
    Code:
    ♪ It seems today
    with MP-Tvseries:
    Code:
    ? It seems today

    When I checked the encoding with Notepad++:
    Manual: UTF-8 (with BOM)
    with MP-TVseries: ANSI

    Same problem with subcentral (of course). Further testing with some C# code, this seems an issue of bierdopje.com API. When I substituted the old bierdopje API with the new API the problem was solved. :)

    edit: when looking at the old bierdopje API. They used before the 'Windows-1252' encoding.
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Re: SubtitleDownloader 2.6

    The problem is easy to reproduce:
    1) Download the subtitle of "The Hand That Rocks the Wheelchair" of Family Guy (S9E12) manual (dutch)
    2) Download it with MP-Tvseries

    When comparing the two files: check line 3.
    Manual:
    Code:
    ♪ It seems today
    with MP-Tvseries:
    Code:
    ? It seems today

    When I checked the encoding with Notepad++:
    Manual: UTF-8 (with BOM)
    with MP-TVseries: ANSI

    Same problem with subcentral (of course). Further testing with some C# code, this seams an issue of bierdopje.com API. When I substituted the old bierdopje API with the new API the problem was solved. :)

    edit: when looking at the old bierdopje API. They used before the 'Windows-1252' encoding.

    Fixed in 2.7
     

    Users who are viewing this thread

    Top Bottom