SubtitleDownloader (4 Viewers)

seco

Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Yeah I understand that.. But what I mean is that I read in the topicstart that with only subtitledownloader installed (without subcentral installed) you can download subtitles within movingpictures and tvseries.. But that's not right I gues? You can download subtitles in these plugins using Subcentral.. (that is using subtitledownloader under de hood)

    Right?

    No, Moving Pictures & TVSeries cannot use SubtitleDownloader directly.

    Think SubCentral as a "library" for all the supported plugins like SubtitleDownloader is a library for SubCentral: no need to repeat the subtitle downloading user interface logic in TVSeries, Moving Pictures, MyFilms etc...
     
    Last edited:

    powermarcel10

    Retired Team Member
  • Premium Supporter
  • November 30, 2010
    2,839
    898
    36
    Groningen
    Home Country
    Netherlands Netherlands
    Now I understand.. It was a bit hard to understand because in the Subcentral thread, nothing is said about subtitledownloader at all! So I thought it was a stand-alone plugin.. But now I know that it needs this "app" to operate..
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    @seco i seem to be having issues with all 3 CSI series on Bierdopje. When i search for subs (SubDownloader 3.0.7) it returns: No results.
    Subs are available online.

    Can someone confirm?
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    @seco i seem to be having issues with all 3 CSI series on Bierdopje. When i search for subs (SubDownloader 3.0.7) it returns: No results.
    Subs are available online.

    Can someone confirm?

    SubCentral logs please or more details if you are not using SubCentral...
     
    Last edited:

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    I was afraid you were gonna ask for those :) I'm indeed using SubCentral, so i'll attach them, although there is nothing special visible on them.

    ** EDIT **
    Just noticed an error in the translation engine:
    Code:
    31-Oct-2012 19:04:31.324 Error [        Localization]: Error in Translation Engine
     System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at SubCentral.Localizations.Localization.LoadTranslations()
    Not sure if it's related, but probably shouldn't be there.
     
    Last edited:

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    I was afraid you were gonna ask for those :) I'm indeed using SubCentral, so i'll attach them, although there is nothing special visible on them.

    ** EDIT **
    Just noticed an error in the translation engine:
    Code:
    31-Oct-2012 19:04:31.324 Error [        Localization]: Error in Translation Engine
    System.ArgumentException: An item with the same key has already been added.
      at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
      at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
      at SubCentral.Localizations.Localization.LoadTranslations()
    Not sure if it's related, but probably shouldn't be there.

    Thanks, I've located the problem & fix is available in the next release (3.0.8).

    Translation error has already been fixed in the upcoming SubCentral 1.2.1.
     

    omerfarukozer

    Portal Member
    April 4, 2010
    32
    12
    Home Country
    Turkey Turkey
    Hi, I have implemented a dll for www.turkcealtyazi.org - probably biggest and most up to date Turkish subtitle portal. Library and source code are attached. This is my first .NET development so coding might be poor.

    I welcome all kinds of feedbacks.

    Seco, I have a few questions. The site does not provide an API and all subtitles are archieved in RAR files.
    1. Because subs are compressed I had to download and extract them first. So SearchSubtitle functions actually downloads subtitles and SaveSubtitle just returns FileInfo. Is there any other way (more elegant) for these cases?
    2. If we search for an old movie (especially an episode of a finished season) there happens lots of downloads just to check filenames. It takes too much time. What would be best practice in this case to increase response times?
    3. For some RAR files ExtractFilesFromZipOrRarFile throws SharpCompress.Common.InvalidFormatException (Cannot use Archive random access on SOLID Rar files) exception. Is this fixable?
    4. I could not find documentation about what the developer should do in case of errors. Should I throw exceptions? What about logs?
     

    Attachments

    • TurkceAltyaziOrg.zip
      8.9 KB
    Last edited:

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Hi,

    First of all thank you for contributing. I suppose you have already visited SubtitleDownloader project page, especially code samples (https://www.assembla.com/spaces/subtitledownloader/wiki/Code_Examples).

    1. Because subs are compressed I had to download and extract them first. So SearchSubtitle functions actually downloads subtitles and SaveSubtitle just returns FileInfo. Is there any other way (more elegant) for these cases?
    2. If we search for an old movie (especially an episode of a finished season) there happens lots of downloads just to check filenames. It takes too much time. What would be best practice in this case to increase response times?

    I can see that the site is quite problematic. I would not suggest to download anything during the search, instead I would try to parse the download URL for the archive and use it as an ID for the Subtitle object which can be later used in SaveSubtitle to download the archive (it is totally up to you what you do with the ID).

    Same goes for the Subtitle object FileName, here you could show serie name, season/episode number plus extra info like "DVDRip", "720p", "ESiR", "HDTV" and other stuff you are able to parse from the site. The FileName actually doesn't need to be a real file name, in the end it is just used for display purposes and the real file names are what SaveSubtitle eventually downloads. Alternatively you can try visiting pages like (http://www.turkcealtyazi.org/sub/166719/heroes.html) where seems to be a decent description that you can use directly: "Heroes.S01.720p.HDTV.x264-CTU"

    For some RAR files ExtractFilesFromZipOrRarFile throws SharpCompress.Common.InvalidFormatException (Cannot use Archive random access on SOLID Rar files) exception. Is this fixable?


    Unfortunately current implementation of ExtractFilesFromZipOrRarFile and the SharpCompress library does not support all RAR files, however you should be able to extract all RAR archives using (semi-pseudo) code like this which uses some classes in SharpCompress library:

    Code:
    using (Stream stream = File.OpenRead(file))
    {
        IReader reader = ReaderFactory.Open(stream);
        while (reader.MoveToNextEntry())
        {
            if (!reader.getEntry().getIsDirectory())
            {
                IReaderExtensions.WriteEntryToDirectory(...);
            }
        }
    }

    I could not find documentation about what the developer should do in case of errors. Should I throw exceptions? What about logs?

    In general you should just throw exceptions, there is no logging available in SubtitleDownloader. Handling & logging errors is responsibility of any program that uses SubtitleDownloader.

    I'll take a closer look at your code when I have more time, I hope you can fix most of your problems with suggestions I gave above.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom