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
new subtitle file does not have attachments #126
Comments
ffsubsync uses pysubs2 to handle various subtitle types, but from what I saw it seems pysubs2 does not consider embedded fonts. Maybe you could ask them to consider it. |
pysubs2 now supports fonts but ffsubsync still doesn't add fonts to new subtitle file |
For the first point, in https://github.com/smacke/ffsubsync/blob/master/ffsubsync/subtitle_parser.py#L125 fonts_opaque=(
parsed_subs.fonts_opaque
if isinstance(parsed_subs, pysubs2.SSAFile)
else None
) I note there is And after looking at appearances of fonts_opaque=subs.fonts_opaque, For the second point, I handle the new https://github.com/smacke/ffsubsync/blob/master/ffsubsync/generic_subtitles.py#L90 class GenericSubtitlesFile:
def __init__(self, ...):
...
self._fonts_opaque = kwargs.pop('fonts_opaque', None) # new line
# New property
@property
def fonts_opaque(self):
return self._fonts_opaque
def offset(self, ...):
...
return GenericSubtitlesFile(
...,
fonts_opaque=self.fonts_opaque, # new line
)
def write_file(self, ...):
...
if self._sub_format in ('ssa', 'ass'):
...
# 2 new lines
if self.fonts_opaque is not None:
ssaf.fonts_opaque = self.fonts_opaque
...
... I think it should be enough to handle embedded fonts. |
Hi @Philippe-Cholet, thanks for the detailed investigation, and thanks @sethazazel for opening the original issue. The "skip_ssa_info" is only used for integration tests I think to keep the result the same as without the ssa info (I was bad and wrote a few brittle tests). The other thing we need to do is bump the min required version of pysubs2 in requirements.txt. I just pushed a new release of ffsubsync with these changes; they should be picked up after running pip install --upgrade ffsubsync Note that I didn't actually do any end-to-end test involving embedded fonts, so please let me know if you encounter any issues after the upgrade! |
Some subtitle files have attachments (embedded fonts) but after using script attachments dissappear.
before: https://del.dog/ogepedingi
after: https://del.dog/inyrerygnu.txt
The text was updated successfully, but these errors were encountered: