[LinkedInLearning] Fix newline bug in subtitles (#1104)

Authored by: Ashish0804
pull/1113/head
Ashish Gupta 3 years ago committed by GitHub
parent 250a938de8
commit 80c360d7aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -94,9 +94,9 @@ class LinkedInLearningIE(LinkedInLearningBaseIE):
for line, (line_dict, next_dict) in enumerate(zip_longest(transcript_lines, transcript_lines[1:])): 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'] 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 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_data += '%d\n%s --> %s\n%s\n\n' % (line + 1, srt_subtitles_timecode(start_time),
srt_subtitles_timecode(end_time), srt_subtitles_timecode(end_time),
caption) caption)
return srt_data return srt_data
def _real_extract(self, url): def _real_extract(self, url):

Loading…
Cancel
Save