ass_tag_parser
ass_tag_parser copied to clipboard
Don't raise an exception, simply have a class for unknow tag
Currently, ass_tag_parser can't parse VSFilterMod tag which is totally ok, because they have they are useless.
But, it would be better if it could not raise an exception. It should simply have a class for unknowtag.
Here is the code I have:
result = parse_ass(
r"{\fnJester\fsc20}test"
)
print(result)
What it currently does: ass_tag_parser.errors.BadAssTagArgument: syntax error at pos 16: \fs requires an integer
What it could do: [AssTagListOpening(), AssTagFontName(name='Jester'), AssUnknowTag(text=fsc20), AssTagListEnding(), AssText(text='test')]
@moi15moi
The AssUnknownTag
approach won't work because we don't know the grammar of unknown tags. We don't know where they end and where a comment should start.
Since I don't have time to actively maintain this project, please consider opening a pull request that introduces strict
argument to the parse
function which ignores exceptions and treats unknown tags as comments.
Thanks for the fast answer.
I will see if I do something, but I doubt I will be able to do anything.