]> jfr.im git - yt-dlp.git/commitdiff
[LinkedInLearning] Fix newline bug in subtitles (#1104)
authorAshish Gupta <redacted>
Tue, 28 Sep 2021 10:36:31 +0000 (16:06 +0530)
committerGitHub <redacted>
Tue, 28 Sep 2021 10:36:31 +0000 (16:06 +0530)
Authored by: Ashish0804

yt_dlp/extractor/linkedin.py

index f47d59a38ceb4565736a5939974eb7bf9869b814..3ce906e2f14a4938c60f3d7059371245ffe837b5 100644 (file)
@@ -94,9 +94,9 @@ def json2srt(self, transcript_lines, duration=None):
         for line, (line_dict, next_dict) in enumerate(zip_longest(transcript_lines, transcript_lines[1:])):
             start_time, caption = line_dict['transcriptStartAt'] / 1000, line_dict['caption']
             end_time = next_dict['transcriptStartAt'] / 1000 if next_dict else duration or start_time + 1
-            srt_data += '%d\n%s --> %s\n%s\n' % (line + 1, srt_subtitles_timecode(start_time),
-                                                 srt_subtitles_timecode(end_time),
-                                                 caption)
+            srt_data += '%d\n%s --> %s\n%s\n\n' % (line + 1, srt_subtitles_timecode(start_time),
+                                                   srt_subtitles_timecode(end_time),
+                                                   caption)
         return srt_data
 
     def _real_extract(self, url):