Skip to content

Commit 62d864e

Browse files
committed
Update version, history and fixes
1 parent ee954c7 commit 62d864e

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

docs/history.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
History
22
=======
33

4+
0.4.4 (27-03-2020)
5+
------------------
6+
7+
* Allow parsing empty SBV captions, thanks to `@ishunyu <https://github.com/ishunyu>`_ (#26)
8+
* Fix invalid time cues, thanks to `@sontek <https://github.com/sontek>`_ (#19)
9+
* Enable pytest as test runner, thanks to `@sontek <https://github.com/sontek>`_ (#20)
10+
* Packaging improvements
11+
* Added Python 3.8 support
12+
* Improve parsing empty lines
13+
414
0.4.3 (22-11-2019) Few improvements
515
-----------------------------------
616

webvtt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.4.3'
1+
__version__ = '0.4.4'
22

33
from .webvtt import *
44
from .segmenter import *

webvtt/parsers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class SRTParser(TextBasedParser):
133133
SRT parser.
134134
"""
135135

136-
TIMEFRAME_LINE_PATTERN = re.compile('\s*(\d+:\d{2}:\d{2},\d{3})\s*-->\s*(\d+:\d{2}:\d{2},\d{3})')
136+
TIMEFRAME_LINE_PATTERN = re.compile(r'\s*(\d+:\d{2}:\d{2},\d{3})\s*-->\s*(\d+:\d{2}:\d{2},\d{3})')
137137

138138
PARSER_OPTIONS = {
139139
'ignore_empty_captions': True
@@ -155,9 +155,9 @@ class WebVTTParser(TextBasedParser):
155155
WebVTT parser.
156156
"""
157157

158-
TIMEFRAME_LINE_PATTERN = re.compile('\s*((?:\d+:)?\d{2}:\d{2}.\d{3})\s*-->\s*((?:\d+:)?\d{2}:\d{2}.\d{3})')
159-
COMMENT_PATTERN = re.compile('NOTE(?:\s.+|$)')
160-
STYLE_PATTERN = re.compile('STYLE[ \t]*$')
158+
TIMEFRAME_LINE_PATTERN = re.compile(r'\s*((?:\d+:)?\d{2}:\d{2}.\d{3})\s*-->\s*((?:\d+:)?\d{2}:\d{2}.\d{3})')
159+
COMMENT_PATTERN = re.compile(r'NOTE(?:\s.+|$)')
160+
STYLE_PATTERN = re.compile(r'STYLE[ \t]*$')
161161

162162
def __init__(self):
163163
super().__init__()
@@ -279,7 +279,7 @@ class SBVParser(TextBasedParser):
279279
YouTube SBV parser.
280280
"""
281281

282-
TIMEFRAME_LINE_PATTERN = re.compile('\s*(\d+:\d{2}:\d{2}.\d{3}),(\d+:\d{2}:\d{2}.\d{3})')
282+
TIMEFRAME_LINE_PATTERN = re.compile(r'\s*(\d+:\d{2}:\d{2}.\d{3}),(\d+:\d{2}:\d{2}.\d{3})')
283283

284284
PARSER_OPTIONS = {
285285
'ignore_empty_captions': True

0 commit comments

Comments
 (0)