ewwink / python-srt2ass Goto Github PK
View Code? Open in Web Editor NEWPython Script to Convert Subtitle formats from .srt to .ass
Python Script to Convert Subtitle formats from .srt to .ass
After converting some lines get skipped, for example the original srt file contains 500 lines, the converted version (ass) contains 450 lines !
If i need the following format, how to add "Dialogue: 0,0: 00: 00.00,0: 00: 03.85, Logo ,, 0,0,0 ,, Dialogue: 0,0:00:00.00,0:00:03.85,Logo,,0,0,0,,此字幕僅供學習交流,請勿用於商業用途。 " This line
[Script Info]
ScriptType: V4.00+
Collisions: Reverse
PlayResX: 1280
PlayResY: 720
Timer: 100.0000
WrapStyle: 0
ScaledBorderAndShadow: no
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Microsoft JhengHei,68,&H0000FFFF,&H000000FF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,2,3,2,50,50,12,1
Style: Comment,Microsoft JhengHei,40,&H00FFFFFF,&H0000FFFF,&H00000000,&H64000000,-1,0,0,0,100,100,0,0,1,2,2,2,50,50,200,136
Style: Preview,Microsoft JhengHei,65,&H00FFFFFF,&H000000FF,&H00000080,&H64000000,-1,0,0,0,100,100,0,0,1,2,3,1,50,50,12,1
Style: Review,Microsoft JhengHei,65,&H120456DF,&H000000FF,&H00000000,&H00000000,-1,-1,0,0,100,100,0,0,1,2,3,2,50,50,12,1
Style: Song,Microsoft JhengHei,50,&H00FFFFFF,&H000000FF,&H00A37C00,&H00000000,-1,-1,0,0,100,100,0,0,1,2,2,9,50,50,12,1
Style: Logo,Microsoft JhengHei,45,&H00FFFFFF,&H0000FFFF,&H00000080,&H80000000,-1,0,0,0,100,100,0,0,1,3,1,2,20,20,3,136
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:00.00,0:00:03.85,Logo,,0,0,0,,此字幕僅供學習交流,請勿用於商業用途。
File "/path/to/srt2ass.py", line 69
tmpLines += '\N' + line
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-1: malformed \N character escape
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.