srt-parser
srt-parser copied to clipboard
doesnt work when \n\n is at the end of a srt text
Hi there, I noticed that if a subtitle text has \n\n at the end of it, the next subtitle text is included as the text. This causes an error:
example: the Vanderhall is a great option.\n\n28\n00:01:32,70 --> 00:01:34,70\nNow for the second car of our lineup,\n\n29\n00:01:34,70 --> 00:01:37,80\nat just under $20,000,the Polaris Slingshot\n\n30\n00:01:37,80 --> 00:01:40,60\nhas the least expensive\nstarting price of the group,\n\n31\n00:01:40,60 --> 00:01:42,110\nbut it comes with the most technology.
Any ideas how to fix this?
1 00:00:07,970 --> 00:00:09,620 Hey guys, we're here on the beautiful
2 00:00:09,620 --> 00:00:13,150 Angeles Crest Highway with a very special treat,
3 00:00:13,150 --> 00:00:16,50 3 three wheelers; the Polaris Slingshot,
4 00:00:16,50 --> 00:00:19,200 the Vanderhall Speedster, and the Morgan 3 Wheeler.
5 00:00:19,200 --> 00:00:21,270 They all have three wheels but they all are
6 00:00:21,270 --> 00:00:23,380 very different from the other two.
7 00:00:23,380 --> 00:00:25,630 I can't wait to see how they drive, let's go.
8 00:00:39,067 --> 00:00:41,980 The first of our lot is the Vanderhall Venice Speedster.
9 00:00:41,980 --> 00:00:45,880 In a weird way, this $27,000 speedster is the most
10 00:00:45,880 --> 00:00:47,730 futuristic car of the group.
11 00:00:47,730 --> 00:00:51,210 It's a turbo-boosted, 6-speed, automatic machine,
12 00:00:51,210 --> 00:00:53,210 but it is relatively practical.
13 00:00:53,210 --> 00:00:55,310 With large amounts of storage in the cockpit,
14 00:00:55,310 --> 00:00:57,500 and it's perfect for cruising down the open road
15 00:00:57,500 --> 00:00:59,40 for extended periods of time.
16 00:00:59,40 --> 00:01:02,180 Not to incriminate myself, but I did have this puppy
17 00:01:02,180 --> 00:01:05,280 cruising happily up past 90 miles per hour and
18 00:01:05,280 --> 00:01:06,550 it didn't miss a beat.
19 00:01:06,550 --> 00:01:09,970 In fact, it was almost dialed in too much.
20 00:01:09,970 --> 00:01:12,100 You get the definite feeling that one wrong
21 00:01:12,100 --> 00:01:15,120 flick of the wrist or misstep on the breaks
22 00:01:15,120 --> 00:01:17,710 could get you into a very hairy situation
23 00:01:17,710 --> 00:01:20,150 and this beast corners beautifully.
24 00:01:20,150 --> 00:01:23,470 All in, it was my favorite one to drive of the group.
25 00:01:23,470 --> 00:01:26,500 If you kind of like a futuristic yet retro-style
26 00:01:26,500 --> 00:01:28,806 and you want something ideal for long cruises,
27 00:01:28,806 --> 00:01:31,153 the Vanderhall is a great option.
28 00:01:32,70 --> 00:01:34,70 Now for the second car of our lineup,
29 00:01:34,70 --> 00:01:37,80 at just under $20,000, the Polaris Slingshot
30 00:01:37,80 --> 00:01:40,60 has the least expensive starting price of the group,
31 00:01:40,60 --> 00:01:42,110 but it comes with the most technology.
32 00:01:42,110 --> 00:01:44,210 The minute you step inside you feel like
33 00:01:44,210 --> 00:01:46,60 you could take this thing anywhere.
34 00:01:46,60 --> 00:01:49,700 This is by far the fastest and most capable of any
35 00:01:49,700 --> 00:01:52,140 on rough terrain or for the long haul.
36 00:01:52,140 --> 00:01:55,210 It also comes with creature comforts like backup cameras,
37 00:01:55,210 --> 00:01:58,650 cup holders, and a push-button start that is as easy to
38 00:01:58,650 --> 00:02:00,830 activate as the clutch is to use.
39 00:02:00,830 --> 00:02:02,740 This is a 5-speed, 3 Wheeler
40 00:02:02,740 --> 00:02:04,870 with a car-like manual transmission.
41 00:02:04,870 --> 00:02:07,960 It's paired with a 173 horsepower,
42 00:02:07,960 --> 00:02:12,470 GM made, four-cylinder engine, and traction control systems
43 00:02:12,470 --> 00:02:16,240 that make the Polaris the most like the modern car to drive,
44 00:02:16,240 --> 00:02:18,850 but I have to admit, I just can't get past
45 00:02:18,850 --> 00:02:21,10 the circus sideshow looks here,
46 00:02:21,10 --> 00:02:23,320 that cartoonish body styling,
47 00:02:23,320 --> 00:02:25,723 I really can't get into the idea of owning one.
48 00:02:28,20 --> 00:02:30,640 And finally, the supermodel of the group,
49 00:02:30,640 --> 00:02:34,100 the Special Edition Morgan 3 Wheeler, that we drove today
50 00:02:34,100 --> 00:02:37,980 costs $80,000, but that is to be expected.
51 00:02:37,980 --> 00:02:40,609 Each Morgan 3 Wheeler is hand-built in England
52 00:02:40,609 --> 00:02:43,740 at the same factory that they built them in since 1914.
53 00:02:45,30 --> 00:02:48,160 The beautiful detailing of the dashboard instruments,
54 00:02:48,160 --> 00:02:50,710 the careful stitching on the leather seats,
55 00:02:50,710 --> 00:02:54,40 and the intricate craftsmanship of the V Twin engine
56 00:02:54,40 --> 00:02:57,440 at the front of the car, captivate from every angle.
57 00:02:57,440 --> 00:02:59,550 Now, the Morgan is a manual vehicle,
58 00:02:59,550 --> 00:03:01,570 the clutch is super tight and high,
59 00:03:01,570 --> 00:03:04,790 there is no power steering, and the breaks feel wooden
60 00:03:04,790 --> 00:03:06,340 and vague in the typical way
61 00:03:06,340 --> 00:03:08,460 that you'd find any vintage car.
62 00:03:08,460 --> 00:03:10,510 It really keeps you busy when you drive it,
63 00:03:10,510 --> 00:03:12,520 but it is a true delight.
64 00:03:12,520 --> 00:03:15,410 It's all very analog and real in that special way
65 00:03:15,410 --> 00:03:18,380 that we rarely get these days, in a world dominated
66 00:03:18,380 --> 00:03:20,630 with computer and cellphone screens.
67 00:03:20,630 --> 00:03:23,900 The Morgan is by far the most raw and engaging drive
68 00:03:23,900 --> 00:03:25,393 experience of the bunch.
69 00:03:26,400 --> 00:03:29,500 Okay, so each of these cars is very different
70 00:03:29,500 --> 00:03:32,870 and I use that term car as loosely, you know what I mean.
71 00:03:32,870 --> 00:03:35,540 I have to admit I was extremely skeptical
72 00:03:35,540 --> 00:03:39,650 about driving them, but each has it's own purpose.
73 00:03:39,650 --> 00:03:42,70 For fast highway cruising, choose the Vanderhall.
74 00:03:42,70 --> 00:03:46,30 For off-road excitement and a tech-laden experience,
75 00:03:46,30 --> 00:03:48,930 hopefully away from anyone who can identify you,
76 00:03:48,930 --> 00:03:50,610 choose the Polaris.
77 00:03:50,610 --> 00:03:53,970 And for the true love of driving a beautiful machine,
78 00:03:53,970 --> 00:03:55,270 choose the Morgan.
79 00:03:55,270 --> 00:03:58,400 With any of these, you can have a lot of fun.
80 00:03:58,400 --> 00:04:01,527 I guess it just goes to show that old saying is true,
81 00:04:01,527 --> 00:04:03,317 "Don't knock it until you try it."
82 00:04:05,720 --> 00:04:06,553 Whoa!
83 00:04:07,510 --> 00:04:08,680 That was awesome!
@firecentaur , I don't think it's related to \n\n, but it's related to time string. As of now, this library suppose that the time has 3 digit milliseconds and your example input has sometimes one or two digit milliseconds for the time. You could find the there are failures for these inputs, only.
I made a PR for this problem resolved. Thanks.