home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
SubCentral
SubtitleDownloader
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="seco" data-source="post: 927705" data-attributes="member: 54595"><p>Hi,</p><p> </p><p>First of all thank you for contributing. I suppose you have already visited SubtitleDownloader project page, especially code samples (<a href="https://www.assembla.com/spaces/subtitledownloader/wiki/Code_Examples" target="_blank">https://www.assembla.com/spaces/subtitledownloader/wiki/Code_Examples</a>).</p><p> </p><p></p><p> </p><p>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).</p><p> </p><p>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 (<a href="http://www.turkcealtyazi.org/sub/166719/heroes.html" target="_blank">http://www.turkcealtyazi.org/sub/166719/heroes.html</a>) where seems to be a decent description that you can use directly: "<span style="font-family: 'Arial'"><span style="color: #666666">Heroes.S01.720p.HDTV.x264-CTU"</span></span></p><p> </p><p></p><p> </p><p> </p><p>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:</p><p> </p><p>[CODE]using (Stream stream = File.OpenRead(file))</p><p>{</p><p> IReader reader = ReaderFactory.Open(stream);</p><p> while (reader.MoveToNextEntry())</p><p> {</p><p> if (!reader.getEntry().getIsDirectory())</p><p> {</p><p> IReaderExtensions.WriteEntryToDirectory(...);</p><p> }</p><p> }</p><p>}[/CODE]</p><p> </p><p></p><p> </p><p>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.</p><p> </p><p>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.</p></blockquote><p></p>
[QUOTE="seco, post: 927705, member: 54595"] Hi, First of all thank you for contributing. I suppose you have already visited SubtitleDownloader project page, especially code samples ([url]https://www.assembla.com/spaces/subtitledownloader/wiki/Code_Examples[/url]). 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 ([url]http://www.turkcealtyazi.org/sub/166719/heroes.html[/url]) where seems to be a decent description that you can use directly: "[FONT=Arial][COLOR=#666666]Heroes.S01.720p.HDTV.x264-CTU"[/COLOR][/FONT] 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(...); } } }[/CODE] 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. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
SubCentral
SubtitleDownloader
Contact us
RSS
Top
Bottom