-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subtitles fron NapiProjekt are not in .srt format #536
Comments
Here is the link to the discussion. |
Thanks @bogdal. @DDamian can you provide more details https://github.com/Diaoul/subliminal/blob/develop/CONTRIBUTING.md ? |
Hi, sure, just tell me what details you need. I am using it from SickRage, but anyway, it doesn't matter, because all subtitles from NapiProjekt are always in mDVD format and as far as I know, they're always encoded Windows-1250. So Subliminal and SickRage(using subliminal) will behave the same way here. I'm not sure if we could maybe try assume that if subtitles downloader is NapiProjekt, then force Windows-1250 -> UTF8 encoding - this would solve us the encoding problem. (But this is just an idea). About converting subtitles from mDVD to srt, it should be quite simple, we just need to get framerate of video and then it's quite easy to convert. As far as I know Subconv does all that, but I guess it could be easily done manually, it's up to you. I'm willing to help. Thanks |
BTW, why would it require proper encoding detection? We can convert mDVD->srt in any encoding and just save it with this encoding to .srt. Can't we ? |
One more, just tested with latest dev from Subliminal. When it downloads from napiprojekt, subtitles are Windows-1250, but if I set Subliminal to convert to utf8 - it guess original encoding to be Iso-8859-2 and then convert to utf8. Its successfull, but FEW polish characters are displayed incorrectly, not all of them, just few. And this FEW is because of difference between Windows-1250 and Iso-8859-2. So once again I think we could succcessfully convert napiprojekt subs to UTF-8, but we must tell subliminal, that original encoding is Windows-1250, not ISO-8859-2. |
Just to clarify, I don't support Sick*, it uses subliminal's dev branch + custom patches that I'm unaware of. Contributions to subliminal are welcome in subliminal's repo with proper unittests. Encoding detection is not required for mDVD or SubRip but most parsers out there parse strings, not bytes. In the linked issues I'm considering creating my own subtitle parser and supporting parsing bytes. Do you know for sure this is always the same encoding? If so, fixing the encoding issue will be easy. |
I know that. And for now I am sure that SickRage does not change anything about encoding/format of subtitles. But just to be sure I repeated the test with original Subliminal, and I know all updates has to be done on Subliminal and then moved to SR, not the other way around. Well, there is no 'official' documentation for NapiProjekt, but I found on multiple websites that people claim it alwasy is Win-1250. Also, I download with custom scripts subs from Napiprojekt for years already, and it was always win-1250 as far as I remember. Is that enough, to assume it is 'for sure' ;) ;) ? |
Yes, it's enough. If that doesn't work for somebody we'll revert. This leaves the parsing and/or detecting of subtitles other than SubRip format. |
Agreed. For NapiProjekt, we again don't need detection, because it's always mDVD. |
Here is subconv.py I have, maybe it's useful:
|
What about saving in .sub then instead of converting? Support for other subtitles format is not an easy thing as subliminal is currently built on the assumption of SubRip format. I need to abstract the whole subtitle content part and that user can chose the format he wants with the encoding he wants. |
It will not help me in any way. Many video players only support .srt subtitles. :( |
Actually you know what, I just tried the main video player I use, it turned out that it can handles those subtitles when I change extension to .sub. So YEAH! :) Just save it with correct extension and it's fine for me! |
I disabled NapiProjekt provider for now, a fix will come later when I implement a subtitle parser and not dependent on the subtitle format. |
Adds shooter.cn provider Removes itasa provider until it can be finalized into upstream since it downloads incorrect subtitles #1457 Removes napiprojekt Diaoul/subliminal#536 Replaces #1315
Adds shooter.cn provider Removes itasa provider until it can be finalized into upstream since it downloads incorrect subtitles #1457 Removes napiprojekt Diaoul/subliminal#536 Replaces #1315
Please restore the provider! I was wondering why Sickrage suddenly stopped downloading subtitles for my shows, until I discovered b7030e2... Napiprojekt is the most complete provider for Polish subtitles: very often the only one, which has Polish subtitles for some shows. And this specific issue is a problem only for some of the users (e.g. Kodi or VLC handle non-srt subtitles well). Just disable the provider by default in the configuration, but allow to turn it on, please. |
In 2.0 you will be able to enable it manually. |
If it will be of any help, take a look at my own converter that I have been successfully using to convert any subtitles format available from napiprojekt to srt: subtitles.py |
Are there any updates on this? |
@Diaoul Maybe we could fork it because aeidon has code that is used in gaupol that is not necessary. For example a subtitle has MAIN and TRANSLATION texts, or that it only operates on files not on raw text or streams. See this example code from my script: target_format = aeidon.formats.SUBRIP
subtitle_path = get_subtitle_path(video.name, s.language)
source_format = aeidon.util.detect_format(subtitle_path, encoding)
source_file = aeidon.files.new(source_format, subtitle_path, aeidon.encodings.detect_bom(subtitle_path) or encoding)
aeidon_subtitles = source_file.read()
for f in [aeidon.formats.SUBRIP, aeidon.formats.MICRODVD, aeidon.formats.MPL2]:
markup = aeidon.markups.new(f)
for s in aeidon_subtitles:
s.main_text = markup.decode(s.main_text)
markup = aeidon.markups.new(target_format)
for s in aeidon_subtitles:
s.main_text = markup.encode(s.main_text)
target_file = aeidon.files.new(target_format, subtitle_path, encoding)
target_file.write(aeidon_subtitles, aeidon.documents.MAIN) Not only does it convert between formats but it also converts tags from different formats to subrip (ex. mdvd tags in subrip file). |
Hi,
So all subtitles downloaded from napiprojekt, are in mDVD format, not srt. I noticed though that Subliminal saves them with .srt extension, but if player supports only .srt, they will not work.
Is there a chance to use eg. subconv to convert such subtitles from mDVD to srt format on fly ?
Thanks
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: